From e1b128415366c2115c00a186fcaa5a6616db4bc5 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Tue, 27 Oct 2020 12:38:54 -0700 Subject: [PATCH] tst: winfsp-tests: UnhandledExceptionFilter --- tst/winfsp-tests/winfsp-tests.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tst/winfsp-tests/winfsp-tests.c b/tst/winfsp-tests/winfsp-tests.c index f6b33e10..130ba689 100644 --- a/tst/winfsp-tests/winfsp-tests.c +++ b/tst/winfsp-tests/winfsp-tests.c @@ -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; }