[NTOSKRNL]

* Make sure that BaseAddress is at 64-k boundary in NtMapViewOfSection(). Fixes a couple NtMapViewOfSection tests.
* Brought to you by Zhan Jianyu (aka larmbr) with review and improvement by Timo.
CORE-7118 #resolve #comment A slightly improved fix was committed in r58851. Thanks ;)

svn path=/trunk/; revision=58851
This commit is contained in:
Amine Khaldi 2013-04-25 15:54:45 +00:00
parent a47024fcd7
commit b4fe8f646f

View file

@ -3040,6 +3040,13 @@ NtMapViewOfSection(IN HANDLE SectionHandle,
return STATUS_INVALID_PAGE_PROTECTION;
}
/* Check for non-allocation-granularity-aligned BaseAddress */
if (BaseAddress && (*BaseAddress != ALIGN_DOWN_POINTER_BY(*BaseAddress, MM_VIRTMEM_GRANULARITY)))
{
DPRINT("BaseAddress is not at 64-kilobyte address boundary.");
return STATUS_MAPPED_ALIGNMENT;
}
/* Now convert the protection mask into desired section access mask */
DesiredAccess = MmMakeSectionAccess[ProtectionMask & 0x7];