From 41475e994190bbae7593b137bd6eeb51bac047dd Mon Sep 17 00:00:00 2001 From: Gregor Anich Date: Fri, 18 Feb 2005 18:28:49 +0000 Subject: [PATCH] Fix KeUnstackDetachProcess. svn path=/trunk/; revision=13634 --- reactos/ntoskrnl/ke/process.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/reactos/ntoskrnl/ke/process.c b/reactos/ntoskrnl/ke/process.c index 56d2bf00bc9..15486ecbd3a 100644 --- a/reactos/ntoskrnl/ke/process.c +++ b/reactos/ntoskrnl/ke/process.c @@ -216,7 +216,7 @@ KeUnstackDetachProcess ( { KIRQL OldIrql; PKTHREAD Thread; - + /* 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; @@ -231,29 +231,27 @@ 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); - + /* Return to old IRQL*/ 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 */