From e984ea04a67dbb2f6b756606c480f27265e0bc12 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 16 Feb 2014 13:56:36 +0000 Subject: [PATCH] [NTOSKRNL] Improve MiRemoveMappedPtes to be able to unmap session mapped views. svn path=/trunk/; revision=62217 --- reactos/ntoskrnl/mm/ARM3/section.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/reactos/ntoskrnl/mm/ARM3/section.c b/reactos/ntoskrnl/mm/ARM3/section.c index d92a4adc5c0..d21be5f922d 100644 --- a/reactos/ntoskrnl/mm/ARM3/section.c +++ b/reactos/ntoskrnl/mm/ARM3/section.c @@ -2118,13 +2118,15 @@ MiRemoveMappedPtes(IN PVOID BaseAddress, IN PCONTROL_AREA ControlArea, IN PMMSUPPORT Ws) { - PMMPTE PointerPte;//, FirstPte; + PMMPTE PointerPte, ProtoPte;//, FirstPte; PMMPDE PointerPde, SystemMapPde; PMMPFN Pfn1, Pfn2; MMPTE PteContents; KIRQL OldIrql; DPRINT("Removing mapped view at: 0x%p\n", BaseAddress); + ASSERT(Ws == NULL); + /* Get the PTE and loop each one */ PointerPte = MiAddressToPte(BaseAddress); //FirstPte = PointerPte; @@ -2175,8 +2177,15 @@ MiRemoveMappedPtes(IN PVOID BaseAddress, /* Windows ASSERT */ ASSERT((PteContents.u.Long == 0) || (PteContents.u.Soft.Prototype == 1)); - /* But not handled in ARM3 */ - ASSERT(PteContents.u.Soft.Prototype == 0); + /* Check if this is a prototype pointer PTE */ + if (PteContents.u.Soft.Prototype == 1) + { + /* Get the prototype PTE */ + ProtoPte = MiProtoPteToPte(&PteContents); + + /* We don't support anything else atm */ + ASSERT(ProtoPte->u.Long == 0); + } } /* Make the PTE into a zero PTE */ -- 2.17.1