https://git.reactos.org/?p=reactos.git;a=commitdiff;h=58983061e95bc12a55b340735a927606697df600

commit 58983061e95bc12a55b340735a927606697df600
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Thu Oct 27 01:05:57 2022 +0200
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Thu Oct 27 01:08:07 2022 +0200

    [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,

Reply via email to