mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 20:36:26 +00:00
[NTOS]: Fix multiple math/logic bugs in the PrototypePTE paths. Caught while trying to switch the Win32k GDI Handle Table to ARM3 sections.
svn path=/trunk/; revision=49209
This commit is contained in:
parent
ef6bc56d6f
commit
6f48b81057
2 changed files with 20 additions and 20 deletions
|
@ -241,7 +241,7 @@ extern const ULONG MmProtectToValue[32];
|
|||
//
|
||||
#define MiProtoPteToPte(x) \
|
||||
(PMMPTE)((ULONG_PTR)MmPagedPoolStart + \
|
||||
((x)->u.Proto.ProtoAddressHigh | (x)->u.Proto.ProtoAddressLow))
|
||||
(((x)->u.Proto.ProtoAddressHigh << 7) | (x)->u.Proto.ProtoAddressLow))
|
||||
#endif
|
||||
|
||||
//
|
||||
|
@ -627,7 +627,8 @@ MI_MAKE_PROTOTYPE_PTE(IN PMMPTE NewPte,
|
|||
|
||||
/* 7 bits go in the "low", and the other 21 bits go in the "high" */
|
||||
NewPte->u.Proto.ProtoAddressLow = Offset & 0x7F;
|
||||
NewPte->u.Proto.ProtoAddressHigh = Offset & 0xFFFFF80;
|
||||
NewPte->u.Proto.ProtoAddressHigh = (Offset & 0xFFFFFF80) >> 7;
|
||||
ASSERT(MiProtoPteToPte(NewPte) == PointerPte);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -805,7 +805,8 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction,
|
|||
/* Get the prototype PTE! */
|
||||
ProtoPte = MiProtoPteToPte(&TempPte);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//
|
||||
// We don't implement transition PTEs
|
||||
//
|
||||
|
@ -821,6 +822,7 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction,
|
|||
(ULONG_PTR)TrapInformation,
|
||||
1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for demand page */
|
||||
if ((StoreInstruction) && !(ProtoPte) && !(TempPte.u.Hard.Valid))
|
||||
|
@ -874,8 +876,6 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction,
|
|||
#endif
|
||||
|
||||
/* First things first, is the PDE valid? */
|
||||
// DPRINT1("The PDE we faulted on: %lx %lx\n", PointerPde, MiAddressToPde(PTE_BASE));
|
||||
//ASSERT(PointerPde != MiAddressToPde(PTE_BASE));
|
||||
ASSERT(PointerPde->u.Hard.LargePage == 0);
|
||||
if (PointerPde->u.Hard.Valid == 0)
|
||||
{
|
||||
|
@ -918,7 +918,6 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction,
|
|||
if (TempPte.u.Long == (MM_READWRITE << MM_PTE_SOFTWARE_PROTECTION_BITS))
|
||||
{
|
||||
/* Resolve the fault */
|
||||
//DPRINT1("VAD demand-zero fault: %p\n", Address);
|
||||
MiResolveDemandZeroFault(Address,
|
||||
PointerPte,
|
||||
CurrentProcess,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue