https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1240ed9e187fbead7fa4c…
commit 1240ed9e187fbead7fa4cdd09f21430c35fb48b2
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Tue Nov 1 22:03:00 2011 +0100
[NTOS/MM] Add Protection parameter to MiResolveDemandZeroFault
---
ntoskrnl/mm/ARM3/pagfault.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/ntoskrnl/mm/ARM3/pagfault.c b/ntoskrnl/mm/ARM3/pagfault.c
index 1e70cc07b9..b2dd08cdda 100644
--- a/ntoskrnl/mm/ARM3/pagfault.c
+++ b/ntoskrnl/mm/ARM3/pagfault.c
@@ -564,10 +564,12 @@ MiCopyPfn(
MiReleaseSystemPtes(SysPtes, 2, SystemPteSpace);
}
+static
NTSTATUS
NTAPI
MiResolveDemandZeroFault(IN PVOID Address,
IN PMMPTE PointerPte,
+ IN ULONG Protection,
IN PEPROCESS Process,
IN KIRQL OldIrql)
{
@@ -689,7 +691,7 @@ MiResolveDemandZeroFault(IN PVOID Address,
/* User fault, build a user PTE */
MI_MAKE_HARDWARE_PTE_USER(&TempPte,
PointerPte,
- PointerPte->u.Soft.Protection,
+ Protection,
PageFrameNumber);
}
else
@@ -697,7 +699,7 @@ MiResolveDemandZeroFault(IN PVOID Address,
/* This is a user-mode PDE, create a kernel PTE for it */
MI_MAKE_HARDWARE_PTE(&TempPte,
PointerPte,
- PointerPte->u.Soft.Protection,
+ Protection,
PageFrameNumber);
}
@@ -1246,6 +1248,7 @@ MiResolveProtoPteFault(IN BOOLEAN StoreInstruction,
/* Resolve the demand zero fault */
Status = MiResolveDemandZeroFault(Address,
PointerProtoPte,
+ (ULONG)TempPte.u.Soft.Protection,
Process,
OldIrql);
ASSERT(NT_SUCCESS(Status));
@@ -1593,6 +1596,7 @@ MiDispatchFault(IN BOOLEAN StoreInstruction,
//
Status = MiResolveDemandZeroFault(Address,
PointerPte,
+ (ULONG)TempPte.u.Soft.Protection,
Process,
MM_NOIRQL);
ASSERT(KeAreAllApcsDisabled() == TRUE);
@@ -2032,6 +2036,7 @@ UserFault:
#if 0
/* Resolve a demand zero fault */
Status = MiResolveDemandZeroFault(PointerPpe,
+ PointerPxe,
MM_READWRITE,
CurrentProcess,
MM_NOIRQL);
@@ -2052,6 +2057,7 @@ UserFault:
#if 0
/* Resolve a demand zero fault */
Status = MiResolveDemandZeroFault(PointerPde,
+ PointerPpe,
MM_READWRITE,
CurrentProcess,
MM_NOIRQL);
@@ -2061,7 +2067,7 @@ UserFault:
}
#endif
- /* Check if the PDE is valid */
+ /* Check if the PDE is invalid */
if (PointerPde->u.Hard.Valid == 0)
{
/* Right now, we only handle scenarios where the PDE is totally empty */
@@ -2180,6 +2186,7 @@ UserFault:
/* Resolve the fault */
MiResolveDemandZeroFault(Address,
PointerPte,
+ MM_READWRITE,
CurrentProcess,
MM_NOIRQL);