Common Controls: GWL_ -> GWLP_

Robert Shearman rob at codeweavers.com
Tue Aug 24 22:12:50 CDT 2004


Hi,

This is required for 64-bit compatibility with Windows headers. Some of 
the GWL_* constants are deliberately not defined because they are used 
to store pointers in and it forces a re-check of the places where they 
are used. This patch changes the appropriate constants for comctl32.dll.

To All: Please shout if this patch conflicts with not-yet-sent patches 
and I will either delay this patch or drop the appropriate part.

Rob

Changelog:
Common Controls: GWL_ -> GWLP_.

-------------- next part --------------
Index: wine/dlls/comctl32/animate.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/animate.c,v
retrieving revision 1.54
diff -u -p -r1.54 animate.c
--- wine/dlls/comctl32/animate.c	11 Mar 2004 00:41:07 -0000	1.54
+++ wine/dlls/comctl32/animate.c	25 Aug 2004 03:02:49 -0000
@@ -85,7 +85,7 @@ typedef struct
    HBITMAP  	    	hbmPrevFrame;
 } ANIMATE_INFO;
 
-#define ANIMATE_GetInfoPtr(hWnd) ((ANIMATE_INFO *)GetWindowLongA(hWnd, 0))
+#define ANIMATE_GetInfoPtr(hWnd) ((ANIMATE_INFO *)GetWindowLongPtrW(hWnd, 0))
 #define ANIMATE_COLOR_NONE  	0xffffffff
 
 static void ANIMATE_Notify(ANIMATE_INFO* infoPtr, UINT notif)
@@ -704,7 +704,7 @@ static LRESULT ANIMATE_OpenA(HWND hWnd, 
     }
 
     if (!hInstance)
-       hInstance = (HINSTANCE)GetWindowLongA(hWnd, GWL_HINSTANCE);
+       hInstance = (HINSTANCE)GetWindowLongPtrW(hWnd, GWLP_HINSTANCE);
 
     if (HIWORD(lParam)) {
 	TRACE("(\"%s\");\n", (LPSTR)lParam);
@@ -794,13 +794,13 @@ static LRESULT ANIMATE_Create(HWND hWnd,
     }
 
     /* store crossref hWnd <-> info structure */
-    SetWindowLongA(hWnd, 0, (DWORD)infoPtr);
+    SetWindowLongPtrW(hWnd, 0, (DWORD_PTR)infoPtr);
     infoPtr->hwndSelf = hWnd;
     infoPtr->hwndNotify = ((LPCREATESTRUCTA)lParam)->hwndParent;
     infoPtr->transparentColor = ANIMATE_COLOR_NONE;
     infoPtr->hbmPrevFrame = 0;
 
-    TRACE("Animate style=0x%08lx, parent=%08lx\n", GetWindowLongA(hWnd, GWL_STYLE), (DWORD)infoPtr->hwndNotify);
+    TRACE("Animate style=0x%08lx, parent=%p\n", GetWindowLongA(hWnd, GWL_STYLE), infoPtr->hwndNotify);
 
     InitializeCriticalSection(&infoPtr->cs);
 
@@ -818,7 +818,7 @@ static LRESULT ANIMATE_Destroy(HWND hWnd
 
     /* free animate info data */
     Free(infoPtr);
-    SetWindowLongA(hWnd, 0, 0);
+    SetWindowLongPtrW(hWnd, 0, 0);
 
     return 0;
 }
Index: wine/dlls/comctl32/comboex.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/comboex.c,v
retrieving revision 1.71
diff -u -p -r1.71 comboex.c
--- wine/dlls/comctl32/comboex.c	19 Aug 2004 19:09:15 -0000	1.71
+++ wine/dlls/comctl32/comboex.c	25 Aug 2004 03:02:49 -0000
@@ -122,7 +122,7 @@ typedef struct
 #define CBE_SEP			4
 
 #define COMBOEX_SUBCLASS_PROP	"CCComboEx32SubclassInfo"
-#define COMBOEX_GetInfoPtr(hwnd) ((COMBOEX_INFO *)GetWindowLongW (hwnd, 0))
+#define COMBOEX_GetInfoPtr(hwnd) ((COMBOEX_INFO *)GetWindowLongPtrW (hwnd, 0))
 
 
 /* Things common to the entire DLL */
@@ -943,7 +943,7 @@ static LRESULT COMBOEX_Create (HWND hwnd
     }
     infoPtr->NtfUnicode = (i == NFR_UNICODE);
 
-    SetWindowLongW (hwnd, 0, (DWORD)infoPtr);
+    SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
 
     /* create combo box */
     GetWindowRect(hwnd, &wnrc1);
@@ -967,8 +967,8 @@ static LRESULT COMBOEX_Create (HWND hwnd
 			 WS_CHILD | WS_VISIBLE | CBS_OWNERDRAWFIXED |
 			 GetWindowLongW (hwnd, GWL_STYLE),
 			 cs->y, cs->x, cs->cx, cs->cy, hwnd,
-			 (HMENU) GetWindowLongW (hwnd, GWL_ID),
-			 (HINSTANCE)GetWindowLongW (hwnd, GWL_HINSTANCE), NULL);
+			 (HMENU) GetWindowLongPtrW (hwnd, GWLP_ID),
+			 (HINSTANCE)GetWindowLongPtrW (hwnd, GWLP_HINSTANCE), NULL);
 
     /*
      * native does the following at this point according to trace:
@@ -983,8 +983,8 @@ static LRESULT COMBOEX_Create (HWND hwnd
      * data structure.
      */
     SetPropA(infoPtr->hwndCombo, COMBOEX_SUBCLASS_PROP, hwnd);
-    infoPtr->prevComboWndProc = (WNDPROC)SetWindowLongW(infoPtr->hwndCombo,
-	                        GWL_WNDPROC, (LONG)COMBOEX_ComboWndProc);
+    infoPtr->prevComboWndProc = (WNDPROC)SetWindowLongPtrW(infoPtr->hwndCombo,
+	                        GWLP_WNDPROC, (DWORD_PTR)COMBOEX_ComboWndProc);
     infoPtr->font = (HFONT)SendMessageW (infoPtr->hwndCombo, WM_GETFONT, 0, 0);
 
 
@@ -997,8 +997,8 @@ static LRESULT COMBOEX_Create (HWND hwnd
 		    WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | ES_AUTOHSCROLL,
 		    0, 0, 0, 0,  /* will set later */
 		    infoPtr->hwndCombo,
-		    (HMENU) GetWindowLongW (hwnd, GWL_ID),
-		    (HINSTANCE)GetWindowLongW (hwnd, GWL_HINSTANCE), NULL);
+		    (HMENU) GetWindowLongPtrW (hwnd, GWLP_ID),
+		    (HINSTANCE)GetWindowLongPtrW (hwnd, GWLP_HINSTANCE), NULL);
 
 	/* native does the following at this point according to trace:
 	 *  GetWindowThreadProcessId(hwndEdit,0)
@@ -1012,8 +1012,8 @@ static LRESULT COMBOEX_Create (HWND hwnd
 	 * data structure.
 	 */
         SetPropA(infoPtr->hwndEdit, COMBOEX_SUBCLASS_PROP, hwnd);
-	infoPtr->prevEditWndProc = (WNDPROC)SetWindowLongW(infoPtr->hwndEdit,
-				 GWL_WNDPROC, (LONG)COMBOEX_EditWndProc);
+	infoPtr->prevEditWndProc = (WNDPROC)SetWindowLongPtrW(infoPtr->hwndEdit,
+				 GWLP_WNDPROC, (DWORD_PTR)COMBOEX_EditWndProc);
 	infoPtr->font = (HFONT)SendMessageW(infoPtr->hwndCombo, WM_GETFONT, 0, 0);
     }
 
@@ -1546,7 +1546,7 @@ static LRESULT COMBOEX_Destroy (COMBOEX_
 
     /* free comboex info data */
     Free (infoPtr);
-    SetWindowLongW (infoPtr->hwndSelf, 0, 0);
+    SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
     return 0;
 }
 
Index: wine/dlls/comctl32/commctrl.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/commctrl.c,v
retrieving revision 1.82
diff -u -p -r1.82 commctrl.c
--- wine/dlls/comctl32/commctrl.c	22 Aug 2004 22:29:38 -0000	1.82
+++ wine/dlls/comctl32/commctrl.c	25 Aug 2004 03:02:50 -0000
@@ -1116,11 +1116,11 @@ BOOL WINAPI SetWindowSubclass (HWND hWnd
 
       /* set window procedure to our own and save the current one */
       if (IsWindowUnicode (hWnd))
-         stack->origproc = (WNDPROC)SetWindowLongW (hWnd, GWL_WNDPROC,
-                                                   (LONG)COMCTL32_SubclassProc);
+         stack->origproc = (WNDPROC)SetWindowLongPtrW (hWnd, GWLP_WNDPROC,
+                                                   (DWORD_PTR)COMCTL32_SubclassProc);
       else
-         stack->origproc = (WNDPROC)SetWindowLongA (hWnd, GWL_WNDPROC,
-                                                   (LONG)COMCTL32_SubclassProc);
+         stack->origproc = (WNDPROC)SetWindowLongPtrA (hWnd, GWLP_WNDPROC,
+                                                   (DWORD_PTR)COMCTL32_SubclassProc);
    }
    else {
       /* Check to see if we have called this function with the same uIDSubClass
@@ -1140,9 +1140,9 @@ BOOL WINAPI SetWindowSubclass (HWND hWnd
    if (!proc) {
       ERR ("Failed to allocate subclass entry in stack\n");
       if (IsWindowUnicode (hWnd))
-         SetWindowLongW (hWnd, GWL_WNDPROC, (LONG)stack->origproc);
+         SetWindowLongPtrW (hWnd, GWLP_WNDPROC, (DWORD_PTR)stack->origproc);
       else
-         SetWindowLongA (hWnd, GWL_WNDPROC, (LONG)stack->origproc);
+         SetWindowLongPtrA (hWnd, GWLP_WNDPROC, (DWORD_PTR)stack->origproc);
       HeapFree (GetProcessHeap (), 0, stack);
       RemovePropA( hWnd, COMCTL32_aSubclass );
       return FALSE;
@@ -1255,9 +1255,9 @@ BOOL WINAPI RemoveWindowSubclass(HWND hW
       TRACE("Last Subclass removed, cleaning up\n");
       /* clean up our heap and reset the origional window procedure */
       if (IsWindowUnicode (hWnd))
-         SetWindowLongW (hWnd, GWL_WNDPROC, (LONG)stack->origproc);
+         SetWindowLongPtrW (hWnd, GWLP_WNDPROC, (DWORD_PTR)stack->origproc);
       else
-         SetWindowLongA (hWnd, GWL_WNDPROC, (LONG)stack->origproc);
+         SetWindowLongPtrA (hWnd, GWLP_WNDPROC, (DWORD_PTR)stack->origproc);
       HeapFree (GetProcessHeap (), 0, stack);
       RemovePropA( hWnd, COMCTL32_aSubclass );
    }
