[NTOS:MM] Increment Prcb->MmDemandZeroCount while holding the Pfn lock

This commit is contained in:
Timo Kreuzer 2017-12-27 15:09:39 +01:00
parent 1240ed9e18
commit 2eff510074

View file

@ -669,6 +669,9 @@ MiResolveDemandZeroFault(IN PVOID Address,
/* Initialize it */
MiInitializePfn(PageFrameNumber, PointerPte, TRUE);
/* Increment demand zero faults */
KeGetCurrentPrcb()->MmDemandZeroCount++;
/* Do we have the lock? */
if (HaveLock)
{
@ -679,9 +682,6 @@ MiResolveDemandZeroFault(IN PVOID Address,
if (Process > HYDRA_PROCESS) Process->NumberOfPrivatePages++;
}
/* Increment demand zero faults */
InterlockedIncrement(&KeGetCurrentPrcb()->MmDemandZeroCount);
/* Zero the page if need be */
if (NeedZero) MiZeroPfn(PageFrameNumber);
@ -2297,14 +2297,14 @@ UserFault:
/* Initialize the PFN entry now */
MiInitializePfn(PageFrameIndex, PointerPte, 1);
/* And we're done with the lock */
MiReleasePfnLock(OldIrql);
/* Increment the count of pages in the process */
CurrentProcess->NumberOfPrivatePages++;
/* One more demand-zero fault */
InterlockedIncrement(&KeGetCurrentPrcb()->MmDemandZeroCount);
KeGetCurrentPrcb()->MmDemandZeroCount++;
/* And we're done with the lock */
MiReleasePfnLock(OldIrql);
/* Fault on user PDE, or fault on user PTE? */
if (PointerPte <= MiHighestUserPte)