https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2eff510074aec9c843e19…
commit 2eff510074aec9c843e196364f0f9b4bd7ce3d61
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Wed Dec 27 15:09:39 2017 +0100
[NTOS:MM] Increment Prcb->MmDemandZeroCount while holding the Pfn lock
---
ntoskrnl/mm/ARM3/pagfault.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/ntoskrnl/mm/ARM3/pagfault.c b/ntoskrnl/mm/ARM3/pagfault.c
index b2dd08cdda..f37fa458d2 100644
--- a/ntoskrnl/mm/ARM3/pagfault.c
+++ b/ntoskrnl/mm/ARM3/pagfault.c
@@ -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)