ok use exception filter

typo

no infinite loops
This commit is contained in:
Rick V 2019-06-20 04:19:04 -05:00
parent 16096c6adb
commit 578bcba73d
No known key found for this signature in database
GPG Key ID: C0EDC8723FDC3465
2 changed files with 5 additions and 4 deletions

View File

@ -16,7 +16,7 @@
#ifdef _WIN32
#define wmin(x, y) (((x) < (y)) ? (x) : (y))
#define MIN wmin
extern "C" void win32_signal_handler(int);
extern "C" LONG FAR PASCAL win32_signal_handler(EXCEPTION_POINTERS*);
#endif
struct llarp_main *ctx = 0;
@ -117,7 +117,7 @@ main(int argc, char *argv[])
if(startWinsock())
return -1;
SetConsoleCtrlHandler(handle_signal_win32, TRUE);
signal(SIGSEGV, win32_signal_handler);
SetUnhandledExceptionFilter(win32_signal_handler);
#endif
#ifdef LOKINET_DEBUG

View File

@ -656,7 +656,7 @@ GenerateCrashDump(MINIDUMP_TYPE flags, EXCEPTION_POINTERS *seh)
}
// ok try a UNIX-style signal handler
__declspec(noreturn) void win32_signal_handler(int s)
__declspec(noreturn) LONG FAR PASCAL win32_signal_handler(EXCEPTION_POINTERS *e)
{
MessageBox(NULL,
"A fatal error has occurred. A core dump was generated and "
@ -669,7 +669,8 @@ __declspec(noreturn) void win32_signal_handler(int s)
| MiniDumpWithProcessThreadData | MiniDumpWithFullMemoryInfo
| MiniDumpWithUnloadedModules | MiniDumpWithFullAuxiliaryState
| MiniDumpIgnoreInaccessibleMemory | MiniDumpWithTokenInformation,
NULL);
e);
exit(127);
return 0;
}
#endif