From dcac67464f3836f2f8ea5c02c58537b0de7af9e9 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 | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 7b7b8850af2..1e29a8fb842 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 f1a65852eca..191f7ddd632 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -69,6 +69,15 @@ static inline HLOCAL16 LOCAL_Free( HANDLE16 ds, HLOCAL16 handle ) return ret; } +#ifdef _WIN64 +#define USER_HEAP_ALLOC(size) \ + GlobalAlloc(GMEM_FIXED, (size)) +#define USER_HEAP_REALLOC(handle,size) \ + GlobalReAlloc((handle), (size), GMEM_FIXED) +#define USER_HEAP_FREE(handle) \ + GlobalFree(handle) +#define USER_HEAP_LIN_ADDR(handle) ((void *)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 +86,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)) -- 2.11.4.GIT