From 679379094a4215bab9679bae665f638a8e461d2a Mon Sep 17 00:00:00 2001 From: mlankhorst Date: Tue, 25 Nov 2008 09:28:58 +0100 Subject: [PATCH] user32: Dont create 16 bits heap in 64-bits mode --- dlls/user32/user_main.c | 4 ++++ dlls/user32/user_private.h | 11 +++++++++++ 2 files changed, 15 insertions(+), 0 deletions(-) diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 7b7b885..1e29a8f 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -267,6 +267,7 @@ static void winstation_init(void) */ static BOOL process_attach(void) { +#ifdef _WIN32 HINSTANCE16 instance; /* Create USER heap */ @@ -279,6 +280,9 @@ static BOOL process_attach(void) /* some Win9x dlls expect keyboard to be loaded */ if (GetVersion() & 0x80000000) LoadLibrary16( "keyboard.drv" ); +#else + /* Ignore heap, not needed for win64*/ +#endif winstation_init(); diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index 744a141..3f64b00 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -69,6 +69,16 @@ static inline HLOCAL16 LOCAL_Free( HANDLE16 ds, HLOCAL16 handle ) return ret; } +#ifdef _WIN64 +#define USER_HEAP_ALLOC(size) \ + GlobalAlloc(GMEM_MOVEABLE, (size)) +#define USER_HEAP_REALLOC(handle,size) \ + GlobalReAlloc((handle), (size), GMEM_MOVEABLE) +#define USER_HEAP_FREE(handle) \ + GlobalFree(handle) +#define USER_HEAP_LIN_ADDR(handle) \ + GlobalLock(handle) +#else /* WIN64 */ #define USER_HEAP_ALLOC(size) \ ((HANDLE)(ULONG_PTR)LOCAL_Alloc( USER_HeapSel, LMEM_FIXED, (size) )) #define USER_HEAP_REALLOC(handle,size) \ @@ -77,6 +87,7 @@ static inline HLOCAL16 LOCAL_Free( HANDLE16 ds, HLOCAL16 handle ) LOCAL_Free( USER_HeapSel, LOWORD(handle) ) #define USER_HEAP_LIN_ADDR(handle) \ ((handle) ? MapSL(MAKESEGPTR(USER_HeapSel, LOWORD(handle))) : NULL) +#endif /* WIN64 */ #define GET_WORD(ptr) (*(const WORD *)(ptr)) #define GET_DWORD(ptr) (*(const DWORD *)(ptr)) -- 1.5.6.5