diff --git a/ntoskrnl/mm/i386/page.c b/ntoskrnl/mm/i386/page.c index 4690a9a5d15..e1aac494dcb 100644 --- a/ntoskrnl/mm/i386/page.c +++ b/ntoskrnl/mm/i386/page.c @@ -186,17 +186,6 @@ ProtectToPTE(ULONG flProtect) return(Attributes); } -NTSTATUS -NTAPI -MiDispatchFault(IN ULONG FaultCode, - IN PVOID Address, - IN PMMPTE PointerPte, - IN PMMPTE PointerProtoPte, - IN BOOLEAN Recursive, - IN PEPROCESS Process, - IN PVOID TrapInformation, - IN PVOID Vad); - NTSTATUS NTAPI MiFillSystemPageDirectory(IN PVOID Base, @@ -244,32 +233,17 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create, PKIRQ } return Pt + MiAddressToPteOffset(Address); } + /* This is for our process */ PointerPde = MiAddressToPde(Address); Pt = (PULONG)MiAddressToPte(Address); - if (PointerPde->u.Hard.Valid == 0) - { - NTSTATUS Status; - if (Create == FALSE) - { - return NULL; - } - ASSERT(PointerPde->u.Long == 0); - MI_WRITE_INVALID_PTE(PointerPde, DemandZeroPde); - // Tiny HACK: Parameter 1 is the architecture specific FaultCode for an access violation (i.e. page is present) - Status = MiDispatchFault(0x1, - Pt, - PointerPde, - NULL, - FALSE, - PsGetCurrentProcess(), - NULL, - NULL); - DBG_UNREFERENCED_LOCAL_VARIABLE(Status); - ASSERT(KeAreAllApcsDisabled() == TRUE); - ASSERT(PointerPde->u.Hard.Valid == 1); + if ((PointerPde->u.Hard.Valid == 0) && (Create == FALSE)) + { + /* Do not fault PDE in if not needed */ + return NULL; } + return (PULONG)MiAddressToPte(Address); }