Move removing process from active list to PspDeleteProcess instead of PspExitProcess. This way we don't have to do it manually after ObInsertObject failure in PspCreateProces. Also, set the Process Query Time at the end of Process Creation, since the process doesn't really exist before then. Thanks to Hartmut for finding the bugs.

svn path=/trunk/; revision=14778
This commit is contained in:
Alex Ionescu 2005-04-23 16:17:27 +00:00
parent e60561fb17
commit 6c66ab6c64

View file

@ -148,6 +148,11 @@ PspDeleteProcess(PVOID ObjectBody)
DPRINT("PiDeleteProcess(ObjectBody %x)\n", ObjectBody);
/* Remove it from the Active List */
ExAcquireFastMutex(&PspActiveProcessMutex);
RemoveEntryList(&Process->ProcessListEntry);
ExReleaseFastMutex(&PspActiveProcessMutex);
/* Delete the CID Handle */
if(Process->UniqueProcessId != NULL) {
@ -411,12 +416,7 @@ PspExitProcess(PEPROCESS Process)
DPRINT("PspExitProcess 0x%x\n", Process);
PspRunCreateProcessNotifyRoutines(Process, FALSE);
/* Remove it from the Active List */
ExAcquireFastMutex(&PspActiveProcessMutex);
RemoveEntryList(&Process->ProcessListEntry);
ExReleaseFastMutex(&PspActiveProcessMutex);
/* close all handles associated with our process, this needs to be done
when the last thread still runs */
ObKillProcess(Process);