Win32: Load AddVectoredExceptionHandler function at run time

See: #116
This commit is contained in:
Jonathan G Rennison 2019-11-17 21:38:42 +00:00
parent b132272fb1
commit 8b9c9e93f8

View File

@ -622,7 +622,12 @@ static void CDECL CustomAbort(int signal)
_set_abort_behavior(0, _WRITE_ABORT_MSG); _set_abort_behavior(0, _WRITE_ABORT_MSG);
#endif #endif
SetUnhandledExceptionFilter(ExceptionHandler); SetUnhandledExceptionFilter(ExceptionHandler);
AddVectoredExceptionHandler(1, VectoredExceptionHandler);
using VEX_HANDLER_TYPE = LONG WINAPI (EXCEPTION_POINTERS *);
void* (WINAPI *AddVectoredExceptionHandler)(ULONG, VEX_HANDLER_TYPE*);
if (LoadLibraryList((Function*)&AddVectoredExceptionHandler, "kernel32.dll\0AddVectoredExceptionHandler\0\0")) {
AddVectoredExceptionHandler(1, VectoredExceptionHandler);
}
BOOL (WINAPI *SetThreadStackGuarantee)(PULONG); BOOL (WINAPI *SetThreadStackGuarantee)(PULONG);
if (LoadLibraryList((Function*)&SetThreadStackGuarantee, "kernel32.dll\0SetThreadStackGuarantee\0\0")) { if (LoadLibraryList((Function*)&SetThreadStackGuarantee, "kernel32.dll\0SetThreadStackGuarantee\0\0")) {