From 58983061e95bc12a55b340735a927606697df600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 27 Oct 2022 01:05:57 +0200 Subject: [PATCH] [NTOS:MM] Remove residual hack from commit 864a1bc6a (r55323). --- ntoskrnl/mm/ARM3/section.c | 27 +++++++-------------------- ntoskrnl/mm/section.c | 3 +-- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/ntoskrnl/mm/ARM3/section.c b/ntoskrnl/mm/ARM3/section.c index ad20d01e093..fed3fa0f685 100644 --- a/ntoskrnl/mm/ARM3/section.c +++ b/ntoskrnl/mm/ARM3/section.c @@ -135,24 +135,6 @@ MiIsProtectionCompatible(IN ULONG SectionPageProtection, return ((CompatibleMask | NewSectionPageProtection) == CompatibleMask); } -ACCESS_MASK -NTAPI -MiArm3GetCorrectFileAccessMask(IN ACCESS_MASK SectionPageProtection) -{ - ULONG ProtectionMask; - - /* Calculate the protection mask and make sure it's valid */ - ProtectionMask = MiMakeProtectionMask(SectionPageProtection); - if (ProtectionMask == MM_INVALID_PROTECTION) - { - DPRINT1("Invalid protection mask\n"); - return STATUS_INVALID_PAGE_PROTECTION; - } - - /* Now convert it to the required file access */ - return MmMakeFileAccess[ProtectionMask & 0x7]; -} - ULONG NTAPI MiMakeProtectionMask(IN ULONG Protect) @@ -2521,11 +2503,16 @@ MmCreateArm3Section(OUT PVOID *SectionObject, (SectionPageProtection & PAGE_NOACCESS))); /* Convert section flag to page flag */ - if (AllocationAttributes & SEC_NOCACHE) SectionPageProtection |= PAGE_NOCACHE; + if (AllocationAttributes & SEC_NOCACHE) + SectionPageProtection |= PAGE_NOCACHE; /* Check to make sure the protection is correct. Nt* does this already */ ProtectionMask = MiMakeProtectionMask(SectionPageProtection); - if (ProtectionMask == MM_INVALID_PROTECTION) return STATUS_INVALID_PAGE_PROTECTION; + if (ProtectionMask == MM_INVALID_PROTECTION) + { + DPRINT1("Invalid protection mask\n"); + return STATUS_INVALID_PAGE_PROTECTION; + } /* Check if this is going to be a data or image backed file section */ if ((FileHandle) || (FileObject)) diff --git a/ntoskrnl/mm/section.c b/ntoskrnl/mm/section.c index 1859d5ea6f1..21a9fc75560 100644 --- a/ntoskrnl/mm/section.c +++ b/ntoskrnl/mm/section.c @@ -220,8 +220,7 @@ static ULONG SectionCharacteristicsToProtect[16] = PAGE_EXECUTE_READWRITE, /* 15 = WRITABLE, READABLE, EXECUTABLE, SHARED */ }; -extern ULONG MmMakeFileAccess []; -ACCESS_MASK NTAPI MiArm3GetCorrectFileAccessMask(IN ACCESS_MASK SectionPageProtection); +extern ACCESS_MASK MmMakeFileAccess[8]; static GENERIC_MAPPING MmpSectionMapping = { STANDARD_RIGHTS_READ | SECTION_MAP_READ | SECTION_QUERY,