Author: tfaber Date: Wed Oct 22 12:29:31 2014 New Revision: 64885
URL: http://svn.reactos.org/svn/reactos?rev=64885&view=rev Log: [NTOS:MM] - Generate PAGE_FAULT_IN_NONPAGED_AREA bugcheck for PTEs that have their protection set to zero. This gives a more useful error description than the infamous 'TempPte.u.Long != 0' assertion*. CORE-8679 #resolve
* and is also What Windows Does(TM)
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] Wed Oct 22 12:29:31 2014 @@ -935,15 +935,15 @@ /* See if we should wait before terminating the fault */ if (Pfn1->u3.e1.ReadInProgress == 1) { - DPRINT1("The page is currently being read!\n"); - ASSERT(Pfn1->u1.Event != NULL); - *InPageBlock = Pfn1->u1.Event; - if (PointerPte == Pfn1->PteAddress) - { - DPRINT1("And this if for this particular PTE.\n"); - /* The PTE will be made valid by the thread serving the fault */ - return STATUS_SUCCESS; // FIXME: Maybe something more descriptive - } + DPRINT1("The page is currently being read!\n"); + ASSERT(Pfn1->u1.Event != NULL); + *InPageBlock = Pfn1->u1.Event; + if (PointerPte == Pfn1->PteAddress) + { + DPRINT1("And this if for this particular PTE.\n"); + /* The PTE will be made valid by the thread serving the fault */ + return STATUS_SUCCESS; // FIXME: Maybe something more descriptive + } }
/* Windows checks there's some free pages and this isn't an in-page error */ @@ -1424,8 +1424,8 @@
if (InPageBlock != NULL) { - /* The page is being paged in by another process */ - KeWaitForSingleObject(InPageBlock, WrPageIn, KernelMode, FALSE, NULL); + /* The page is being paged in by another process */ + KeWaitForSingleObject(InPageBlock, WrPageIn, KernelMode, FALSE, NULL); }
ASSERT(OldIrql == KeGetCurrentIrql()); @@ -1833,6 +1833,17 @@ (ULONG_PTR)TrapInformation, 1); } + + /* Check for no protecton at all */ + if (TempPte.u.Soft.Protection == MM_ZERO_ACCESS) + { + /* Bugcheck the system! */ + KeBugCheckEx(PAGE_FAULT_IN_NONPAGED_AREA, + (ULONG_PTR)Address, + StoreInstruction, + (ULONG_PTR)TrapInformation, + 0); + } }
/* Check for demand page */