From 51fd410d8938ab7c1425b28aa63ca45d412cbb22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Tue, 17 Feb 2015 14:19:05 +0000 Subject: [PATCH] [NTOSKRNL/MM] - MiIsEntireRangeCommitted: Ensure the PTE we are checking is really faulted in. - Prefer MiPteToPde and MiPdeToPte (which should really be called MiFirstPteInPde) instead of MiAddressToPte and MiPteToAddress Fixes weird failed ASSERT in page fault handler when using DPH. svn path=/trunk/; revision=66334 --- reactos/ntoskrnl/mm/ARM3/virtual.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/reactos/ntoskrnl/mm/ARM3/virtual.c b/reactos/ntoskrnl/mm/ARM3/virtual.c index f24ea2581cf..ee3ecc01c82 100644 --- a/reactos/ntoskrnl/mm/ARM3/virtual.c +++ b/reactos/ntoskrnl/mm/ARM3/virtual.c @@ -1994,14 +1994,13 @@ MiIsEntireRangeCommitted(IN ULONG_PTR StartingAddress, if (OnBoundary) { /* Is this PDE demand zero? */ - PointerPde = MiAddressToPte(PointerPte); + PointerPde = MiPteToPde(PointerPte); if (PointerPde->u.Long != 0) { /* It isn't -- is it valid? */ if (PointerPde->u.Hard.Valid == 0) { /* Nope, fault it in */ - PointerPte = MiPteToAddress(PointerPde); MiMakeSystemAddressValid(PointerPte, Process); } } @@ -2009,13 +2008,13 @@ MiIsEntireRangeCommitted(IN ULONG_PTR StartingAddress, { /* The PTE was already valid, so move to the next one */ PointerPde++; - PointerPte = MiPteToAddress(PointerPde); + PointerPte = MiPdeToPte(PointerPde); /* Is the entire VAD committed? If not, fail */ if (!Vad->u.VadFlags.MemCommit) return FALSE; - /* Everything is committed so far past the range, return true */ - if (PointerPte > LastPte) return TRUE; + /* New loop iteration with our new, on-boundary PTE. */ + continue; } }