https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a007f5e4905ef276d4cc3b2fd42568064f0b537b

commit a007f5e4905ef276d4cc3b2fd42568064f0b537b
Author:     Timo Kreuzer <[email protected]>
AuthorDate: Sun Aug 21 17:18:15 2022 +0200
Commit:     Timo Kreuzer <[email protected]>
CommitDate: Thu Nov 24 21:17:58 2022 +0200

    [NTOS] Fix NtContinue for x64
---
 ntoskrnl/ke/except.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ntoskrnl/ke/except.c b/ntoskrnl/ke/except.c
index 3b945633ca5..79062df1e8a 100644
--- a/ntoskrnl/ke/except.c
+++ b/ntoskrnl/ke/except.c
@@ -28,12 +28,16 @@ KiContinuePreviousModeUser(IN PCONTEXT Context,
     RtlCopyMemory(&LocalContext, Context, sizeof(CONTEXT));
     Context = &LocalContext;
 
+#ifdef _M_AMD64
+    KiSetTrapContext(TrapFrame, &LocalContext, UserMode);
+#else
     /* Convert the context into Exception/Trap Frames */
     KeContextToTrapFrame(&LocalContext,
                          ExceptionFrame,
                          TrapFrame,
                          LocalContext.ContextFlags,
                          UserMode);
+#endif
 }
 
 NTSTATUS
@@ -62,12 +66,16 @@ KiContinue(IN PCONTEXT Context,
         }
         else
         {
+#ifdef _M_AMD64
+            KiSetTrapContext(TrapFrame, Context, KernelMode);
+#else
             /* Convert the context into Exception/Trap Frames */
             KeContextToTrapFrame(Context,
                                  ExceptionFrame,
                                  TrapFrame,
                                  Context->ContextFlags,
                                  KernelMode);
+#endif
         }
     }
     _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)

Reply via email to