Module: wine Branch: master Commit: 395df1aa2d50dc4622e64b552c85fca200798b0e URL: http://source.winehq.org/git/wine.git/?a=commit;h=395df1aa2d50dc4622e64b552c...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Mar 26 11:24:14 2014 +0100
ntdll: Heap handles should be 64K-aligned.
---
dlls/kernel32/tests/alloc.c | 1 + dlls/ntdll/heap.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/tests/alloc.c b/dlls/kernel32/tests/alloc.c index 05d262e..9de9528 100644 --- a/dlls/kernel32/tests/alloc.c +++ b/dlls/kernel32/tests/alloc.c @@ -69,6 +69,7 @@ static void test_Heap(void) */ memchunk=10*sysInfo.dwPageSize; heap=HeapCreate(0,2*memchunk,5*memchunk); + ok( !((ULONG_PTR)heap & 0xffff), "heap %p not 64K aligned\n", heap );
/* Check that HeapCreate allocated the right amount of ram */ mem1=HeapAlloc(heap,0,5*memchunk+1); diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index ac78889..3bb7a11 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -879,7 +879,7 @@ static SUBHEAP *HEAP_CreateSubHeap( HEAP *heap, LPVOID address, DWORD flags, commitSize = min( totalSize, (commitSize + COMMIT_MASK) & ~COMMIT_MASK );
/* allocate the memory block */ - if (NtAllocateVirtualMemory( NtCurrentProcess(), &address, 5, &totalSize, + if (NtAllocateVirtualMemory( NtCurrentProcess(), &address, 0, &totalSize, MEM_RESERVE, get_protection_type( flags ) )) { WARN("Could not allocate %08lx bytes\n", totalSize );