summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorEran Mizrahi <erasmux@gmail.com>2017-12-09 21:38:47 +0200
committerEran Mizrahi <erasmux@gmail.com>2017-12-10 02:53:19 +0200
commitb75e3c12318267be1589cee5e13a9fc89b0097b1 (patch)
treec5344b27584c95689a325442b1bfa830bff2b563 /src/main.cpp
parent1b4b6dbeb46aa7e6b87b3de32cd8953fa0d32a7a (diff)
Collect crash dumps also for vectored exceptions
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 71fbc943..40224170 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -128,6 +128,12 @@ bool isNxmLink(const QString &link)
static LONG WINAPI MyUnhandledExceptionFilter(struct _EXCEPTION_POINTERS *exceptionPtrs)
{
+ if ((exceptionPtrs->ExceptionRecord->ExceptionCode < 0x80000000) // non-critical
+ || (exceptionPtrs->ExceptionRecord->ExceptionCode == 0xe06d7363)) { // cpp exception
+ // don't report non-critical exceptions
+ return EXCEPTION_CONTINUE_SEARCH;
+ }
+
const std::wstring& dumpPath = OrganizerCore::crashDumpsPath();
int dumpRes =
CreateMiniDump(exceptionPtrs, OrganizerCore::getGlobalCrashDumpsType(), dumpPath.c_str());
@@ -522,7 +528,7 @@ int runApplication(MOApplication &application, SingleInstance &instance,
int main(int argc, char *argv[])
{
- SetUnhandledExceptionFilter(MyUnhandledExceptionFilter);
+ AddVectoredExceptionHandler(0, MyUnhandledExceptionFilter);
MOApplication application(argc, argv);
QStringList arguments = application.arguments();