From b091e6525323c4002d295abbef6e0b7453578383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Fri, 29 Aug 2014 09:21:35 +0000 Subject: [PATCH] [NTOS/MM] - Properly decrement pagetable frame entry share count when unmapping a system-mapped section - Handle the PTE dirty bit svn path=/trunk/; revision=63977 --- reactos/ntoskrnl/mm/ARM3/section.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/mm/ARM3/section.c b/reactos/ntoskrnl/mm/ARM3/section.c index f3063d0c389..f6fa60441d2 100644 --- a/reactos/ntoskrnl/mm/ARM3/section.c +++ b/reactos/ntoskrnl/mm/ARM3/section.c @@ -2204,7 +2204,9 @@ MiRemoveMappedPtes(IN PVOID BaseAddress, OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); ASSERT(((Pfn1->u3.e1.PrototypePte) && (Pfn1->OriginalPte.u.Soft.Prototype)) == 0); - /* FIXME: Dirty bit management */ + /* Mark the page as modified accordingly */ + if (PteContents.u.Hard.Dirty) + Pfn1->u3.e1.Modified = 1; /* Was the PDE invalid */ if (PointerPde->u.Long == 0) @@ -2223,7 +2225,7 @@ MiRemoveMappedPtes(IN PVOID BaseAddress, /* Dereference the PDE and the PTE */ Pfn2 = MiGetPfnEntry(PFN_FROM_PTE(PointerPde)); - //MiDecrementShareCount(Pfn2, PFN_FROM_PTE(PointerPde)); + MiDecrementShareCount(Pfn2, PFN_FROM_PTE(PointerPde)); DBG_UNREFERENCED_LOCAL_VARIABLE(Pfn2); MiDecrementShareCount(Pfn1, PFN_FROM_PTE(&PteContents));