From 12404ace170a56c3177363dd3cad877030baa2dc Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 2 Jul 2011 23:11:06 +0000 Subject: [PATCH] [NTOSKNRL] - Change an ASSERT to a KeBugCheck, since the assertion can fail for any invalid memory access and this is not an internal Mm failure. - Remove 2 cases, that "Should NEVER happen on ARM3!!!", but can very well happen. - Do NOT make the code cleaner, by releasing the PFN lock in the same function that acquires it, but keep it 2 functions down. This is because it *SHOULD* be that way, since some internal undocumented functions, that we do not implement but that are (theoretically) called from here, also do release the PFN lock. Thanks Alex for explaining this. svn path=/trunk/; revision=52507 --- reactos/ntoskrnl/mm/ARM3/pagfault.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/reactos/ntoskrnl/mm/ARM3/pagfault.c b/reactos/ntoskrnl/mm/ARM3/pagfault.c index f3f2b6c129f..646f77cb205 100644 --- a/reactos/ntoskrnl/mm/ARM3/pagfault.c +++ b/reactos/ntoskrnl/mm/ARM3/pagfault.c @@ -583,10 +583,19 @@ MiDispatchFault(IN BOOLEAN StoreInstruction, } // - // The PTE must be invalid, but not totally blank + // The PTE must be invalid // ASSERT(TempPte.u.Hard.Valid == 0); - ASSERT(TempPte.u.Long != 0); + + /* Check if the PTE is completely empty */ + if (TempPte.u.Long == 0) + { + KeBugCheckEx(PAGE_FAULT_IN_NONPAGED_AREA, + (ULONG_PTR)Address, + StoreInstruction, + (ULONG_PTR)TrapInformation, + 2); + } // // No prototype, transition or page file software PTEs in ARM3 yet @@ -727,11 +736,6 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction, // Writing to a read-only page (the stuff ARM3 works with is write, // so again, moot point). // - if (StoreInstruction) - { - DPRINT1("Should NEVER happen on ARM3!!!\n"); - return STATUS_ACCESS_VIOLATION; - } // // Otherwise, the PDE was probably invalid, and all is good now @@ -776,11 +780,6 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction, // Writing to a read-only page (the stuff ARM3 works with is write, // so again, moot point. // - if (StoreInstruction) - { - DPRINT1("Should NEVER happen on ARM3!!!\n"); - return STATUS_ACCESS_VIOLATION; - } /* Release the working set */ MiUnlockWorkingSet(CurrentThread, WorkingSet);