FIX: SEH exceptions are caught by wrong exception handler when asynchronous exception handling is enabled in WEC 2013

This article describes an issue in which SEH exceptions are caught by a wrong handler in Windows Embedded Compact 2013. An update is available to fix this issue. Before you install this update, all previously issued updates for this product must be installed.

Symptoms

Consider the following scenario:
  • You use the Application Builder plug-in for Visual Studio 2013 to create a C++ application that targets Windows Embedded Compact 2013.
  • You enable the asynchronous exception handling by using the "/EHa" compiler switch. This switch allows both C++ synchronous and structured exception handling (SEH) asynchronous exception handling methods to be mixed in the same code.
  • You run the related code to catch SEH exceptions.
In this scenario, SEH exceptions are always caught in the very first exception handler even if it's filtered for a C++ synchronous exception. 

The expected behavior is SEH exceptions being caught by the ellipsis exception handler.

For example, you run the following sample code:
class CMyEx
{
public:
CMyEx(int nParam) : m_nParam(nParam) { }
int m_nParam;
};

void TestExceptions()
{
try
{
int a = 42;
int b = 0;
// throw CMyEx(1);
// throw 97;
int c = a / b;
}
catch (const CMyEx &e)
{
wprintf(L"CMyEx exception caught (param=%d)!\n", e.m_nParam);
}
catch (...)
{
wprintf(L"Exception of unspecified type caught by ellipsis clause!\n");
}
}
In this sample, you always hit the first catch clause when the SEH exception (integer divide by zero) occurs instead of the ellipsis handler as expected.

Resolution

Software update information

Windows Embedded Compact 2013 Monthly Update (September 2015) is now available from Microsoft. To download this Windows Embedded Compact 2013 monthly update, go to Microsoft OEM Online or MyOEM.

Prerequisites

This update is supported only if all previously issued updates for this product have also been installed.

Restart requirement

After you apply this update, you must perform a clean build of the whole platform. To do this, use one of the following methods:
  • On the Build menu, select Clean Solution, and then select Build Solution.
  • On the Build menu, select Rebuild Solution.
You don't have to restart the computer after you apply this software update.

Update replacement information

This update doesn't replace any other updates.
File information

References

Learn about the terminology that Microsoft uses to describe software updates.
Thuộc tính

ID Bài viết: 3008664 - Xem lại Lần cuối: 29-10-2015 - Bản sửa đổi: 1

Phản hồi