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=245... ============================================================================== --- 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 {