From d3adc574608540bf089f88fb40b798b60edaadad Mon Sep 17 00:00:00 2001 From: Emma Miler Date: Tue, 1 Nov 2022 00:12:47 +0100 Subject: Update crashhandler.cpp (#297) --- NorthstarDLL/crashhandler.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'NorthstarDLL/crashhandler.cpp') diff --git a/NorthstarDLL/crashhandler.cpp b/NorthstarDLL/crashhandler.cpp index 8e083078..a631eb3a 100644 --- a/NorthstarDLL/crashhandler.cpp +++ b/NorthstarDLL/crashhandler.cpp @@ -122,6 +122,7 @@ long __stdcall ExceptionFilter(EXCEPTION_POINTERS* exceptionInfo) PVOID framesToCapture[62]; int frames = RtlCaptureStackBackTrace(0, 62, framesToCapture, NULL); + bool haveSkippedErrorHandlingFrames = false; for (int i = 0; i < frames; i++) { HMODULE backtraceModuleHandle; @@ -131,6 +132,19 @@ long __stdcall ExceptionFilter(EXCEPTION_POINTERS* exceptionInfo) GetModuleFileNameExA(GetCurrentProcess(), backtraceModuleHandle, backtraceModuleFullName, MAX_PATH); char* backtraceModuleName = strrchr(backtraceModuleFullName, '\\') + 1; + if (!haveSkippedErrorHandlingFrames) + { + if (!strncmp(backtraceModuleFullName, crashedModuleFullName, MAX_PATH) && + !strncmp(backtraceModuleName, crashedModuleName, MAX_PATH)) + { + haveSkippedErrorHandlingFrames = true; + } + else + { + continue; + } + } + void* actualAddress = (void*)framesToCapture[i]; void* relativeAddress = (void*)(uintptr_t(actualAddress) - uintptr_t(backtraceModuleHandle)); -- cgit v1.2.3