MK11 creates an alternate stack and sometimes throws an exception which gets incorrectly handled by a Wine exception handler, causing the game to crash.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntdll/signal_x86_64.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 7e77329363c..36985832e4a 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -463,7 +463,9 @@ static NTSTATUS call_stack_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_contex } } /* hack: call wine handlers registered in the tib list */ - else while ((ULONG64)teb_frame < context.Rsp) + else while ((ULONG64)teb_frame < context.Rsp && + (ULONG64)teb_frame >= (ULONG64)NtCurrentTeb()->Tib.StackLimit && + (ULONG64)teb_frame <= (ULONG64)NtCurrentTeb()->Tib.StackBase) { TRACE_(seh)( "found wine frame %p rsp %p handler %p\n", teb_frame, (void *)context.Rsp, teb_frame->Handler );