diff --git a/reactos/ntoskrnl/mm/procsup.c b/reactos/ntoskrnl/mm/procsup.c index b550f508b36..7ed23748dc6 100644 --- a/reactos/ntoskrnl/mm/procsup.c +++ b/reactos/ntoskrnl/mm/procsup.c @@ -25,6 +25,8 @@ MmDeleteProcessAddressSpace(PEPROCESS Process) DPRINT("MmDeleteProcessAddressSpace(Process %x (%s))\n", Process, Process->ImageFileName); + RemoveEntryList(&Process->MmProcessLinks); + MmLockAddressSpace(&Process->Vm); while ((MemoryArea = (PMEMORY_AREA)Process->Vm.WorkingSetExpansionLinks.Flink) != NULL) diff --git a/reactos/ntoskrnl/ps/kill.c b/reactos/ntoskrnl/ps/kill.c index c1f9ce33cb6..b1ea95fb361 100644 --- a/reactos/ntoskrnl/ps/kill.c +++ b/reactos/ntoskrnl/ps/kill.c @@ -301,8 +301,6 @@ PspDeleteProcess(IN PVOID ObjectBody) /* Detach */ KeUnstackDetachProcess(&ApcState); - RemoveEntryList(&Process->MmProcessLinks); - /* Completely delete the Address Space */ MmDeleteProcessAddressSpace(Process); }