user32: Fix user_thread_info for 64-bits
authorMaarten Lankhorst <m.b.lankhorst@gmail.com>
Sat, 6 Dec 2008 15:36:48 +0000 (6 16:36 +0100)
committerMaarten Lankhorst <m.b.lankhorst@gmail.com>
Sat, 27 Dec 2008 20:18:37 +0000 (27 21:18 +0100)
dlls/user32/user_main.c
dlls/user32/user_private.h

index 1e29a8f..8421180 100644 (file)
@@ -21,6 +21,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
+#include <assert.h>
 #include "windef.h"
 #include "winbase.h"
 #include "wingdi.h"
@@ -343,6 +344,8 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
     {
     case DLL_PROCESS_ATTACH:
         user32_module = inst;
+        /* In win64 mode, the structure is always aligned to pointer size */
+        assert(sizeof(struct user_thread_info) - sizeof(void *) + sizeof(int) == sizeof(NtCurrentTeb()->Win32ClientInfo));
         ret = process_attach();
         break;
     case DLL_THREAD_DETACH:
index 191f7dd..2454086 100644 (file)
@@ -219,8 +219,11 @@ struct user_thread_info
     UINT                          active_hooks;           /* Bitmap of active hooks */
     HWND                          top_window;             /* Desktop window */
     HWND                          msg_window;             /* HWND_MESSAGE parent window */
-
-    ULONG                         pad[9];                 /* Available for more data */
+#ifndef _WIN64
+    ULONG                         pad[16];                /* Available for more data */
+#else
+    ULONG                         pad[7];                 /* Extra data here */
+#endif
 };
 
 struct hook_extra_info