[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: [PATCH] ntdll: Only call wine exception handlers on the current stack.
From: Rémi Bernon <rbernon () codeweavers ! com>
Date: 2022-01-31 15:24:16
Message-ID: 20220131152416.548682-1-rbernon () codeweavers ! com
[Download RAW message or body]
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 );
--
2.34.1
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic