mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 16:35:49 +00:00
- Use correct trapframe during set/get context. Thanks to blight for noticing the bug.
svn path=/trunk/; revision=18963
This commit is contained in:
parent
a5ad40f6c0
commit
de1acafe9a
1 changed files with 14 additions and 7 deletions
|
@ -44,23 +44,30 @@ PspGetOrSetContextKernelRoutine(PKAPC Apc,
|
||||||
PKEVENT Event;
|
PKEVENT Event;
|
||||||
PCONTEXT Context;
|
PCONTEXT Context;
|
||||||
KPROCESSOR_MODE Mode;
|
KPROCESSOR_MODE Mode;
|
||||||
|
PETHREAD Thread;
|
||||||
|
PKTRAP_FRAME TrapFrame;
|
||||||
|
|
||||||
/* Get the Context Structure */
|
/* Get the Context Structure */
|
||||||
GetSetContext = CONTAINING_RECORD(Apc, GET_SET_CTX_CONTEXT, Apc);
|
GetSetContext = CONTAINING_RECORD(Apc, GET_SET_CTX_CONTEXT, Apc);
|
||||||
Context = &GetSetContext->Context;
|
Context = &GetSetContext->Context;
|
||||||
Event = &GetSetContext->Event;
|
Event = &GetSetContext->Event;
|
||||||
Mode = GetSetContext->Mode;
|
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 */
|
/* Check if it's a set or get */
|
||||||
if (SystemArgument1) {
|
if (SystemArgument1)
|
||||||
|
{
|
||||||
/* Get the Context */
|
/* Get the Context */
|
||||||
KeTrapFrameToContext(KeGetCurrentThread()->TrapFrame, NULL, Context);
|
KeTrapFrameToContext(TrapFrame, NULL, Context);
|
||||||
|
}
|
||||||
} else {
|
else
|
||||||
|
{
|
||||||
/* Set the Context */
|
/* Set the Context */
|
||||||
KeContextToTrapFrame(Context, NULL, KeGetCurrentThread()->TrapFrame, Mode);
|
KeContextToTrapFrame(Context, NULL, TrapFrame, Mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Notify the Native API that we are done */
|
/* Notify the Native API that we are done */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue