Module: wine
Branch: master
Commit: 61b88ebd500ffcf10a1993c13e5d9de33b094cd0
URL: https://gitlab.winehq.org/wine/wine/-/commit/61b88ebd500ffcf10a1993c13e5d9d…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Thu Nov 30 21:30:53 2023 +0200
kernelbase: Do not start the debugger if SEM_NOGPFAULTERRORBOX is set.
Motor City Online apparently checks for a debugger by setting this flag and then
intentionally causing a page fault. If no debugger is present on Windows, the
subprocess simply dies without spawning any crash dialog. This patch emulates
that behaviour, suppressing a (harmless) crash dialog from winedbg.
This may result in legitimate failures no longer triggering a winedbg crash
dialog, if other programs happen to use SEM_NOGPFAULTERRORBOX, but the winedbg
crash dialog cannot be relied upon anyway.
---
dlls/kernelbase/debug.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c
index b7df4a7c766..72cb2feef8d 100644
--- a/dlls/kernelbase/debug.c
+++ b/dlls/kernelbase/debug.c
@@ -761,9 +761,8 @@ LONG WINAPI UnhandledExceptionFilter( EXCEPTION_POINTERS *epointers )
if (ret != EXCEPTION_CONTINUE_SEARCH) return ret;
}
- /* FIXME: Should check the current error mode */
-
- if (!start_debugger_atomic( epointers ) || !NtCurrentTeb()->Peb->BeingDebugged)
+ if ((GetErrorMode() & SEM_NOGPFAULTERRORBOX) ||
+ !start_debugger_atomic( epointers ) || !NtCurrentTeb()->Peb->BeingDebugged)
return EXCEPTION_EXECUTE_HANDLER;
}
return EXCEPTION_CONTINUE_SEARCH;