From f2c471558c535a46ddeb5e8add3b75fa2e5c2317 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Tue, 17 Apr 2018 16:22:42 -0700 Subject: [PATCH] CR --- interface/src/Crashpad.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/interface/src/Crashpad.cpp b/interface/src/Crashpad.cpp index c824aaa9e4..27da619af1 100644 --- a/interface/src/Crashpad.cpp +++ b/interface/src/Crashpad.cpp @@ -40,18 +40,19 @@ extern QString qAppFileName(); #include LONG WINAPI vectoredExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo) { - if (pExceptionInfo->ExceptionRecord->ExceptionCode == 0xe06d7363) { // external exception + static const DWORD EXTERNAL_EXCEPTION_CODE{ 0xe06d7363 }; + static const DWORD HEAP_CORRUPTION_CODE{ 0xc0000374 }; + + auto exceptionCode = pExceptionInfo->ExceptionRecord->ExceptionCode; + if (exceptionCode == EXTERNAL_EXCEPTION_CODE) { return EXCEPTION_CONTINUE_SEARCH; } - if (pExceptionInfo->ExceptionRecord->ExceptionCode == 0xc0000374) { // heap corruption - qCritical() << "VectoredExceptionHandler"; - qCritical() << QString::number(pExceptionInfo->ExceptionRecord->ExceptionCode, 16); - qCritical() << "Heap corruption!"; + if (exceptionCode == HEAP_CORRUPTION_CODE) { + qCritical() << "VectoredExceptionHandler: Heap corruption:" << QString::number(exceptionCode, 16); CrashpadClient client; if (gIPCPipe.length()) { - bool rc = client.SetHandlerIPCPipe(gIPCPipe); qCritical() << "SetHandlerIPCPipe = " << rc; } else {