This finally solves a FIXME that was added back in 1997.
NFS High Stakes (and Motor City Online) both emit a 0x190 access violation on startup (according to game's strings this was meant to be debugger detection; I think this was done to interfere in a DRM bypass but I'm probably wrong).
But anyway that feature causes a Wine Debugger dialog to appear when starting the games (if you click "Show Details" though they suddenly start working normally but this is an extra annoyance for average people who just want to play the game).
This change prevents that by not starting the debugger if the SEM_NOGPFAULTERRORBOX flag is set (if that flag wasn't set then people would be complaining about the game crashing every time) which lets the exception silently go through (it can still be seen with WINEDEBUG=+seh set though).
I'm not sure how I can test for this exception handling behavior (I'm thinking of calling RaiseException() inside a __try/__except block but that might not be exactly what the games are doing).
This patch was originally posted by Zeb in a diff form (so the patch description has been written by me, DodoGTA).
From: Zebediah Figura zfigura@codeweavers.com
This finally solves a FIXME that was added back in 1997.
NFS High Stakes (and Motor City Online) both emit a 0x190 access violation on startup (according to game's strings this was meant to be debugger detection; I think this was done to interfere in a DRM bypass but I'm probably wrong).
But anyway that feature causes a Wine Debugger dialog to appear when starting the games (if you click "Show Details" though they suddenly start working normally but this is an extra annoyance for average people who just want to play the game).
This change prevents that by not starting the debugger if the SEM_NOGPFAULTERRORBOX flag is set (if that flag wasn't set then people would be complaining about the game crashing every time) which lets the exception silently go through (it can still be seen with WINEDEBUG=+seh set though).
I'm not sure how I can test for this exception handling behavior (I'm thinking of calling RaiseException() inside a __try/__except block but that might not be exactly what the games are doing).
This patch was originally posted by Zeb in a diff form (so the patch description has been written by me, DodoGTA). --- dlls/kernelbase/debug.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c index e571378e2df..4be702bcb65 100644 --- a/dlls/kernelbase/debug.c +++ b/dlls/kernelbase/debug.c @@ -733,10 +733,11 @@ 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) - return EXCEPTION_EXECUTE_HANDLER; + if (!(GetErrorMode() & SEM_NOGPFAULTERRORBOX)) + { + if (!start_debugger_atomic( epointers ) || !NtCurrentTeb()->Peb->BeingDebugged) + return EXCEPTION_EXECUTE_HANDLER; + } } return EXCEPTION_CONTINUE_SEARCH; }
This merge request was approved by Aida Jonikienė.
Sorry for not getting around to this one. I've rewritten the description to be more appropriate for git history and submitted it as 5437.
This merge request was closed by Aida Jonikienė.
This MR got replaced by !5437 (so I'll close this one)