Alexandre Julliard : ntdll: Avoid putting the virtual heap in the low 2Gb on 64-bit.

Alexandre Julliard julliard at winehq.org
Fri Dec 17 11:30:45 CST 2010


Module: wine
Branch: master
Commit: 156ba4eddfd14333e205957f78ef39373656c30c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=156ba4eddfd14333e205957f78ef39373656c30c

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Dec 16 20:02:25 2010 +0100

ntdll: Avoid putting the virtual heap in the low 2Gb on 64-bit.

---

 dlls/ntdll/virtual.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 3ce0884..c22455d 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);




More information about the wine-cvs mailing list