Issue with exceptions detected by Win32 Message Manager

This is a kind of very low level question, but maybe someone has an understanding ...

I have a problem where unhandled SEH exceptions (such as access violations) seem to fall into the Win32 message sending level rather than shutting down the program. I found the following help blog that explains the problem, but only in the context of WM_TIMER posts: http://bugswar.blogspot.com/2010/07/why-its-not-crashing.html

I ran into a problem with Win 2008R2 and "normal" messages (for example: WM_COMMAND, etc.). I suspect that Windows may try to β€œhelp” by masking exceptions, but I want this to be an error; the continue and ignore behavior causes problems with the application as a whole. I understand that I can try to wrap every function in try / catch and use the / EHa compiler option to convert SEH exceptions to C ++ exceptions (which in itself is very discouraging and dangerous), but this is clearly not optimal.

According to the indicated block, there is a flag in AppCompatFlags2 in the TIB structure (http://en.wikipedia.org/wiki/Win32_Thread_Information_Block), which can lead to the Win32 handler not catching / eliminating the SEH exception, but I don’t know how to install / enable it. Does anyone know about this? Is there an AppCompat parameter that I can enable so that Windows doesn't catch and ignore exceptions?

+4
source share
2 answers

I think this is by design, but obviously it was not thoroughly considered. Perhaps an unscrupulous attempt to make some legacy applications "behave".

You can override this behavior in Windows 7 SP1; I wrote more about this fooobar.com/questions/1326199 / ....

+1
source

I don’t know how compatibility options affect this particular aspect, but you can choose one of several compatibility modes from the EXE properties page in Windows Explorer (at least on W7 and Vista). I seem to remember that you can also request specific information from the manifest.

0
source

All Articles