user32: Dont create 16 bits heap in 64-bits mode
authormlankhorst <mlankhorst@dhcp-172-29-61-127.smo.corp.google.com>
Tue, 25 Nov 2008 08:28:58 +0000 (25 09:28 +0100)
committerMaarten Lankhorst <m.b.lankhorst@gmail.com>
Sat, 27 Dec 2008 20:18:35 +0000 (27 21:18 +0100)
dlls/user32/user_main.c
dlls/user32/user_private.h

index 7b7b885..1e29a8f 100644 (file)
@@ -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();
 
index f1a6585..191f7dd 100644 (file)
@@ -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))