[NTOS:MM] Remove residual hack from commit 864a1bc6a (r55323).

This commit is contained in:
Hermès Bélusca-Maïto 2022-10-27 01:05:57 +02:00
parent a0b1a01c59
commit 58983061e9
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 8 additions and 22 deletions

View file

@ -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))

View file

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