Commit 61b88ebd authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

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.
parent 8653ed03
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment