winapisehstructured-exception

What exactly is "application-defined" about UnhandledExceptionFilter?


MSDN describes UnhandledExceptionFilter as follows: "An application-defined function that passes unhandled exceptions to the debugger, if the process is being debugged."

But this function is clearly supplied by the OS, in kernel32.dll according to that same page.

So why do they call it an application-defined function?


Solution

  • Yes, very awkward language. It is a prototype definition of a function. Which you can use with the __except keyword or as an argument to SetUnhandledExceptionFilter(). Either would make yours an 'application defined function'.

    There's default handling if you do neither, the debugger automatically stops at an unhandled exception. Which I suppose is what they meant with "that passes exceptions to the debugger". The SDK docs for SEH deserve an all-around failing grade.