bool checkExceptionHandler() { bool ok = true; LPTOP_LEVEL_EXCEPTION_FILTER prev_filter; prev_filter = SetUnhandledExceptionFilter(myWin32ExceptionHandler); PreventSetUnhandledExceptionFilter(); if (prev_filter != myWin32ExceptionHandler) { LL_WARNS("AppInit") << "Our exception handler (" << (void *)myWin32ExceptionHandler << ") replaced with " << prev_filter << "!" << LL_ENDL; ok = false; } if (prev_filter == NULL) { ok = FALSE; if (NULL == myWin32ExceptionHandler) { LL_WARNS("AppInit") << "Exception handler uninitialized." << LL_ENDL; } else { LL_WARNS("AppInit") << "Our exception handler (" << (void *)myWin32ExceptionHandler << ") replaced with NULL!" << LL_ENDL; } } return ok; }
//////////////////////////////////////////////////////////////////////////////// // Hook our exception handler and replace the system one void initExceptionHandler() { LPTOP_LEVEL_EXCEPTION_FILTER prev_filter; // save old exception handler in case we need to restore it at the end prev_filter = SetUnhandledExceptionFilter( myWin32ExceptionHandler ); PreventSetUnhandledExceptionFilter(); }
void RunCrashHandler(){ SetUnhandledExceptionFilter(UnhandledExceptionFilterEx); PreventSetUnhandledExceptionFilter(); return; }
BOOL CDumpCatch::AddExceptionHandle() { m_preFilter = ::SetUnhandledExceptionFilter(UnhandledExceptionFilterEx); PreventSetUnhandledExceptionFilter(); return TRUE; }