mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +00:00
[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:
parent
a47024fcd7
commit
b4fe8f646f
1 changed files with 7 additions and 0 deletions
|
@ -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];
|
||||
|
||||
|
|
Loading…
Reference in a new issue