Zebediah Figura : ntdll: Report SegDs to be identical to SegSs in x86_64 exception handlers.

Alexandre Julliard julliard at winehq.org
Mon Mar 29 16:00:05 CDT 2021


Module: wine
Branch: master
Commit: 195c57eeb7e62263af229baf5f486f353bf6459e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=195c57eeb7e62263af229baf5f486f353bf6459e

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Sun Mar 28 17:08:31 2021 -0500

ntdll: Report SegDs to be identical to SegSs in x86_64 exception handlers.

Based on a patch by Dávid Török.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47970
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/signal_x86_64.c   | 4 ++++
 dlls/ntdll/tests/exception.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
index b5be4f35758..d88f7ae553a 100644
--- a/dlls/ntdll/signal_x86_64.c
+++ b/dlls/ntdll/signal_x86_64.c
@@ -567,6 +567,10 @@ NTSTATUS WINAPI dispatch_exception( EXCEPTION_RECORD *rec, CONTEXT *context )
               context->R12, context->R13, context->R14, context->R15 );
     }
 
+    /* Legends of Runeterra depends on having SegDs == SegSs in an exception
+     * handler. */
+    context->SegDs = context->SegSs;
+
     if (call_vectored_handlers( rec, context ) == EXCEPTION_CONTINUE_EXECUTION)
         NtContinue( context, FALSE );
 
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
index 7c75606dd32..cdf3cdf8201 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -3020,7 +3020,7 @@ static DWORD WINAPI handler( EXCEPTION_RECORD *rec, ULONG64 frame,
         "%u: Unexpected exception address %p/%p\n", entry,
         rec->ExceptionAddress, (char*)context->Rip );
 
-    todo_wine ok( context->SegDs == context->SegSs,
+    ok( context->SegDs == context->SegSs,
         "%u: ds %#x does not match ss %#x\n", entry, context->SegDs, context->SegSs );
     todo_wine ok( context->SegEs == context->SegSs,
         "%u: es %#x does not match ss %#x\n", entry, context->SegEs, context->SegSs );




More information about the wine-cvs mailing list