tst: winfsp-tests: UnhandledExceptionFilter

This commit is contained in:
Bill Zissimopoulos 2020-10-27 12:38:54 -07:00
parent 5014e8bd35
commit e1b1284153
No known key found for this signature in database
GPG Key ID: 3D4F95D52C7B3EA3

View File

@ -175,6 +175,16 @@ static void abort_handler(int sig)
LONG WINAPI UnhandledExceptionHandler(struct _EXCEPTION_POINTERS *ExceptionInfo)
{
if (0 != ExceptionInfo && 0 != ExceptionInfo->ExceptionRecord)
{
static CHAR Buf[64];
static DWORD Bytes;
wsprintfA(Buf, "\nEXCEPTION 0x%lx at 0x%p\n",
ExceptionInfo->ExceptionRecord->ExceptionCode,
ExceptionInfo->ExceptionRecord->ExceptionAddress);
WriteFile(GetStdHandle(STD_ERROR_HANDLE), Buf, lstrlenA(Buf), &Bytes, 0);
}
exiting();
return EXCEPTION_EXECUTE_HANDLER;
}