aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NorthstarDLL/crashhandler.cpp14
1 files changed, 14 insertions, 0 deletions
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));