aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmma Miler <emma.pi@protonmail.com>2022-11-01 00:12:47 +0100
committerGitHub <noreply@github.com>2022-10-31 23:12:47 +0000
commitd3adc574608540bf089f88fb40b798b60edaadad (patch)
tree48894cd0f6310a13de6ce8cdf6919ce3e257033c
parented383c982f20702dd7a75bc11186974e2a64b11a (diff)
downloadNorthstarLauncher-d3adc574608540bf089f88fb40b798b60edaadad.tar.gz
NorthstarLauncher-d3adc574608540bf089f88fb40b798b60edaadad.zip
Update crashhandler.cpp (#297)
-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));