mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +00:00
Fix returning the context of the current thread in NtGetContextThread
svn path=/trunk/; revision=24580
This commit is contained in:
parent
cf98132b2f
commit
de34ab04c1
1 changed files with 14 additions and 8 deletions
|
@ -174,8 +174,7 @@ PsGetContextThread(IN PETHREAD Thread,
|
|||
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,11 +255,19 @@ PsGetContextThread(IN PETHREAD Thread,
|
|||
FALSE,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/* Copy the context */
|
||||
RtlMoveMemory(ThreadContext, &GetSetContext.Context, Size);
|
||||
}
|
||||
|
||||
_SEH_TRY
|
||||
{
|
||||
/* Copy the context */
|
||||
RtlCopyMemory(ThreadContext, &GetSetContext.Context, Size);
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
Status = _SEH_GetExceptionCode();
|
||||
}
|
||||
_SEH_END;
|
||||
|
||||
/* Return status */
|
||||
return Status;
|
||||
}
|
||||
|
@ -285,8 +292,7 @@ PsSetContextThread(IN PETHREAD Thread,
|
|||
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 @@ PsSetContextThread(IN PETHREAD Thread,
|
|||
}
|
||||
|
||||
/* Copy the context */
|
||||
RtlMoveMemory(&GetSetContext.Context, ThreadContext, Size);
|
||||
RtlCopyMemory(&GetSetContext.Context, ThreadContext, Size);
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue