We\'re on Windows and we want to get a crash dump (possibly using MiniDumpWriteDump
) for all scenarios where our application exit\'s unexpectedly.
Tall order, just in brief:
_set*
functions, SetUnhandledExceptionFilter
is enough for all.abort
will disable the global exception handler, which you setup using SetUnhandledExceptionFilter
. CRT will simply call this same function will NULL
parameter, and your exception-handler is disabled (not called), if CRT is causing crash! What you can do? [X]CreateToolhelp32Snapshot
, and other functions. Look for this process, and suspend all other running threads (except current, ofcourse).There is more to it, which I haven't tried (not found usefulness) - Vectored Exception Handling.
One other approach is to run the application into a debugger, which you can craft yourself! In the debugger, you can catch ALL exceptions, just like VS debugger catches. See my article. But, you know, this is not proper approach.
EDIT: Just read the last content about process-termination. You shouldn't control that. In any case, you can just hook the required APIs, which would act as what you code for (like displaying message box).
[X] You need to use API hooking. I dont have link and details handy. You'd hook other related APIs, but primarily the SetUnhandledExceptionFilter
(after you'd called it for you). You dummy (hooked) function will look like:
xxx SetUnhandledExceptionFilter_DUMMY(xxx)
{
// Dont do any thing
return NULL;
}
I dont have link and details of API hooking handy.
And why not attempt to make your application more safe?