mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 08:00:24 +00:00
Trying to use r39938 variant again...
svn path=/trunk/; revision=40020
This commit is contained in:
parent
a49345f0c1
commit
0f6f0fe19a
1 changed files with 6 additions and 30 deletions
|
@ -139,7 +139,6 @@ MiMapPageToZeroInHyperSpace(IN PFN_NUMBER Page)
|
|||
{
|
||||
MMPTE TempPte;
|
||||
PMMPTE PointerPte;
|
||||
PFN_NUMBER Offset;
|
||||
PVOID Address;
|
||||
|
||||
//
|
||||
|
@ -154,47 +153,24 @@ MiMapPageToZeroInHyperSpace(IN PFN_NUMBER Page)
|
|||
TempPte.u.Hard.PageFrameNumber = Page;
|
||||
|
||||
//
|
||||
// Pick the first zeroing PTE
|
||||
// Get the Zero PTE and its address
|
||||
//
|
||||
PointerPte = MmFirstReservedZeroingPte;
|
||||
PointerPte = MiAddressToPte(MI_ZERO_PTE);
|
||||
Address = (PVOID)((ULONG_PTR)PointerPte << 10);
|
||||
|
||||
//
|
||||
// Now get the first free PTE
|
||||
// Invalidate the old address
|
||||
//
|
||||
Offset = PFN_FROM_PTE(PointerPte);
|
||||
if (!Offset)
|
||||
{
|
||||
//
|
||||
// Reset the PTEs
|
||||
//
|
||||
Offset = MI_ZEROING_PTES;
|
||||
KeFlushProcessTb();
|
||||
}
|
||||
|
||||
//
|
||||
// Prepare the next PTE
|
||||
//
|
||||
PointerPte->u.Hard.PageFrameNumber = Offset - 1;
|
||||
__invlpg(Address);
|
||||
|
||||
//
|
||||
// Write the current PTE
|
||||
//
|
||||
PointerPte += Offset;
|
||||
TempPte.u.Hard.PageFrameNumber = Page;
|
||||
*PointerPte = TempPte;
|
||||
|
||||
//
|
||||
// Return the address
|
||||
//
|
||||
Address = (PVOID)((ULONG_PTR)PointerPte << 10);
|
||||
return Address;
|
||||
}
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
MiUnmapPageInZeroSpace(IN PVOID Address)
|
||||
{
|
||||
//
|
||||
// Blow away the mapping
|
||||
//
|
||||
MiAddressToPte(Address)->u.Long = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue