[ros-diffs] [weiden] 24580: Fix returning the context of the current thread in NtGetContextThread

weiden at svn.reactos.org weiden at svn.reactos.org
Fri Oct 20 15:45:53 CEST 2006


Author: weiden
Date: Fri Oct 20 17:45:52 2006
New Revision: 24580

URL: http://svn.reactos.org/svn/reactos?rev=24580&view=rev
Log:
Fix returning the context of the current thread in NtGetContextThread

Modified:
    trunk/reactos/ntoskrnl/ps/debug.c

Modified: trunk/reactos/ntoskrnl/ps/debug.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/debug.c?rev=24580&r1=24579&r2=24580&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ps/debug.c (original)
+++ trunk/reactos/ntoskrnl/ps/debug.c Fri Oct 20 17:45:52 2006
@@ -174,8 +174,7 @@
         Size = sizeof(CONTEXT);
 
         /* Read the flags */
-        ProbeForReadUlong(&ThreadContext->ContextFlags);
-        Flags = ThreadContext->ContextFlags;
+        Flags = ProbeForReadUlong(&ThreadContext->ContextFlags);
 
         /* Check if the caller wanted extended registers */
         if ((Flags & CONTEXT_EXTENDED_REGISTERS) !=
@@ -256,10 +255,18 @@
                                            FALSE,
                                            NULL);
         }
-
+    }
+
+    _SEH_TRY
+    {
         /* Copy the context */
-        RtlMoveMemory(ThreadContext, &GetSetContext.Context, Size);
-    }
+        RtlCopyMemory(ThreadContext, &GetSetContext.Context, Size);
+    }
+    _SEH_HANDLE
+    {
+        Status = _SEH_GetExceptionCode();
+    }
+    _SEH_END;
 
     /* Return status */
     return Status;
@@ -285,8 +292,7 @@
         Size = sizeof(CONTEXT);
 
         /* Read the flags */
-        ProbeForReadUlong(&ThreadContext->ContextFlags);
-        Flags = ThreadContext->ContextFlags;
+        Flags = ProbeForReadUlong(&ThreadContext->ContextFlags);
 
         /* Check if the caller wanted extended registers */
         if ((Flags & CONTEXT_EXTENDED_REGISTERS) !=
@@ -304,7 +310,7 @@
         }
 
         /* Copy the context */
-        RtlMoveMemory(&GetSetContext.Context, ThreadContext, Size);
+        RtlCopyMemory(&GetSetContext.Context, ThreadContext, Size);
     }
     _SEH_HANDLE
     {




More information about the Ros-diffs mailing list