Index: ntoskrnl/ex/sysinfo.c =================================================================== --- ntoskrnl/ex/sysinfo.c (revision 72722) +++ ntoskrnl/ex/sysinfo.c (working copy) @@ -812,6 +812,10 @@ { SpiCurrent = (PSYSTEM_PROCESS_INFORMATION) Current; + /* Lock the Process */ + KeEnterCriticalRegion(); + ExAcquirePushLockExclusive(&Process->ProcessLock); + if ((Process->ProcessExiting) && (Process->Pcb.Header.SignalState) && !(Process->ActiveThreads) && @@ -821,6 +825,10 @@ Process, Process->ImageFileName, Process->UniqueProcessId); CurrentSize = 0; ImageNameMaximumLength = 0; + + /* Unlock the Process */ + ExReleasePushLockExclusive(&Process->ProcessLock); + KeLeaveCriticalRegion(); goto Skip; } @@ -955,6 +963,10 @@ ProcessImageName = NULL; } + /* Unlock the Process */ + ExReleasePushLockExclusive(&Process->ProcessLock); + KeLeaveCriticalRegion(); + /* Handle idle process entry */ Skip: if (Process == PsIdleProcess) Process = NULL; Index: ntoskrnl/ps/kill.c =================================================================== --- ntoskrnl/ps/kill.c (revision 72722) +++ ntoskrnl/ps/kill.c (working copy) @@ -421,21 +421,21 @@ /* Make sure the thread was inserted, before continuing */ if (!Process) return; + /* Lock the thread's process */ + KeEnterCriticalRegion(); + ExAcquirePushLockExclusive(&Process->ProcessLock); + /* Check if the thread list is valid */ if (Thread->ThreadListEntry.Flink) { - /* Lock the thread's process */ - KeEnterCriticalRegion(); - ExAcquirePushLockExclusive(&Process->ProcessLock); - /* Remove us from the list */ RemoveEntryList(&Thread->ThreadListEntry); - - /* Release the lock */ - ExReleasePushLockExclusive(&Process->ProcessLock); - KeLeaveCriticalRegion(); } + /* Release the lock */ + ExReleasePushLockExclusive(&Process->ProcessLock); + KeLeaveCriticalRegion(); + /* Dereference the Process */ ObDereferenceObject(Process); }