| 163 | } |
| 164 | |
| 165 | static void InitUnhandledExceptionFilter() |
| 166 | { |
| 167 | TCHAR szModName[_MAX_PATH]; |
| 168 | if (GetModuleFileName(NULL, szModName, sizeof(szModName) / sizeof(TCHAR)) != 0) |
| 169 | { |
| 170 | _tcscpy_s(s_szExceptionLogFileName, szModName); |
| 171 | _tcscat_s(s_szExceptionLogFileName, _T(".exp.log")); |
| 172 | } |
| 173 | if (s_bUnhandledExeptionFilterSet == FALSE) |
| 174 | { |
| 175 | // set global exception handler (for handling all unhandled exceptions) |
| 176 | SetUnhandledExceptionFilter(CrashHandlerExceptionFilter); |
| 177 | #if defined _M_X64 || defined _M_IX86 |
| 178 | PreventSetUnhandledExceptionFilter(); |
| 179 | #endif |
| 180 | s_bUnhandledExeptionFilterSet = TRUE; |
| 181 | } |
| 182 | } |
| 183 | #endif // UNHANDLED_EXCEPTION_TEST |
| 184 | |
| 185 | #ifdef EXCEPTION_FILTER_TEST |
no test coverage detected