[PATCH v4 0/1] MR5437: kernelbase: Do not start the debugger if SEM_NOGPFAULTERRORBOX is set.
-- v4: kernelbase: Do not start the debugger if SEM_NOGPFAULTERRORBOX is set. https://gitlab.winehq.org/wine/wine/-/merge_requests/5437
From: Zebediah Figura <zfigura(a)codeweavers.com> 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; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5437
v3: Return EXCEPTION_EXECUTE_HANDLER in this case, not EXCEPTION_CONTINUE_SEARCH. We want to terminate the process quietly in this case, rather than raising a last-chance exception. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5437#note_68804
participants (3)
-
Elizabeth Figura (@zfigura) -
Zebediah Figura -
Zebediah Figura (@zfigura)