[NTOS:MM] Using the macro MiIsPteOnPdeBoundary(). (#2496)

The SYSTEM_PD_SIZE constant should not be used to determine the page boundary for page tables. It is better to use the portable MiIsPteOnPdeBoundary() macro for this.
This commit is contained in:
Vadim Galyant 2020-04-02 13:15:33 +03:00 committed by GitHub
parent a5a725ae57
commit b78cb36d91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -647,7 +647,7 @@ MiSegmentDelete(IN PSEGMENT Segment)
while (PointerPte < LastPte)
{
/* Check if it's time to switch master PTEs if we passed a PDE boundary */
if (!((ULONG_PTR)PointerPte & (PD_SIZE - 1)) &&
if (MiIsPteOnPdeBoundary(PointerPte) &&
(PointerPte != Subsection->SubsectionBase))
{
/* Check if the master PTE is invalid */
@ -2150,7 +2150,7 @@ MiSetProtectionOnSection(IN PEPROCESS Process,
//
// Check if we've crossed a PDE boundary and make the new PDE valid too
//
if ((((ULONG_PTR)PointerPte) & (SYSTEM_PD_SIZE - 1)) == 0)
if (MiIsPteOnPdeBoundary(PointerPte))
{
PointerPde = MiPteToPde(PointerPte);
MiMakePdeExistAndMakeValid(PointerPde, Process, MM_NOIRQL);