Author: sir_richard Date: Sun Oct 17 19:56:04 2010 New Revision: 49186
URL: http://svn.reactos.org/svn/reactos?rev=49186&view=rev Log: [NTOS]: Handle faults on non-demand-zero PTEs (and/or demand-zero PTEs that are not READWRITE (such as EXECUTE_READWRITE)).
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] Sun Oct 17 19:56:04 2010 @@ -929,11 +929,37 @@ return STATUS_PAGE_FAULT_DEMAND_ZERO; }
- /* Don't handle prototype PTEs yet -- only kernel demand zero PTEs */ + /* Get protection and check if it's a prototype PTE */ + ProtectionCode = TempPte.u.Soft.Protection; ASSERT(TempPte.u.Soft.Prototype == 0); + + /* Check for non-demand zero PTE */ + if (TempPte.u.Long != 0) + { + /* This is a page fault, check for valid protection */ + ASSERT(ProtectionCode != 0x100); + + /* FIXME: Run MiAccessCheck */ + + /* Dispatch the fault */ + Status = MiDispatchFault(StoreInstruction, + Address, + PointerPte, + NULL, + FALSE, + PsGetCurrentProcess(), + TrapInformation, + NULL); + + /* Return the status */ + ASSERT(NT_SUCCESS(Status)); + ASSERT(KeGetCurrentIrql() <= APC_LEVEL); + MiUnlockProcessWorkingSet(CurrentProcess, CurrentThread); + return Status; + } + + /* Check if this address range belongs to a valid allocation (VAD) */ ASSERT(TempPte.u.Long == 0); - - /* Check if this address range belongs to a valid allocation (VAD) */ ProtoPte = MiCheckVirtualAddress(Address, &ProtectionCode, &Vad); if (ProtectionCode == MM_NOACCESS) {