mirror of
https://github.com/reactos/reactos.git
synced 2025-06-04 00:40:31 +00:00
Fix KeUnstackDetachProcess.
svn path=/trunk/; revision=13634
This commit is contained in:
parent
299de40214
commit
41475e9941
1 changed files with 8 additions and 10 deletions
|
@ -216,7 +216,7 @@ KeUnstackDetachProcess (
|
||||||
{
|
{
|
||||||
KIRQL OldIrql;
|
KIRQL OldIrql;
|
||||||
PKTHREAD Thread;
|
PKTHREAD Thread;
|
||||||
|
|
||||||
/* If the special "We tried to attach to the process already being attached to" flag is there, don't do anything */
|
/* If the special "We tried to attach to the process already being attached to" flag is there, don't do anything */
|
||||||
if (ApcState->Process == (PKPROCESS)1) return;
|
if (ApcState->Process == (PKPROCESS)1) return;
|
||||||
|
|
||||||
|
@ -231,29 +231,27 @@ KeUnstackDetachProcess (
|
||||||
|
|
||||||
/* Restore the Old APC State if a Process was present */
|
/* Restore the Old APC State if a Process was present */
|
||||||
if (ApcState->Process) {
|
if (ApcState->Process) {
|
||||||
RtlMoveMemory(ApcState, &Thread->ApcState, sizeof(KAPC_STATE));
|
KiMoveApcState(ApcState, &Thread->ApcState);
|
||||||
} else {
|
} else {
|
||||||
/* The ApcState parameter is useless, so use the saved data and reset it */
|
/* The ApcState parameter is useless, so use the saved data and reset it */
|
||||||
RtlMoveMemory(&Thread->SavedApcState, &Thread->ApcState, sizeof(KAPC_STATE));
|
KiMoveApcState(&Thread->SavedApcState, &Thread->ApcState);
|
||||||
Thread->SavedApcState.Process = NULL;
|
Thread->SavedApcState.Process = NULL;
|
||||||
Thread->ApcStateIndex = OriginalApcEnvironment;
|
Thread->ApcStateIndex = OriginalApcEnvironment;
|
||||||
Thread->ApcStatePointer[OriginalApcEnvironment] = &Thread->ApcState;
|
Thread->ApcStatePointer[OriginalApcEnvironment] = &Thread->ApcState;
|
||||||
Thread->ApcStatePointer[AttachedApcEnvironment] = &Thread->SavedApcState;
|
Thread->ApcStatePointer[AttachedApcEnvironment] = &Thread->SavedApcState;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Restore the APC State */
|
|
||||||
KiMoveApcState(&Thread->SavedApcState, &Thread->ApcState);
|
|
||||||
|
|
||||||
/* Swap Processes */
|
/* Swap Processes */
|
||||||
KiSwapProcess(Thread->ApcState.Process, Thread->ApcState.Process);
|
KiSwapProcess(Thread->ApcState.Process, Thread->ApcState.Process);
|
||||||
|
|
||||||
/* Return to old IRQL*/
|
/* Return to old IRQL*/
|
||||||
KeReleaseDispatcherDatabaseLock(OldIrql);
|
KeReleaseDispatcherDatabaseLock(OldIrql);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function should be used by win32k.sys to add its own user32/gdi32 services
|
/* This function should be used by win32k.sys to add its own user32/gdi32 services
|
||||||
// TableIndex is 0 based
|
* TableIndex is 0 based
|
||||||
// ServiceCountTable its not used at the moment
|
* ServiceCountTable its not used at the moment
|
||||||
|
*/
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue