Revert "[NTOS:MM] Do proper checks & acquire proper locks when sweeping user pages"

This reverts commit 7c006df7e0.
Note to self: This is what happens when you have too many branch and push the wrong one.
This commit is contained in:
Jérôme Gardou 2021-08-04 23:57:39 +02:00
parent 7c006df7e0
commit 676dc4b441

View file

@ -213,14 +213,10 @@ MmTrimUserMemory(ULONG Target, ULONG Priority, PULONG NrFreedPages)
MmLockAddressSpace(&Process->Vm);
if (!Process->VmDeleted)
{
MiLockProcessWorkingSetUnsafe(Process, PsGetCurrentThread());
/* Be sure this is still valid. */
if (MmIsAddressValid(Address))
{
PMMPTE Pte = MiAddressToPte(Address);
if (Pte->u.Hard.Valid)
{
Accessed = Accessed || Pte->u.Hard.Accessed;
Pte->u.Hard.Accessed = 0;
@ -228,9 +224,6 @@ MmTrimUserMemory(ULONG Target, ULONG Priority, PULONG NrFreedPages)
//KeInvalidateTlbEntry(Address);
}
MiUnlockProcessWorkingSet(Process, PsGetCurrentThread());
}
MmUnlockAddressSpace(&Process->Vm);
KeUnstackDetachProcess(&ApcState);