Commit 04e2b02a authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ntdll: Support MEM_REPLACE_PLACEHOLDER in NtAllocateVirtualMemoryEx().

parent b7ea896f
......@@ -4068,7 +4068,7 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ
if (*ret)
{
if (type & MEM_RESERVE) /* Round down to 64k boundary */
if (type & MEM_RESERVE && !(type & MEM_REPLACE_PLACEHOLDER)) /* Round down to 64k boundary */
base = ROUND_ADDR( *ret, granularity_mask );
else
base = ROUND_ADDR( *ret, page_mask );
......@@ -4092,7 +4092,8 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ
/* Compute the alloc type flags */
if (!(type & (MEM_COMMIT | MEM_RESERVE | MEM_RESET)))
if (!(type & (MEM_COMMIT | MEM_RESERVE | MEM_RESET))
|| (type & MEM_REPLACE_PLACEHOLDER && !(type & MEM_RESERVE)))
{
WARN("called with wrong alloc type flags (%08x) !\n", (int)type);
return STATUS_INVALID_PARAMETER;
......@@ -4291,7 +4292,7 @@ NTSTATUS WINAPI NtAllocateVirtualMemoryEx( HANDLE process, PVOID *ret, SIZE_T *s
ULONG count )
{
static const ULONG type_mask = MEM_COMMIT | MEM_RESERVE | MEM_TOP_DOWN | MEM_WRITE_WATCH
| MEM_RESET | MEM_RESERVE_PLACEHOLDER;
| MEM_RESET | MEM_RESERVE_PLACEHOLDER | MEM_REPLACE_PLACEHOLDER;
ULONG_PTR limit = 0;
ULONG_PTR align = 0;
ULONG attributes = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment