[ros-diffs] [ion] 18963: - Use correct trapframe during set/get context. Thanks to blight for noticing the bug.

ion at svn.reactos.com ion at svn.reactos.com
Thu Nov 3 00:57:47 CET 2005


- Use correct trapframe during set/get context. Thanks to blight for
noticing the bug.
Modified: trunk/reactos/ntoskrnl/ps/debug.c
  _____  

Modified: trunk/reactos/ntoskrnl/ps/debug.c
--- trunk/reactos/ntoskrnl/ps/debug.c	2005-11-02 23:47:58 UTC (rev
18962)
+++ trunk/reactos/ntoskrnl/ps/debug.c	2005-11-02 23:57:38 UTC (rev
18963)
@@ -44,23 +44,30 @@

     PKEVENT Event;
     PCONTEXT Context;
     KPROCESSOR_MODE Mode;
+    PETHREAD Thread;
+    PKTRAP_FRAME TrapFrame;
 
     /* Get the Context Structure */
     GetSetContext = CONTAINING_RECORD(Apc, GET_SET_CTX_CONTEXT, Apc);
     Context = &GetSetContext->Context;
     Event = &GetSetContext->Event;
     Mode = GetSetContext->Mode;
+    Thread = SystemArgument2;
 
+    /* Get trap frame */
+    TrapFrame = (PKTRAP_FRAME)((ULONG_PTR)Thread->Tcb.InitialStack -
+                               sizeof(KTRAP_FRAME) -
sizeof(FX_SAVE_AREA));
+
     /* Check if it's a set or get */
-    if (SystemArgument1) {
-
+    if (SystemArgument1)
+    {
         /* Get the Context */
-        KeTrapFrameToContext(KeGetCurrentThread()->TrapFrame, NULL,
Context);
-
-    } else {
-
+        KeTrapFrameToContext(TrapFrame, NULL, Context);
+    }
+    else
+    {
         /* Set the Context */
-        KeContextToTrapFrame(Context, NULL,
KeGetCurrentThread()->TrapFrame, Mode);
+        KeContextToTrapFrame(Context, NULL, TrapFrame, Mode);
     }
 
     /* Notify the Native API that we are done */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20051103/c9982470/attachment.html


More information about the Ros-diffs mailing list