From 156ba4eddfd14333e205957f78ef39373656c30c Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 16 Dec 2010 20:02:25 +0100 Subject: [PATCH] ntdll: Avoid putting the virtual heap in the low 2Gb on 64-bit. --- dlls/ntdll/virtual.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 3ce0884f79d..c22455de485 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -140,6 +140,7 @@ static void *user_space_limit; static void *working_set_limit; static void *address_space_start = (void *)0x10000; #endif /* __i386__ */ +static const int is_win64 = (sizeof(void *) > sizeof(int)); #define ROUND_ADDR(addr,mask) \ ((void *)((UINT_PTR)(addr) & ~(UINT_PTR)(mask))) @@ -1357,6 +1358,7 @@ static int alloc_virtual_heap( void *base, size_t size, void *arg ) if (is_beyond_limit( base, size, address_space_limit )) address_space_limit = (char *)base + size; if (size < VIRTUAL_HEAP_SIZE) return 0; + if (is_win64 && base < (void *)0x80000000) return 0; *heap_base = wine_anon_mmap( (char *)base + size - VIRTUAL_HEAP_SIZE, VIRTUAL_HEAP_SIZE, PROT_READ|PROT_WRITE, MAP_FIXED ); return (*heap_base != (void *)-1); -- 2.11.4.GIT