@@ -1297,9 +1297,9 @@ LRESULT WINAPI COMCTL32_SubclassProc (HW
       TRACE("Last Subclass removed, cleaning up\n");
       /* clean up our heap and reset the origional window procedure */
       if (IsWindowUnicode (hWnd))
-         SetWindowLongW (hWnd, GWL_WNDPROC, (LONG)stack->origproc);
+         SetWindowLongPtrW (hWnd, GWLP_WNDPROC, (DWORD_PTR)stack->origproc);
       else
-         SetWindowLongA (hWnd, GWL_WNDPROC, (LONG)stack->origproc);
+         SetWindowLongPtrA (hWnd, GWLP_WNDPROC, (DWORD_PTR)stack->origproc);
       HeapFree (GetProcessHeap (), 0, stack);
       RemovePropA( hWnd, COMCTL32_aSubclass );
    }
@@ -1387,12 +1387,12 @@ COMCTL32_CreateToolTip(HWND hwndOwner)
         /* true owner can be different if hwndOwner is a child window */
         HWND hwndTrueOwner = GetWindow(hwndToolTip, GW_OWNER);
         nmttc.hdr.hwndFrom = hwndTrueOwner;
-        nmttc.hdr.idFrom = GetWindowLongA(hwndTrueOwner, GWL_ID);
+        nmttc.hdr.idFrom = GetWindowLongPtrW(hwndTrueOwner, GWLP_ID);
 	nmttc.hdr.code = NM_TOOLTIPSCREATED;
 	nmttc.hwndToolTips = hwndToolTip;
 
        SendMessageA(GetParent(hwndTrueOwner), WM_NOTIFY,
-                    (WPARAM)GetWindowLongA(hwndTrueOwner, GWL_ID),
+                    (WPARAM)GetWindowLongPtrW(hwndTrueOwner, GWLP_ID),
 		     (LPARAM)&nmttc);
     }
 
Index: wine/dlls/comctl32/datetime.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/datetime.c,v
retrieving revision 1.43
diff -u -p -r1.43 datetime.c
--- wine/dlls/comctl32/datetime.c	21 Apr 2004 22:23:36 -0000	1.43
+++ wine/dlls/comctl32/datetime.c	25 Aug 2004 03:02:50 -0000
@@ -110,7 +110,7 @@ extern int MONTHCAL_MonthLength(int mont
 #define DTHT_MCPOPUP  0x300     /* & DTHT_DATEFIELD 0 when DATETIME_KeyDown */
 #define DTHT_GOTFOCUS 0x400     /* tests for date-fields */
 
-#define DATETIME_GetInfoPtr(hwnd) ((DATETIME_INFO *)GetWindowLongA (hwnd, 0))
+#define DATETIME_GetInfoPtr(hwnd) ((DATETIME_INFO *)GetWindowLongPtrW (hwnd, 0))
 
 static BOOL DATETIME_SendSimpleNotify (HWND hwnd, UINT code);
 static BOOL DATETIME_SendDateTimeChangeNotify (HWND hwnd);
@@ -1128,7 +1128,7 @@ DATETIME_SendDateTimeChangeNotify (HWND 
 
  TRACE ("\n");
  dtdtc.nmhdr.hwndFrom = hwnd;
- dtdtc.nmhdr.idFrom   = GetWindowLongA( hwnd, GWL_ID);
+ dtdtc.nmhdr.idFrom   = GetWindowLongPtrW(hwnd, GWLP_ID);
  dtdtc.nmhdr.code     = DTN_DATETIMECHANGE;
 
  if ((GetWindowLongA (hwnd, GWL_STYLE) & DTS_SHOWNONE))
@@ -1150,7 +1150,7 @@ DATETIME_SendSimpleNotify (HWND hwnd, UI
 
     TRACE("%x\n",code);
     nmhdr.hwndFrom = hwnd;
-    nmhdr.idFrom   = GetWindowLongA( hwnd, GWL_ID);
+    nmhdr.idFrom   = GetWindowLongPtrW(hwnd, GWLP_ID);
     nmhdr.code     = code;
 
     return (BOOL) SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
@@ -1221,14 +1221,14 @@ DATETIME_Create (HWND hwnd, WPARAM wPara
     return 0;
   }
 
-  SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
+  SetWindowLongPtrA (hwnd, 0, (DWORD_PTR)infoPtr);
 
   if (dwStyle & DTS_SHOWNONE) {
     infoPtr->hwndCheckbut=CreateWindowExA (0,"button", 0,
          WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
          2,2,13,13,
          hwnd,
-         0, (HINSTANCE)GetWindowLongA  (hwnd, GWL_HINSTANCE), 0);
+         0, (HINSTANCE)GetWindowLongPtrW (hwnd, GWLP_HINSTANCE), 0);
          SendMessageA (infoPtr->hwndCheckbut, BM_SETCHECK, 1, 0);
   }
 
@@ -1276,7 +1276,7 @@ DATETIME_Destroy (HWND hwnd, WPARAM wPar
 	infoPtr->hMonthCal = NULL;
     }
     Free (infoPtr);
-    SetWindowLongA( hwnd, 0, 0 ); /* clear infoPtr */
+    SetWindowLongPtrA( hwnd, 0, 0 ); /* clear infoPtr */
     return 0;
 }
 
Index: wine/dlls/comctl32/flatsb.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/flatsb.c,v
retrieving revision 1.29
diff -u -p -r1.29 flatsb.c
--- wine/dlls/comctl32/flatsb.c	27 Feb 2004 04:40:08 -0000	1.29
+++ wine/dlls/comctl32/flatsb.c	25 Aug 2004 03:02:50 -0000
@@ -47,7 +47,7 @@ typedef struct
     DWORD dwDummy;  /* just to keep the compiler happy ;-) */
 } FLATSB_INFO, *LPFLATSB_INFO;
 
-#define FlatSB_GetInfoPtr(hwnd) ((FLATSB_INFO*)GetWindowLongA (hwnd, 0))
+#define FlatSB_GetInfoPtr(hwnd) ((FLATSB_INFO*)GetWindowLongPtrW (hwnd, 0))
 
 
 /***********************************************************************
Index: wine/dlls/comctl32/header.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/header.c,v
retrieving revision 1.63
diff -u -p -r1.63 header.c
--- wine/dlls/comctl32/header.c	4 May 2004 04:13:06 -0000	1.63
+++ wine/dlls/comctl32/header.c	25 Aug 2004 03:02:50 -0000
@@ -92,7 +92,7 @@ typedef struct
 #define VERT_BORDER     3
 #define DIVIDER_WIDTH  10
 
-#define HEADER_GetInfoPtr(hwnd) ((HEADER_INFO *)GetWindowLongA(hwnd,0))
+#define HEADER_GetInfoPtr(hwnd) ((HEADER_INFO *)GetWindowLongPtrW(hwnd,0))
 
 
 inline static LRESULT
@@ -190,7 +190,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT
     if (phdi->fmt & HDF_OWNERDRAW) {
 	DRAWITEMSTRUCT dis;
 	dis.CtlType    = ODT_HEADER;
-	dis.CtlID      = GetWindowLongA (hwnd, GWL_ID);
+	dis.CtlID      = GetWindowLongPtrW (hwnd, GWLP_ID);
 	dis.itemID     = iItem;
 	dis.itemAction = ODA_DRAWENTIRE;
 	dis.itemState  = phdi->bDown ? ODS_SELECTED : 0;
@@ -542,7 +542,7 @@ HEADER_SendSimpleNotify (HWND hwnd, UINT
     NMHDR nmhdr;
 
     nmhdr.hwndFrom = hwnd;
-    nmhdr.idFrom   = GetWindowLongA (hwnd, GWL_ID);
+    nmhdr.idFrom   = GetWindowLongPtrW (hwnd, GWLP_ID);
     nmhdr.code     = code;
 
     return (BOOL)SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
@@ -557,7 +557,7 @@ HEADER_SendHeaderNotify (HWND hwnd, UINT
     HDITEMA nmitem;
 
     nmhdr.hdr.hwndFrom = hwnd;
-    nmhdr.hdr.idFrom   = GetWindowLongA (hwnd, GWL_ID);
+    nmhdr.hdr.idFrom   = GetWindowLongPtrW (hwnd, GWLP_ID);
     nmhdr.hdr.code = code;
     nmhdr.iItem = iItem;
     nmhdr.iButton = 0;
@@ -586,7 +586,7 @@ HEADER_SendClickNotify (HWND hwnd, UINT 
     NMHEADERA nmhdr;
 
     nmhdr.hdr.hwndFrom = hwnd;
-    nmhdr.hdr.idFrom   = GetWindowLongA (hwnd, GWL_ID);
+    nmhdr.hdr.idFrom   = GetWindowLongPtrW (hwnd, GWLP_ID);
     nmhdr.hdr.code = code;
     nmhdr.iItem = iItem;
     nmhdr.iButton = 0;
@@ -1284,7 +1284,7 @@ HEADER_Create (HWND hwnd, WPARAM wParam,
     HDC   hdc;
 
     infoPtr = (HEADER_INFO *)Alloc (sizeof(HEADER_INFO));
-    SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
+    SetWindowLongPtrA (hwnd, 0, (DWORD_PTR)infoPtr);
 
     infoPtr->hwndNotify = ((LPCREATESTRUCTA)lParam)->hwndParent;
     infoPtr->uNumItem = 0;
@@ -1335,7 +1335,7 @@ HEADER_Destroy (HWND hwnd, WPARAM wParam
 	ImageList_Destroy (infoPtr->himl);
 
     Free (infoPtr);
-    SetWindowLongA (hwnd, 0, 0);
+    SetWindowLongPtrA (hwnd, 0, 0);
     return 0;
 }
 
Index: wine/dlls/comctl32/hotkey.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/hotkey.c,v
retrieving revision 1.28
diff -u -p -r1.28 hotkey.c
--- wine/dlls/comctl32/hotkey.c	20 Nov 2003 22:04:14 -0000	1.28
+++ wine/dlls/comctl32/hotkey.c	25 Aug 2004 03:02:51 -0000
@@ -51,7 +51,7 @@ typedef struct tagHOTKEY_INFO
     WCHAR strNone[15]; /* hope its long enough ... */
 } HOTKEY_INFO;
 
-#define HOTKEY_GetInfoPtr(hwnd) ((HOTKEY_INFO *)GetWindowLongA (hwnd, 0))
+#define HOTKEY_GetInfoPtr(hwnd) ((HOTKEY_INFO *)GetWindowLongPtrA (hwnd, 0))
 
 static const WCHAR HOTKEY_plussep[] = { ' ', '+', ' ' };
 
@@ -217,7 +217,7 @@ HOTKEY_Create (HWND hwnd, WPARAM wParam,
 
     /* allocate memory for info structure */
     infoPtr = (HOTKEY_INFO *)Alloc (sizeof(HOTKEY_INFO));
-    SetWindowLongW (hwnd, 0, (DWORD)infoPtr);
+    SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
 
     /* initialize info structure */
     infoPtr->HotKey = infoPtr->InvComb = infoPtr->InvMod = infoPtr->CurrMod = 0;
@@ -242,7 +242,7 @@ HOTKEY_Destroy (HOTKEY_INFO *infoPtr, WP
     HWND hwnd = infoPtr->hwndSelf;
     /* free hotkey info data */
     Free (infoPtr);
-    SetWindowLongW (hwnd, 0, 0);
+    SetWindowLongPtrW (hwnd, 0, 0);
     return 0;
 }
 
Index: wine/dlls/comctl32/ipaddress.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/ipaddress.c,v
retrieving revision 1.37
diff -u -p -r1.37 ipaddress.c
--- wine/dlls/comctl32/ipaddress.c	20 Apr 2004 01:12:18 -0000	1.37
+++ wine/dlls/comctl32/ipaddress.c	25 Aug 2004 03:02:51 -0000
@@ -71,7 +71,7 @@ typedef struct
 #define POS_SELALL	3
 
 #define IP_SUBCLASS_PROP "CCIP32SubclassInfo"
-#define IPADDRESS_GetInfoPtr(hwnd) ((IPADDRESS_INFO *)GetWindowLongW (hwnd, 0))
+#define IPADDRESS_GetInfoPtr(hwnd) ((IPADDRESS_INFO *)GetWindowLongPtrW (hwnd, 0))
 
 
 static LRESULT CALLBACK
@@ -84,7 +84,7 @@ static LRESULT IPADDRESS_Notify (IPADDRE
     TRACE("(command=%x)\n", command);
 
     return SendMessageW (infoPtr->Notify, WM_COMMAND,
-             MAKEWPARAM (GetWindowLongW (hwnd, GWL_ID), command), (LPARAM)hwnd);
+             MAKEWPARAM (GetWindowLongPtrW (hwnd, GWLP_ID), command), (LPARAM)hwnd);
 }
 
 static INT IPADDRESS_IPNotify (IPADDRESS_INFO *infoPtr, INT field, INT value)
@@ -94,7 +94,7 @@ static INT IPADDRESS_IPNotify (IPADDRESS
     TRACE("(field=%x, value=%d)\n", field, value);
 
     nmip.hdr.hwndFrom = infoPtr->Self;
-    nmip.hdr.idFrom   = GetWindowLongW (infoPtr->Self, GWL_ID);
+    nmip.hdr.idFrom   = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
     nmip.hdr.code     = IPN_FIELDCHANGED;
 
     nmip.iField = field;
@@ -164,7 +164,7 @@ static LRESULT IPADDRESS_Create (HWND hw
 
     infoPtr = (IPADDRESS_INFO *)Alloc (sizeof(IPADDRESS_INFO));
     if (!infoPtr) return -1;
-    SetWindowLongW (hwnd, 0, (DWORD)infoPtr);
+    SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
 
     GetClientRect (hwnd, &rcClient);
 
@@ -187,11 +187,11 @@ static LRESULT IPADDRESS_Create (HWND hw
 		CreateWindowW (EDIT, NULL, WS_CHILD | WS_VISIBLE | ES_CENTER,
                                edit.left, edit.top, edit.right - edit.left,
 			       edit.bottom - edit.top, hwnd, (HMENU) 1,
-			       (HINSTANCE)GetWindowLongW(hwnd, GWL_HINSTANCE), NULL);
+			       (HINSTANCE)GetWindowLongPtrW(hwnd, GWLP_HINSTANCE), NULL);
 	SetPropA(part->EditHwnd, IP_SUBCLASS_PROP, hwnd);
         part->OrigProc = (WNDPROC)
-		SetWindowLongW (part->EditHwnd, GWL_WNDPROC,
-				(LONG)IPADDRESS_SubclassProc);
+		SetWindowLongPtrW (part->EditHwnd, GWLP_WNDPROC,
+				(DWORD_PTR)IPADDRESS_SubclassProc);
     }
 
     return 0;
@@ -206,10 +206,10 @@ static LRESULT IPADDRESS_Destroy (IPADDR
 
     for (i = 0; i < 4; i++) {
 	IPPART_INFO* part = &infoPtr->Part[i];
-        SetWindowLongW (part->EditHwnd, GWL_WNDPROC, (LONG)part->OrigProc);
+        SetWindowLongPtrW (part->EditHwnd, GWLP_WNDPROC, (DWORD_PTR)part->OrigProc);
     }
 
-    SetWindowLongW (infoPtr->Self, 0, 0);
+    SetWindowLongPtrW (infoPtr->Self, 0, 0);
     Free (infoPtr);
     return 0;
 }
Index: wine/dlls/comctl32/listview.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/listview.c,v
retrieving revision 1.392
diff -u -p -r1.392 listview.c
--- wine/dlls/comctl32/listview.c	12 Aug 2004 20:01:55 -0000	1.392
+++ wine/dlls/comctl32/listview.c	25 Aug 2004 03:02:53 -0000
@@ -716,7 +716,7 @@ static LRESULT notify_hdr(LISTVIEW_INFO 
     TRACE("(code=%d)\n", code);
 
     pnmh->hwndFrom = infoPtr->hwndSelf;
-    pnmh->idFrom = GetWindowLongW(infoPtr->hwndSelf, GWL_ID);
+    pnmh->idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
     pnmh->code = code;
     result = SendMessageW(infoPtr->hwndNotify, WM_NOTIFY,
 			  (WPARAM)pnmh->idFrom, (LPARAM)pnmh);
@@ -1731,7 +1731,7 @@ static void LISTVIEW_ShowFocusRect(LISTV
 	   
 	ZeroMemory(&dis, sizeof(dis)); 
 	dis.CtlType = ODT_LISTVIEW;
-	dis.CtlID = GetWindowLongW(infoPtr->hwndSelf, GWL_ID);
+	dis.CtlID = (UINT)GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
 	dis.itemID = item.iItem;
 	dis.itemAction = ODA_FOCUS;
 	if (fShow) dis.itemState |= ODS_FOCUS;
@@ -3689,7 +3689,7 @@ postpaint:
  */
 static void LISTVIEW_RefreshOwnerDraw(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc, DWORD cdmode)
 {
-    UINT uID = GetWindowLongW(infoPtr->hwndSelf, GWL_ID);
+    UINT uID = (UINT)GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
     DWORD cditemmode = CDRF_DODEFAULT;
     NMLVCUSTOMDRAW nmlvcd;
     POINT Origin, Position;
@@ -7378,7 +7378,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd
   infoPtr = (LISTVIEW_INFO *)Alloc(sizeof(LISTVIEW_INFO));
   if (!infoPtr) return -1;
 
-  SetWindowLongW(hwnd, 0, (LONG)infoPtr);
+  SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr);
 
   infoPtr->hwndSelf = hwnd;
   infoPtr->dwStyle = lpcs->style;
@@ -8180,7 +8180,7 @@ static LRESULT LISTVIEW_NCDestroy(LISTVI
   if (infoPtr->hDefaultFont) DeleteObject(infoPtr->hDefaultFont);
   if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush);
 
-  SetWindowLongW(infoPtr->hwndSelf, 0, 0);
+  SetWindowLongPtrW(infoPtr->hwndSelf, 0, 0);
 
   /* free listview info pointer*/
   Free(infoPtr);
@@ -8772,7 +8772,7 @@ static INT LISTVIEW_StyleChanged(LISTVIE
 static LRESULT WINAPI
 LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
-  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0);
+  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongPtrW(hwnd, 0);
 
   TRACE("(uMsg=%x wParam=%x lParam=%lx)\n", uMsg, wParam, lParam);
 
@@ -9380,7 +9380,7 @@ static LRESULT LISTVIEW_Command(LISTVIEW
  */
 static LRESULT EditLblWndProcT(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL isW)
 {
-    LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(GetParent(hwnd), 0);
+    LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongPtrW(GetParent(hwnd), 0);
     BOOL cancel = FALSE;
 
     TRACE("(hwnd=%p, uMsg=%x, wParam=%x, lParam=%lx, isW=%d)\n",
@@ -9398,7 +9398,7 @@ static LRESULT EditLblWndProcT(HWND hwnd
 	{
 	    WNDPROC editProc = infoPtr->EditWndProc;
 	    infoPtr->EditWndProc = 0;
-	    SetWindowLongW(hwnd, GWL_WNDPROC, (LONG)editProc);
+	    SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (DWORD_PTR)editProc);
 	    return CallWindowProcT(editProc, hwnd, uMsg, wParam, lParam, isW);
 	}
 
@@ -9499,7 +9499,7 @@ static HWND CreateEditLabelT(LISTVIEW_IN
     HDC hdc;
     HDC hOldFont=0;
     TEXTMETRICW textMetric;
-    HINSTANCE hinst = (HINSTANCE)GetWindowLongW(infoPtr->hwndSelf, GWL_HINSTANCE);
+    HINSTANCE hinst = (HINSTANCE)GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_HINSTANCE);
 
     TRACE("(text=%s, ..., isW=%d)\n", debugtext_t(text, isW), isW);
 
@@ -9529,8 +9529,8 @@ static HWND CreateEditLabelT(LISTVIEW_IN
     if (!hedit) return 0;
 
     infoPtr->EditWndProc = (WNDPROC)
-	(isW ? SetWindowLongW(hedit, GWL_WNDPROC, (LONG)EditLblWndProcW) :
-               SetWindowLongA(hedit, GWL_WNDPROC, (LONG)EditLblWndProcA) );
+	(isW ? SetWindowLongPtrW(hedit, GWLP_WNDPROC, (DWORD_PTR)EditLblWndProcW) :
+               SetWindowLongPtrA(hedit, GWLP_WNDPROC, (DWORD_PTR)EditLblWndProcA) );
 
     SendMessageW(hedit, WM_SETFONT, (WPARAM)infoPtr->hFont, FALSE);
 
Index: wine/dlls/comctl32/monthcal.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/monthcal.c,v
retrieving revision 1.44
diff -u -p -r1.44 monthcal.c
--- wine/dlls/comctl32/monthcal.c	21 Apr 2004 22:24:09 -0000	1.44
+++ wine/dlls/comctl32/monthcal.c	25 Aug 2004 03:02:54 -0000
@@ -114,7 +114,7 @@ typedef struct
 static const int DayOfWeekTable[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
 
 
-#define MONTHCAL_GetInfoPtr(hwnd) ((MONTHCAL_INFO *)GetWindowLongA(hwnd, 0))
+#define MONTHCAL_GetInfoPtr(hwnd) ((MONTHCAL_INFO *)GetWindowLongPtrW(hwnd, 0))
 
 /* helper functions  */
 
@@ -1302,7 +1302,7 @@ static void MONTHCAL_GoToNextMonth(HWND 
     int i;
 
     nmds.nmhdr.hwndFrom = hwnd;
-    nmds.nmhdr.idFrom   = GetWindowLongA(hwnd, GWL_ID);
+    nmds.nmhdr.idFrom   = GetWindowLongPtrW(hwnd, GWLP_ID);
     nmds.nmhdr.code     = MCN_GETDAYSTATE;
     nmds.cDayState	= infoPtr->monthRange;
     nmds.prgDayState	= Alloc(infoPtr->monthRange * sizeof(MONTHDAYSTATE));
@@ -1332,7 +1332,7 @@ static void MONTHCAL_GoToPrevMonth(HWND 
     int i;
 
     nmds.nmhdr.hwndFrom = hwnd;
-    nmds.nmhdr.idFrom   = GetWindowLongA(hwnd, GWL_ID);
+    nmds.nmhdr.idFrom   = GetWindowLongPtrW(hwnd, GWLP_ID);
     nmds.nmhdr.code     = MCN_GETDAYSTATE;
     nmds.cDayState	= infoPtr->monthRange;
     nmds.prgDayState	= Alloc
@@ -1491,7 +1491,7 @@ MONTHCAL_LButtonDown(HWND hwnd, WPARAM w
     MONTHCAL_SetCurSel(hwnd,0,(LPARAM) &selArray);
     TRACE("MCHT_CALENDARDATE\n");
     nmsc.nmhdr.hwndFrom = hwnd;
-    nmsc.nmhdr.idFrom   = GetWindowLongA(hwnd, GWL_ID);
+    nmsc.nmhdr.idFrom   = GetWindowLongPtrW(hwnd, GWLP_ID);
     nmsc.nmhdr.code     = MCN_SELCHANGE;
     MONTHCAL_CopyTime(&infoPtr->minSel,&nmsc.stSelStart);
     MONTHCAL_CopyTime(&infoPtr->maxSel,&nmsc.stSelEnd);
@@ -1559,7 +1559,7 @@ MONTHCAL_LButtonUp(HWND hwnd, WPARAM wPa
     return TRUE;
   }
   nmhdr.hwndFrom = hwnd;
-  nmhdr.idFrom   = GetWindowLongA( hwnd, GWL_ID);
+  nmhdr.idFrom   = GetWindowLongPtrW( hwnd, GWLP_ID);
   nmhdr.code     = NM_RELEASEDCAPTURE;
   TRACE("Sent notification from %p to %p\n", hwnd, infoPtr->hwndNotify);
 
@@ -1571,7 +1571,7 @@ MONTHCAL_LButtonUp(HWND hwnd, WPARAM wPa
   /* only send MCN_SELECT if currently displayed month's day was selected */
   if(hit == MCHT_CALENDARDATE) {
     nmsc.nmhdr.hwndFrom = hwnd;
-    nmsc.nmhdr.idFrom   = GetWindowLongA(hwnd, GWL_ID);
+    nmsc.nmhdr.idFrom   = GetWindowLongPtrW(hwnd, GWLP_ID);
     nmsc.nmhdr.code     = MCN_SELECT;
     MONTHCAL_CopyTime(&infoPtr->minSel, &nmsc.stSelStart);
     MONTHCAL_CopyTime(&infoPtr->maxSel, &nmsc.stSelEnd);
@@ -1877,13 +1877,13 @@ MONTHCAL_Create(HWND hwnd, WPARAM wParam
 
   /* allocate memory for info structure */
   infoPtr =(MONTHCAL_INFO*)Alloc(sizeof(MONTHCAL_INFO));
-  SetWindowLongA(hwnd, 0, (DWORD)infoPtr);
+  SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr);
 
   if(infoPtr == NULL) {
     ERR( "could not allocate info memory!\n");
     return 0;
   }
-  if((MONTHCAL_INFO*)GetWindowLongA(hwnd, 0) != infoPtr) {
+  if((MONTHCAL_INFO*)GetWindowLongPtrW(hwnd, 0) != infoPtr) {
     ERR( "pointer assignment error!\n");
     return 0;
   }
@@ -1934,7 +1934,7 @@ MONTHCAL_Destroy(HWND hwnd, WPARAM wPara
   if(infoPtr->monthdayState)
       Free(infoPtr->monthdayState);
   Free(infoPtr);
-  SetWindowLongA(hwnd, 0, 0);
+  SetWindowLongPtrW(hwnd, 0, 0);
   return 0;
 }
 
Index: wine/dlls/comctl32/nativefont.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/nativefont.c,v
retrieving revision 1.21
diff -u -p -r1.21 nativefont.c
--- wine/dlls/comctl32/nativefont.c	22 Sep 2003 21:32:33 -0000	1.21
+++ wine/dlls/comctl32/nativefont.c	25 Aug 2004 03:02:54 -0000
@@ -45,7 +45,7 @@ typedef struct
     DWORD  dwDummy;   /* just to keep the compiler happy ;-) */
 } NATIVEFONT_INFO;
 
-#define NATIVEFONT_GetInfoPtr(hwnd) ((NATIVEFONT_INFO *)GetWindowLongA (hwnd, 0))
+#define NATIVEFONT_GetInfoPtr(hwnd) ((NATIVEFONT_INFO *)GetWindowLongPtrW (hwnd, 0))
 
 
 static LRESULT
@@ -55,7 +55,7 @@ NATIVEFONT_Create (HWND hwnd, WPARAM wPa
 
     /* allocate memory for info structure */
     infoPtr = (NATIVEFONT_INFO *)Alloc (sizeof(NATIVEFONT_INFO));
-    SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
+    SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
 
 
     /* initialize info structure */
@@ -75,7 +75,7 @@ NATIVEFONT_Destroy (HWND hwnd, WPARAM wP
 
     /* free comboex info data */
     Free (infoPtr);
-    SetWindowLongA( hwnd, 0, 0 );
+    SetWindowLongPtrW( hwnd, 0, 0 );
 
     return 0;
 }
Index: wine/dlls/comctl32/pager.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/pager.c,v
retrieving revision 1.46
diff -u -p -r1.46 pager.c
--- wine/dlls/comctl32/pager.c	20 Nov 2003 22:04:14 -0000	1.46
+++ wine/dlls/comctl32/pager.c	25 Aug 2004 03:02:54 -0000
@@ -59,7 +59,7 @@ typedef struct
     INT    direction;  /* direction of the scroll, (e.g. PGF_SCROLLUP) */
 } PAGER_INFO;
 
-#define PAGER_GetInfoPtr(hwnd) ((PAGER_INFO *)GetWindowLongA(hwnd, 0))
+#define PAGER_GetInfoPtr(hwnd) ((PAGER_INFO *)GetWindowLongPtrW(hwnd, 0))
 #define PAGER_IsHorizontal(hwnd) ((GetWindowLongA (hwnd, GWL_STYLE) & PGS_HORZ))
 
 #define MIN_ARROW_WIDTH  8
@@ -330,7 +330,7 @@ PAGER_CalcSize (HWND hwnd, INT* size, BO
     NMPGCALCSIZE nmpgcs;
     ZeroMemory (&nmpgcs, sizeof (NMPGCALCSIZE));
     nmpgcs.hdr.hwndFrom = hwnd;
-    nmpgcs.hdr.idFrom   = GetWindowLongA (hwnd, GWL_ID);
+    nmpgcs.hdr.idFrom   = GetWindowLongPtrW (hwnd, GWLP_ID);
     nmpgcs.hdr.code = PGN_CALCSIZE;
     nmpgcs.dwFlag = getWidth ? PGF_CALCWIDTH : PGF_CALCHEIGHT;
     nmpgcs.iWidth = getWidth ? *size : 0;
@@ -777,7 +777,7 @@ PAGER_Scroll(HWND hwnd, INT dir)
     {
         ZeroMemory (&nmpgScroll, sizeof (NMPGSCROLL));
         nmpgScroll.hdr.hwndFrom = hwnd;
-        nmpgScroll.hdr.idFrom   = GetWindowLongA (hwnd, GWL_ID);
+        nmpgScroll.hdr.idFrom   = GetWindowLongPtrW (hwnd, GWLP_ID);
         nmpgScroll.hdr.code = PGN_SCROLL;
 
         GetWindowRect(hwnd, &rcWnd);
@@ -841,7 +841,7 @@ PAGER_Create (HWND hwnd, WPARAM wParam, 
 
     /* allocate memory for info structure */
     infoPtr = (PAGER_INFO *)Alloc (sizeof(PAGER_INFO));
-    SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
+    SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
 
     /* set default settings */
     infoPtr->hwndChild = NULL;
@@ -882,7 +882,7 @@ PAGER_Destroy (HWND hwnd, WPARAM wParam,
     PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
     /* free pager info data */
     Free (infoPtr);
-    SetWindowLongA (hwnd, 0, 0);
+    SetWindowLongPtrW (hwnd, 0, 0);
     return 0;
 }
 
@@ -1178,7 +1178,7 @@ PAGER_MouseLeave (HWND hwnd, WPARAM wPar
         NMHDR nmhdr;
         ZeroMemory (&nmhdr, sizeof (NMHDR));
         nmhdr.hwndFrom = hwnd;
-        nmhdr.idFrom   = GetWindowLongA (hwnd, GWL_ID);
+        nmhdr.idFrom   = GetWindowLongPtrW (hwnd, GWLP_ID);
         nmhdr.code = NM_RELEASEDCAPTURE;
         SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
                         (WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr);
@@ -1268,7 +1268,7 @@ PAGER_MouseMove (HWND hwnd, WPARAM wPara
 		NMHDR nmhdr;
 		ZeroMemory (&nmhdr, sizeof (NMHDR));
 		nmhdr.hwndFrom = hwnd;
-		nmhdr.idFrom   = GetWindowLongA (hwnd, GWL_ID);
+		nmhdr.idFrom   = GetWindowLongPtrW (hwnd, GWLP_ID);
 		nmhdr.code = NM_RELEASEDCAPTURE;
 		SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
 			      (WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr);
Index: wine/dlls/comctl32/progress.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/progress.c,v
retrieving revision 1.37
diff -u -p -r1.37 progress.c
--- wine/dlls/comctl32/progress.c	2 Aug 2004 22:19:50 -0000	1.37
+++ wine/dlls/comctl32/progress.c	25 Aug 2004 03:02:54 -0000
@@ -499,7 +499,7 @@ static LRESULT WINAPI ProgressWindowProc
 
     TRACE("hwnd=%p msg=%04x wparam=%x lParam=%lx\n", hwnd, message, wParam, lParam);
 
-    infoPtr = (PROGRESS_INFO *)GetWindowLongW(hwnd, 0);
+    infoPtr = (PROGRESS_INFO *)GetWindowLongPtrW(hwnd, 0);
 
     if (!infoPtr && message != WM_CREATE)
         return DefWindowProcW( hwnd, message, wParam, lParam );
@@ -518,7 +518,7 @@ static LRESULT WINAPI ProgressWindowProc
         /* allocate memory for info struct */
         infoPtr = (PROGRESS_INFO *)Alloc (sizeof(PROGRESS_INFO));
         if (!infoPtr) return -1;
-        SetWindowLongW (hwnd, 0, (DWORD)infoPtr);
+        SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
 
         /* initialize the info struct */
         infoPtr->Self = hwnd;
@@ -538,7 +538,7 @@ static LRESULT WINAPI ProgressWindowProc
     case WM_DESTROY:
         TRACE("Progress Ctrl destruction, hwnd=%p\n", hwnd);
         Free (infoPtr);
-        SetWindowLongW(hwnd, 0, 0);
+        SetWindowLongPtrW(hwnd, 0, 0);
         return 0;
 
     case WM_GETFONT:
Index: wine/dlls/comctl32/propsheet.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/propsheet.c,v
retrieving revision 1.109
diff -u -p -r1.109 propsheet.c
--- wine/dlls/comctl32/propsheet.c	23 Aug 2004 17:51:19 -0000	1.109
+++ wine/dlls/comctl32/propsheet.c	25 Aug 2004 03:02:55 -0000
@@ -3244,11 +3244,11 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMs
       /*
        * psInfo->hwnd is not being used by WINE code - it exists
        * for compatibility with "real" Windoze. The same about
-       * SetWindowLong - WINE is only using the PropSheetInfoStr
+       * SetWindowLongPtr - WINE is only using the PropSheetInfoStr
        * property.
        */
       psInfo->hwnd = hwnd;
-      SetWindowLongW(hwnd,DWL_USER,(LONG)psInfo);
+      SetWindowLongPtrW(hwnd, DWLP_USER, (DWORD_PTR)psInfo);
 
       /* set up the Next and Back buttons by default */
       PROPSHEET_SetWizButtons(hwnd, PSWIZB_BACK|PSWIZB_NEXT);
@@ -3382,7 +3382,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMs
       if(pnmh->code == TCN_SELCHANGING)
       {
         BOOL bRet = PROPSHEET_CanSetCurSel(hwnd);
-        SetWindowLongW(hwnd, DWL_MSGRESULT, !bRet);
+        SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, !bRet);
         return TRUE;
       }
 
@@ -3398,7 +3398,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMs
       if (psInfo->activeValid && psInfo->active_page != -1)
         hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
 
-      SetWindowLongW(hwnd, DWL_MSGRESULT, (LONG)hwndPage);
+      SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, (DWORD_PTR)hwndPage);
 
       return TRUE;
     }
@@ -3415,7 +3415,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMs
     {
       HWND hwndTabCtrl = GetDlgItem(hwnd, IDC_TABCONTROL);
 
-      SetWindowLongW(hwnd, DWL_MSGRESULT, (LONG)hwndTabCtrl);
+      SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, (DWORD_PTR)hwndTabCtrl);
 
       return TRUE;
     }
@@ -3433,7 +3433,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMs
                                        (HPROPSHEETPAGE)lParam);
       }
 
-      SetWindowLongW(hwnd, DWL_MSGRESULT, msgResult);
+      SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
 
       return TRUE;
     }
@@ -3481,7 +3481,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMs
     {
       BOOL msgResult = PROPSHEET_Apply(hwnd, 0);
 
-      SetWindowLongW(hwnd, DWL_MSGRESULT, msgResult);
+      SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
 
       return TRUE;
     }
@@ -3490,7 +3490,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMs
     {
       LRESULT msgResult = PROPSHEET_QuerySiblings(hwnd, wParam, lParam);
 
-      SetWindowLongW(hwnd, DWL_MSGRESULT, msgResult);
+      SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
 
       return TRUE;
     }
@@ -3507,7 +3507,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMs
 
       BOOL msgResult = PROPSHEET_AddPage(hwnd, (HPROPSHEETPAGE)lParam);
 
-      SetWindowLongW(hwnd, DWL_MSGRESULT, msgResult);
+      SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
 
       return TRUE;
     }
@@ -3519,7 +3519,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMs
     case PSM_ISDIALOGMESSAGE:
     {
        BOOL msgResult = PROPSHEET_IsDialogMessage(hwnd, (LPMSG)lParam);
-       SetWindowLongA(hwnd, DWL_MSGRESULT, msgResult);
+       SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
        return TRUE;
     }
 
@@ -3546,7 +3546,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMs
     case PSM_INSERTPAGE:
     {
         BOOL msgResult = PROPSHEET_InsertPage(hwnd, (HPROPSHEETPAGE)wParam, (HPROPSHEETPAGE)lParam);
-        SetWindowLongW(hwnd, DWL_MSGRESULT, msgResult);
+        SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
         return TRUE;
     }
 
@@ -3569,56 +3569,56 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMs
     case PSM_HWNDTOINDEX:
     {
         LRESULT msgResult = PROPSHEET_HwndToIndex(hwnd, (HWND)wParam);
-        SetWindowLongW(hwnd, DWL_MSGRESULT, msgResult);
+        SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
         return TRUE;
     }
 
     case PSM_INDEXTOHWND:
     {
         LRESULT msgResult = PROPSHEET_IndexToHwnd(hwnd, (int)wParam);
-        SetWindowLongW(hwnd, DWL_MSGRESULT, msgResult);
+        SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
         return TRUE;
     }
 
     case PSM_PAGETOINDEX:
     {
         LRESULT msgResult = PROPSHEET_PageToIndex(hwnd, (HPROPSHEETPAGE)wParam);
-        SetWindowLongW(hwnd, DWL_MSGRESULT, msgResult);
+        SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
         return TRUE;
     }
 
     case PSM_INDEXTOPAGE:
     {
         LRESULT msgResult = PROPSHEET_IndexToPage(hwnd, (int)wParam);
-        SetWindowLongW(hwnd, DWL_MSGRESULT, msgResult);
+        SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
         return TRUE;
     }
 
     case PSM_IDTOINDEX:
     {
         LRESULT msgResult = PROPSHEET_IdToIndex(hwnd, (int)lParam);
-        SetWindowLongW(hwnd, DWL_MSGRESULT, msgResult);
+        SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
         return TRUE;
     }
 
     case PSM_INDEXTOID:
     {
         LRESULT msgResult = PROPSHEET_IndexToId(hwnd, (int)wParam);
-        SetWindowLongW(hwnd, DWL_MSGRESULT, msgResult);
+        SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
         return TRUE;
     }
 
     case PSM_GETRESULT:
     {
         LRESULT msgResult = PROPSHEET_GetResult(hwnd);
-        SetWindowLongW(hwnd, DWL_MSGRESULT, msgResult);
+        SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
         return TRUE;
     }
 
     case PSM_RECALCPAGESIZES:
     {
         LRESULT msgResult = PROPSHEET_RecalcPageSizes(hwnd);
-        SetWindowLongW(hwnd, DWL_MSGRESULT, msgResult);
+        SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
         return TRUE;
     }
 
Index: wine/dlls/comctl32/rebar.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/rebar.c,v
retrieving revision 1.93
diff -u -p -r1.93 rebar.c
--- wine/dlls/comctl32/rebar.c	2 May 2004 04:21:48 -0000	1.93
+++ wine/dlls/comctl32/rebar.c	25 Aug 2004 03:02:57 -0000
@@ -333,7 +333,7 @@ typedef struct
                     else b->rcBand.left += (i); } while(0)
 
 
-#define REBAR_GetInfoPtr(wndPtr) ((REBAR_INFO *)GetWindowLongA (hwnd, 0))
+#define REBAR_GetInfoPtr(wndPtr) ((REBAR_INFO *)GetWindowLongPtrW (hwnd, 0))
 
 
 /* "constant values" retrieved when DLL was initialized    */
@@ -3841,7 +3841,7 @@ REBAR_Destroy (REBAR_INFO *infoPtr, WPAR
     DeleteObject (infoPtr->hcurVert);
     DeleteObject (infoPtr->hcurDrag);
     if(infoPtr->hDefaultFont) DeleteObject (infoPtr->hDefaultFont);
-    SetWindowLongA (infoPtr->hwndSelf, 0, 0);
+    SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
 
     /* free rebar info data */
     Free (infoPtr);
@@ -4124,7 +4124,7 @@ REBAR_NCCreate (HWND hwnd, WPARAM wParam
 
     /* allocate memory for info structure */
     infoPtr = (REBAR_INFO *)Alloc (sizeof(REBAR_INFO));
-    SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
+    SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
 
     /* initialize info structure - initial values are 0 */
     infoPtr->clrBk = CLR_NONE;
Index: wine/dlls/comctl32/status.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/status.c,v
retrieving revision 1.64
diff -u -p -r1.64 status.c
--- wine/dlls/comctl32/status.c	20 Nov 2003 22:04:14 -0000	1.64
+++ wine/dlls/comctl32/status.c	25 Aug 2004 03:02:57 -0000
@@ -91,7 +91,7 @@ typedef struct
 #define VERT_BORDER 2
 #define HORZ_GAP    2
 
-#define STATUSBAR_GetInfoPtr(hwnd) ((STATUSWINDOWINFO *)GetWindowLongW (hwnd, 0))
+#define STATUSBAR_GetInfoPtr(hwnd) ((STATUSWINDOWINFO *)GetWindowLongPtrW (hwnd, 0))
 
 /* prototype */
 static void
@@ -165,7 +165,7 @@ STATUSBAR_DrawPart (HDC hdc, const STATU
 	{
 	    DRAWITEMSTRUCT dis;
 
-	    dis.CtlID = GetWindowLongW (infoPtr->Self, GWL_ID);
+	    dis.CtlID = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
 	    dis.itemID = itemID;
 	    dis.hwndItem = infoPtr->Self;
 	    dis.hDC = hdc;
@@ -777,7 +777,7 @@ STATUSBAR_Simple (STATUSWINDOWINFO *info
 
     /* send notification */
     nmhdr.hwndFrom = infoPtr->Self;
-    nmhdr.idFrom = GetWindowLongW (infoPtr->Self, GWL_ID);
+    nmhdr.idFrom = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
     nmhdr.code = SBN_SIMPLEMODECHANGE;
     SendMessageW (infoPtr->Notify, WM_NOTIFY, 0, (LPARAM)&nmhdr);
     InvalidateRect(infoPtr->Self, NULL, FALSE);
@@ -807,7 +807,7 @@ STATUSBAR_WMDestroy (STATUSWINDOWINFO *i
     if (infoPtr->hwndToolTip)
 	DestroyWindow (infoPtr->hwndToolTip);
 
-    SetWindowLongW(infoPtr->Self, 0, 0);
+    SetWindowLongPtrW(infoPtr->Self, 0, 0);
     Free (infoPtr);
     return 0;
 }
@@ -826,7 +826,7 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATES
     TRACE("\n");
     infoPtr = (STATUSWINDOWINFO*)Alloc (sizeof(STATUSWINDOWINFO));
     if (!infoPtr) goto create_fail;
-    SetWindowLongW (hwnd, 0, (DWORD)infoPtr);
+    SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
 
     infoPtr->Self = hwnd;
     infoPtr->Notify = lpCreate->hwndParent;
@@ -908,13 +908,13 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATES
 	    CreateWindowExW (0, TOOLTIPS_CLASSW, NULL, 0,
 			     CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
 			     CW_USEDEFAULT, hwnd, 0,
-			     (HINSTANCE)GetWindowLongW(hwnd, GWL_HINSTANCE), NULL);
+			     (HINSTANCE)GetWindowLongPtrW(hwnd, GWLP_HINSTANCE), NULL);
 
 	if (infoPtr->hwndToolTip) {
 	    NMTOOLTIPSCREATED nmttc;
 
 	    nmttc.hdr.hwndFrom = hwnd;
-	    nmttc.hdr.idFrom = GetWindowLongW (hwnd, GWL_ID);
+	    nmttc.hdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID);
 	    nmttc.hdr.code = NM_TOOLTIPSCREATED;
 	    nmttc.hwndToolTips = infoPtr->hwndToolTip;
 
@@ -1106,7 +1106,7 @@ STATUSBAR_SendNotify (HWND hwnd, UINT co
 
     TRACE("code %04x\n", code);
     nmhdr.hwndFrom = hwnd;
-    nmhdr.idFrom = GetWindowLongW (hwnd, GWL_ID);
+    nmhdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID);
     nmhdr.code = code;
     SendMessageW (infoPtr->Notify, WM_NOTIFY, 0, (LPARAM)&nmhdr);
     return 0;
Index: wine/dlls/comctl32/syslink.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/syslink.c,v
retrieving revision 1.1
diff -u -p -r1.1 syslink.c
--- wine/dlls/comctl32/syslink.c	6 Aug 2004 19:17:49 -0000	1.1
+++ wine/dlls/comctl32/syslink.c	25 Aug 2004 03:02:57 -0000
@@ -1223,7 +1223,7 @@ static LRESULT SYSLINK_SendParentNotify 
     NMLINK nml;
 
     nml.hdr.hwndFrom = infoPtr->Self;
-    nml.hdr.idFrom = GetWindowLongW(infoPtr->Self, GWL_ID);
+    nml.hdr.idFrom = GetWindowLongPtrW(infoPtr->Self, GWLP_ID);
     nml.hdr.code = code;
 
     nml.item.mask = 0;
@@ -1465,7 +1465,7 @@ static LRESULT WINAPI SysLinkWindowProc(
 
     TRACE("hwnd=%p msg=%04x wparam=%x lParam=%lx\n", hwnd, message, wParam, lParam);
 
-    infoPtr = (SYSLINK_INFO *)GetWindowLongW(hwnd, 0);
+    infoPtr = (SYSLINK_INFO *)GetWindowLongPtrW(hwnd, 0);
 
     if (!infoPtr && message != WM_CREATE)
         return DefWindowProcW( hwnd, message, wParam, lParam );
@@ -1618,7 +1618,7 @@ static LRESULT WINAPI SysLinkWindowProc(
         /* allocate memory for info struct */
         infoPtr = (SYSLINK_INFO *)SYSLINK_Alloc (sizeof(SYSLINK_INFO));
         if (!infoPtr) return -1;
-        SetWindowLongW (hwnd, 0, (DWORD)infoPtr);
+        SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
 
         /* initialize the info struct */
         infoPtr->Self = hwnd;
@@ -1639,7 +1639,7 @@ static LRESULT WINAPI SysLinkWindowProc(
         TRACE("SysLink Ctrl destruction, hwnd=%p\n", hwnd);
         SYSLINK_ClearDoc(infoPtr);
         SYSLINK_Free (infoPtr);
-        SetWindowLongW(hwnd, 0, 0);
+        SetWindowLongPtrW(hwnd, 0, 0);
         return 0;
 
     default:
Index: wine/dlls/comctl32/tab.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/tab.c,v
retrieving revision 1.96
diff -u -p -r1.96 tab.c
--- wine/dlls/comctl32/tab.c	19 Aug 2004 19:06:18 -0000	1.96
+++ wine/dlls/comctl32/tab.c	25 Aug 2004 03:02:58 -0000
@@ -112,7 +112,7 @@ typedef struct
 #define FLAT_BTN_SPACINGX       8
 #define DEFAULT_TAB_WIDTH       96
 
-#define TAB_GetInfoPtr(hwnd) ((TAB_INFO *)GetWindowLongA(hwnd,0))
+#define TAB_GetInfoPtr(hwnd) ((TAB_INFO *)GetWindowLongPtrW(hwnd,0))
 
 /******************************************************************************
  * Hot-tracking timer constants
@@ -136,7 +136,7 @@ TAB_SendSimpleNotify (HWND hwnd, UINT co
     NMHDR nmhdr;
 
     nmhdr.hwndFrom = hwnd;
-    nmhdr.idFrom = GetWindowLongA(hwnd, GWL_ID);
+    nmhdr.idFrom = GetWindowLongPtrW(hwnd, GWLP_ID);
     nmhdr.code = code;
 
     return (BOOL) SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
@@ -1648,7 +1648,7 @@ TAB_DrawItemInterior
     /*
      * get the control id
      */
-    id = GetWindowLongA( hwnd, GWL_ID );
+    id = (UINT)GetWindowLongPtrW( hwnd, GWLP_ID );
 
     /*
      * put together the DRAWITEMSTRUCT
@@ -3130,12 +3130,12 @@ TAB_Create (HWND hwnd, WPARAM wParam, LP
       NMTOOLTIPSCREATED nmttc;
 
       nmttc.hdr.hwndFrom = hwnd;
-      nmttc.hdr.idFrom = GetWindowLongA(hwnd, GWL_ID);
+      nmttc.hdr.idFrom = GetWindowLongPtrW(hwnd, GWLP_ID);
       nmttc.hdr.code = NM_TOOLTIPSCREATED;
       nmttc.hwndToolTips = infoPtr->hwndToolTip;
 
       SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
-		    (WPARAM)GetWindowLongA(hwnd, GWL_ID), (LPARAM)&nmttc);
+		    (WPARAM)GetWindowLongPtrW(hwnd, GWLP_ID), (LPARAM)&nmttc);
     }
   }
 
Index: wine/dlls/comctl32/tooltips.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/tooltips.c,v
retrieving revision 1.67
diff -u -p -r1.67 tooltips.c
--- wine/dlls/comctl32/tooltips.c	19 Aug 2004 19:13:08 -0000	1.67
+++ wine/dlls/comctl32/tooltips.c	25 Aug 2004 03:03:00 -0000
@@ -129,7 +129,7 @@ typedef struct
 #define ID_TIMERLEAVE  3    /* tool leave timer */
 
 
-#define TOOLTIPS_GetInfoPtr(hWindow) ((TOOLTIPS_INFO *)GetWindowLongA (hWindow, 0))
+#define TOOLTIPS_GetInfoPtr(hWindow) ((TOOLTIPS_INFO *)GetWindowLongPtrW (hWindow, 0))
 
 /* offsets from window edge to start of text */
 #define NORMAL_TEXT_MARGIN 2
@@ -2138,7 +2138,7 @@ TOOLTIPS_Create (HWND hwnd, const CREATE
 
     /* allocate memory for info structure */
     infoPtr = (TOOLTIPS_INFO *)Alloc (sizeof(TOOLTIPS_INFO));
-    SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
+    SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
 
     /* initialize info structure */
     infoPtr->bActive = TRUE;
@@ -2201,7 +2201,7 @@ TOOLTIPS_Destroy (HWND hwnd, WPARAM wPar
 
     /* free tool tips info data */
     Free (infoPtr);
-    SetWindowLongA(hwnd, 0, 0);
+    SetWindowLongPtrW(hwnd, 0, 0);
     return 0;
 }
 
Index: wine/dlls/comctl32/trackbar.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/trackbar.c,v
retrieving revision 1.59
diff -u -p -r1.59 trackbar.c
--- wine/dlls/comctl32/trackbar.c	20 Apr 2004 01:12:18 -0000	1.59
+++ wine/dlls/comctl32/trackbar.c	25 Aug 2004 03:03:00 -0000
@@ -112,7 +112,7 @@ static LRESULT notify_hdr(TRACKBAR_INFO 
     TRACE("(code=%d)\n", code);
 
     pnmh->hwndFrom = infoPtr->hwndSelf;
-    pnmh->idFrom = GetWindowLongW(infoPtr->hwndSelf, GWL_ID);
+    pnmh->idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
     pnmh->code = code;
     result = SendMessageW(infoPtr->hwndNotify, WM_NOTIFY,
 			  (WPARAM)pnmh->idFrom, (LPARAM)pnmh);
@@ -809,7 +809,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr
 
     ZeroMemory(&nmcd, sizeof(nmcd));
     nmcd.hdr.hwndFrom = infoPtr->hwndSelf;
-    nmcd.hdr.idFrom = GetWindowLongW (infoPtr->hwndSelf, GWL_ID);
+    nmcd.hdr.idFrom = GetWindowLongPtrW (infoPtr->hwndSelf, GWLP_ID);
     nmcd.hdr.code = NM_CUSTOMDRAW;
     nmcd.hdc = hdc;
 
@@ -1339,7 +1339,7 @@ TRACKBAR_Create (HWND hwnd, LPCREATESTRU
 
     infoPtr = (TRACKBAR_INFO *)Alloc (sizeof(TRACKBAR_INFO));
     if (!infoPtr) return -1;
-    SetWindowLongW (hwnd, 0, (DWORD)infoPtr);
+    SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
 
     /* set default values */
     infoPtr->hwndSelf  = hwnd;
@@ -1401,7 +1401,7 @@ TRACKBAR_Destroy (TRACKBAR_INFO *infoPtr
     	DestroyWindow (infoPtr->hwndToolTip);
 
     Free (infoPtr);
-    SetWindowLongW (infoPtr->hwndSelf, 0, 0);
+    SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
     return 0;
 }
 
@@ -1635,7 +1635,7 @@ TRACKBAR_KeyUp (TRACKBAR_INFO *infoPtr, 
 static LRESULT WINAPI
 TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
-    TRACKBAR_INFO *infoPtr = (TRACKBAR_INFO *)GetWindowLongW (hwnd, 0);
+    TRACKBAR_INFO *infoPtr = (TRACKBAR_INFO *)GetWindowLongPtrW (hwnd, 0);
 
     TRACE("hwnd=%p msg=%x wparam=%x lparam=%lx\n", hwnd, uMsg, wParam, lParam);
 
Index: wine/dlls/comctl32/treeview.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/treeview.c,v
retrieving revision 1.148
diff -u -p -r1.148 treeview.c
--- wine/dlls/comctl32/treeview.c	2 May 2004 04:20:06 -0000	1.148
+++ wine/dlls/comctl32/treeview.c	25 Aug 2004 03:03:02 -0000
@@ -225,7 +225,7 @@ static void TREEVIEW_VerifyTree(TREEVIEW
 static TREEVIEW_INFO *
 TREEVIEW_GetInfoPtr(HWND hwnd)
 {
-    return (TREEVIEW_INFO *)GetWindowLongW(hwnd, 0);
+    return (TREEVIEW_INFO *)GetWindowLongPtrW(hwnd, 0);
 }
 
 /* Don't call this. Nothing wants an item index. */
@@ -458,7 +458,7 @@ TREEVIEW_SendSimpleNotify(TREEVIEW_INFO 
 
     TRACE("%d\n", code);
     nmhdr.hwndFrom = hwnd;
-    nmhdr.idFrom = GetWindowLongW(hwnd, GWL_ID);
+    nmhdr.idFrom = GetWindowLongPtrW(hwnd, GWLP_ID);
     nmhdr.code = get_notifycode(infoPtr, code);
 
     return (BOOL)TREEVIEW_SendRealNotify(infoPtr,
@@ -513,7 +513,7 @@ TREEVIEW_SendTreeviewNotify(TREEVIEW_INF
     ZeroMemory(&nmhdr, sizeof(NMTREEVIEWA));
 
     nmhdr.hdr.hwndFrom = hwnd;
-    nmhdr.hdr.idFrom = GetWindowLongW(hwnd, GWL_ID);
+    nmhdr.hdr.idFrom = GetWindowLongPtrW(hwnd, GWLP_ID);
     nmhdr.hdr.code = get_notifycode(infoPtr, code);
     nmhdr.action = action;
 
@@ -547,7 +547,7 @@ TREEVIEW_SendTreeviewDnDNotify(TREEVIEW_
     TRACE("code:%d dragitem:%p\n", code, dragItem);
 
     nmhdr.hdr.hwndFrom = hwnd;
-    nmhdr.hdr.idFrom = GetWindowLongW(hwnd, GWL_ID);
+    nmhdr.hdr.idFrom = GetWindowLongPtrW(hwnd, GWLP_ID);
     nmhdr.hdr.code = get_notifycode(infoPtr, code);
     nmhdr.action = 0;
     nmhdr.itemNew.mask = TVIF_STATE | TVIF_PARAM | TVIF_HANDLE;
@@ -576,7 +576,7 @@ TREEVIEW_SendCustomDrawNotify(TREEVIEW_I
 
     nmcd = &nmcdhdr.nmcd;
     nmcd->hdr.hwndFrom = hwnd;
-    nmcd->hdr.idFrom = GetWindowLongW(hwnd, GWL_ID);
+    nmcd->hdr.idFrom = GetWindowLongPtrW(hwnd, GWLP_ID);
     nmcd->hdr.code = NM_CUSTOMDRAW;
     nmcd->dwDrawStage = dwDrawStage;
     nmcd->hdc = hdc;
@@ -620,7 +620,7 @@ TREEVIEW_SendCustomDrawItemNotify(TREEVI
 
     nmcd = &nmcdhdr.nmcd;
     nmcd->hdr.hwndFrom = hwnd;
-    nmcd->hdr.idFrom = GetWindowLongW(hwnd, GWL_ID);
+    nmcd->hdr.idFrom = GetWindowLongPtrW(hwnd, GWLP_ID);
     nmcd->hdr.code = NM_CUSTOMDRAW;
     nmcd->dwDrawStage = dwDrawStage;
     nmcd->hdc = hdc;
@@ -653,7 +653,7 @@ TREEVIEW_BeginLabelEditNotify(TREEVIEW_I
     BOOL ret;
 
     tvdi.hdr.hwndFrom = hwnd;
-    tvdi.hdr.idFrom = GetWindowLongW(hwnd, GWL_ID);
+    tvdi.hdr.idFrom = GetWindowLongPtrW(hwnd, GWLP_ID);
     tvdi.hdr.code = get_notifycode(infoPtr, TVN_BEGINLABELEDITW);
 
     TREEVIEW_TVItemFromItem(infoPtr, TVIF_HANDLE | TVIF_STATE | TVIF_PARAM | TVIF_TEXT,
@@ -680,7 +680,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *i
     if (mask == 0) return;
 
     callback.hdr.hwndFrom         = hwnd;
-    callback.hdr.idFrom           = GetWindowLongW(hwnd, GWL_ID);
+    callback.hdr.idFrom           = GetWindowLongPtrW(hwnd, GWLP_ID);
     callback.hdr.code             = get_notifycode(infoPtr, TVN_GETDISPINFOW);
 
     /* 'state' always contains valid value, as well as 'lParam'.
@@ -3463,7 +3463,7 @@ TREEVIEW_EditLabel(TREEVIEW_INFO *infoPt
     HWND hwndEdit;
     SIZE sz;
     TREEVIEW_ITEM *editItem = hItem;
-    HINSTANCE hinst = (HINSTANCE)GetWindowLongW(hwnd, GWL_HINSTANCE);
+    HINSTANCE hinst = (HINSTANCE)GetWindowLongPtrW(hwnd, GWLP_HINSTANCE);
     HDC hdc;
     HFONT hOldFont=0;
     TEXTMETRICW textMetric;
@@ -3530,8 +3530,8 @@ TREEVIEW_EditLabel(TREEVIEW_INFO *infoPt
     SendMessageW(hwndEdit, WM_SETFONT,
 		 (WPARAM)TREEVIEW_FontForItem(infoPtr, editItem), FALSE);
 
-    infoPtr->wpEditOrig = (WNDPROC)SetWindowLongW(hwndEdit, GWL_WNDPROC,
-						  (DWORD)
+    infoPtr->wpEditOrig = (WNDPROC)SetWindowLongPtrW(hwndEdit, GWLP_WNDPROC,
+						  (DWORD_PTR)
 						  TREEVIEW_Edit_SubclassProc);
 
     if (TREEVIEW_BeginLabelEditNotify(infoPtr, editItem))
@@ -3566,7 +3566,7 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *
 	return FALSE;
 
     tvdi.hdr.hwndFrom = hwnd;
-    tvdi.hdr.idFrom = GetWindowLongW(hwnd, GWL_ID);
+    tvdi.hdr.idFrom = GetWindowLongPtrW(hwnd, GWLP_ID);
     tvdi.hdr.code = get_notifycode(infoPtr, TVN_ENDLABELEDITW);
     tvdi.item.mask = 0;
     tvdi.item.hItem = editedItem;
@@ -4190,7 +4190,7 @@ static INT TREEVIEW_ProcessLetterKeys(
     if (!hwnd || !charCode || !keyData)
         return 0;
 
-    infoPtr=(TREEVIEW_INFO*)GetWindowLongW(hwnd, 0);
+    infoPtr=(TREEVIEW_INFO*)GetWindowLongPtrW(hwnd, 0);
     if (!infoPtr)
         return 0;
 
@@ -4647,7 +4647,7 @@ TREEVIEW_Create(HWND hwnd, const CREATES
 	return 0;
     }
 
-    SetWindowLongW(hwnd, 0, (DWORD)infoPtr);
+    SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr);
 
     infoPtr->hwnd = hwnd;
     infoPtr->dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
@@ -4785,11 +4785,11 @@ TREEVIEW_Destroy(TREEVIEW_INFO *infoPtr)
 
     /* Restore original wndproc */
     if (infoPtr->hwndEdit)
-	SetWindowLongW(infoPtr->hwndEdit, GWL_WNDPROC,
-		       (LONG)infoPtr->wpEditOrig);
+	SetWindowLongPtrW(infoPtr->hwndEdit, GWLP_WNDPROC,
+		       (DWORD_PTR)infoPtr->wpEditOrig);
 
     /* Deassociate treeview from the window before doing anything drastic. */
-    SetWindowLongW(infoPtr->hwnd, 0, (LONG)NULL);
+    SetWindowLongPtrW(infoPtr->hwnd, 0, (DWORD_PTR)NULL);
 
     DeleteObject(infoPtr->hBoldFont);
     Free(infoPtr);
Index: wine/dlls/comctl32/updown.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/updown.c,v
retrieving revision 1.58
diff -u -p -r1.58 updown.c
--- wine/dlls/comctl32/updown.c	15 Mar 2004 20:20:41 -0000	1.58
+++ wine/dlls/comctl32/updown.c	25 Aug 2004 03:03:02 -0000
@@ -95,7 +95,7 @@ typedef struct
 #define BUDDY_UPDOWN_HWND        "buddyUpDownHWND"
 #define BUDDY_SUPERCLASS_WNDPROC "buddySupperClassWndProc"
 
-#define UPDOWN_GetInfoPtr(hwnd) ((UPDOWN_INFO *)GetWindowLongA (hwnd,0))
+#define UPDOWN_GetInfoPtr(hwnd) ((UPDOWN_INFO *)GetWindowLongPtrW (hwnd,0))
 #define COUNT_OF(a) (sizeof(a)/sizeof(a[0]))
 
 static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action);
@@ -491,7 +491,7 @@ static HWND UPDOWN_SetBuddy (UPDOWN_INFO
                when we reset the upDown ctrl buddy to another buddy because it is not
                good to break the window proc chain. */
             if (!GetPropA(bud, BUDDY_SUPERCLASS_WNDPROC)) {
-                baseWndProc = (WNDPROC)SetWindowLongW(bud, GWL_WNDPROC, (LPARAM)UPDOWN_Buddy_SubclassProc);
+                baseWndProc = (WNDPROC)SetWindowLongPtrW(bud, GWLP_WNDPROC, (LPARAM)UPDOWN_Buddy_SubclassProc);
                 SetPropA(bud, BUDDY_SUPERCLASS_WNDPROC, (HANDLE)baseWndProc);
             }
         }
@@ -572,7 +572,7 @@ static void UPDOWN_DoAction (UPDOWN_INFO
     ni.iPos = infoPtr->CurVal;
     ni.iDelta = delta;
     ni.hdr.hwndFrom = infoPtr->Self;
-    ni.hdr.idFrom   = GetWindowLongW (infoPtr->Self, GWL_ID);
+    ni.hdr.idFrom   = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
     ni.hdr.code = UDN_DELTAPOS;
     if (!SendMessageW(infoPtr->Notify, WM_NOTIFY, (WPARAM)ni.hdr.idFrom, (LPARAM)&ni)) {
         /* Parent said: OK to adjust */
@@ -623,7 +623,7 @@ static BOOL UPDOWN_CancelMode (UPDOWN_IN
     if (GetCapture() == infoPtr->Self) {
 	NMHDR hdr;
 	hdr.hwndFrom = infoPtr->Self;
-	hdr.idFrom   = GetWindowLongW (infoPtr->Self, GWL_ID);
+	hdr.idFrom   = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
 	hdr.code = NM_RELEASEDCAPTURE;
 	SendMessageW(infoPtr->Notify, WM_NOTIFY, hdr.idFrom, (LPARAM)&hdr);
 	ReleaseCapture();
@@ -725,7 +725,7 @@ static LRESULT WINAPI UpDownWindowProc(H
         case WM_CREATE:
             SetWindowLongW (hwnd, GWL_STYLE, dwStyle & ~WS_BORDER);
             infoPtr = (UPDOWN_INFO*)Alloc (sizeof(UPDOWN_INFO));
-	    SetWindowLongW (hwnd, 0, (DWORD)infoPtr);
+	    SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
 
 	    /* initialize the info struct */
 	    infoPtr->Self = hwnd;
@@ -753,7 +753,7 @@ static LRESULT WINAPI UpDownWindowProc(H
 	    if(infoPtr->Buddy) RemovePropA(infoPtr->Buddy, BUDDY_UPDOWN_HWND);
 
 	    Free (infoPtr);
-	    SetWindowLongW (hwnd, 0, 0);
+	    SetWindowLongPtrW (hwnd, 0, 0);
 	    TRACE("UpDown Ctrl destruction, hwnd=%p\n", hwnd);
 	    break;
 


More information about the wine-patches mailing list