https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b78cb36d910dd2e881844e...
commit b78cb36d910dd2e881844e96fd3e2c11cacd32cd Author: Vadim Galyant vgal@rambler.ru AuthorDate: Thu Apr 2 13:15:33 2020 +0300 Commit: GitHub noreply@github.com CommitDate: Thu Apr 2 12:15:33 2020 +0200
[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. --- ntoskrnl/mm/ARM3/section.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ntoskrnl/mm/ARM3/section.c b/ntoskrnl/mm/ARM3/section.c index abac73207cd..7d4e45c4af8 100644 --- a/ntoskrnl/mm/ARM3/section.c +++ b/ntoskrnl/mm/ARM3/section.c @@ -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);