| 88 | #endif |
| 89 | |
| 90 | static LONG __stdcall CrashHandlerExceptionFilter(EXCEPTION_POINTERS* pExPtrs) |
| 91 | { |
| 92 | #ifdef _M_IX86 |
| 93 | if (pExPtrs->ExceptionRecord->ExceptionCode == EXCEPTION_STACK_OVERFLOW) |
| 94 | { |
| 95 | static char MyStack[1024*128]; // be sure that we have enought space... |
| 96 | // it assumes that DS and SS are the same!!! (this is the case for Win32) |
| 97 | // change the stack only if the selectors are the same (this is the case for Win32) |
| 98 | //__asm push offset MyStack[1024*128]; |
| 99 | //__asm pop esp; |
| 100 | __asm mov eax,offset MyStack[1024*128]; |
| 101 | __asm mov esp,eax; |
| 102 | } |
| 103 | #endif |
| 104 | |
| 105 | CustomStackWalker sw; // output to console |
| 106 | sw.ShowCallstack(GetCurrentThread(), pExPtrs->ContextRecord); |
| 107 | TCHAR lString[500]; |
| 108 | _stprintf_s(lString, _T("ExpCode: 0x%8.8X ExpFlags: %d ExpAddress: 0x%8.8X\n"), |
| 109 | pExPtrs->ExceptionRecord->ExceptionCode, |
| 110 | pExPtrs->ExceptionRecord->ExceptionFlags, |
| 111 | pExPtrs->ExceptionRecord->ExceptionAddress); |
| 112 | sw.OnOutput(lString); |
| 113 | _stprintf_s(lString, _T("Please send %s to the developer!\n"), |
| 114 | s_szExceptionLogFileName); |
| 115 | FatalAppExit(-1, lString); |
| 116 | return EXCEPTION_CONTINUE_SEARCH; |
| 117 | } |
| 118 | |
| 119 | void InitUnhandledExceptionFilter() |
| 120 | { |