Fix KeUnstackDetachProcess.

svn path=/trunk/; revision=13634
This commit is contained in:
Gregor Anich 2005-02-18 18:28:49 +00:00
parent 299de40214
commit 41475e9941

View file

@ -231,19 +231,16 @@ KeUnstackDetachProcess (
/* Restore the Old APC State if a Process was present */
if (ApcState->Process) {
RtlMoveMemory(ApcState, &Thread->ApcState, sizeof(KAPC_STATE));
KiMoveApcState(ApcState, &Thread->ApcState);
} else {
/* 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->ApcStateIndex = OriginalApcEnvironment;
Thread->ApcStatePointer[OriginalApcEnvironment] = &Thread->ApcState;
Thread->ApcStatePointer[AttachedApcEnvironment] = &Thread->SavedApcState;
}
/* Restore the APC State */
KiMoveApcState(&Thread->SavedApcState, &Thread->ApcState);
/* Swap Processes */
KiSwapProcess(Thread->ApcState.Process, Thread->ApcState.Process);
@ -251,9 +248,10 @@ KeUnstackDetachProcess (
KeReleaseDispatcherDatabaseLock(OldIrql);
}
// This function should be used by win32k.sys to add its own user32/gdi32 services
// TableIndex is 0 based
// ServiceCountTable its not used at the moment
/* This function should be used by win32k.sys to add its own user32/gdi32 services
* TableIndex is 0 based
* ServiceCountTable its not used at the moment
*/
/*
* @implemented
*/