Sunday, October 17, 2010

Using SetUnhandledExceptionFilter API

Tip - SetUnhandledExceptionFilter enables an application to supersede the top-level exception handler of each thread of a process.

Details - After calling this function, if an exception occurs in a process that is not being debugged, and the exception makes it to the unhandled exception filter, that filter will call the exception filter function specified as parameter.

Here, MyCustomFilter is a pointer to a top-level exception filter function that will be called whenever the SetUnhandledExceptionFilter function gets control, and the process is not being debugged. See the attached sample application


Issuing SetUnhandledExceptionFilter replaces the existing top-level exception filter for all existing and all future threads in the calling process. This method is useful for generating application minidumps during crash and these minidumps can be easily debugged through WinDebug.

Posted by - Shiju CK

No comments:

Post a Comment