From: Paul Gofman <pgofman@codeweavers.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56286 --- dlls/kernel32/tests/heap.c | 2 -- dlls/ntdll/heap.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/kernel32/tests/heap.c b/dlls/kernel32/tests/heap.c index 4795c60e9ea..6fe26b1837a 100644 --- a/dlls/kernel32/tests/heap.c +++ b/dlls/kernel32/tests/heap.c @@ -3735,8 +3735,6 @@ static void test_heap_size( SIZE_T initial_commit_size ) commit_size = ROUND_SIZE( initial_commit_size, INITIAL_COMMIT_ALIGN - 1 ); expected = ROUND_SIZE( commit_size + 1, REGION_ALIGN - 1 ); - todo_wine_if( expected != initial_commit_size + REGION_ALIGN - && !(initial_commit_size > REGION_ALIGN - INITIAL_COMMIT_ALIGN && initial_commit_size < REGION_ALIGN)) ok( alloc_size == expected, "got %#Ix, expected %#Ix.\n", alloc_size, expected ); expected = max( commit_size, INITIAL_COMMIT_ALIGN ); todo_wine_if( (!initial_commit_size || (initial_commit_size & (REGION_ALIGN - 1))) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 7bf68d52245..b40b2d2ace8 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -1513,7 +1513,7 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, void *addr, SIZE_T total_size, SIZE_T if (process_heap) flags |= HEAP_PRIVATE; if (!process_heap || !total_size || (flags & HEAP_SHARED)) flags |= HEAP_GROWABLE; commit_size = ROUND_SIZE( commit_size, INITIAL_COMMIT_ALIGN - 1 ); - if (!total_size) total_size = commit_size + HEAP_INITIAL_SIZE; + if (!total_size) total_size = ROUND_SIZE( commit_size + 1 /* + 1 is intentional */, REGION_ALIGN - 1 ); if (!(heap = addr)) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9752