Re: Implement {G|S}etWindowLongPtr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> György 'Nog' Jeney a écrit :
>>
>> Apply this patch and observe nearly the whole wine recompile :)
>>
>> ChangLog:
>>  * include/winuser.h
>>  * win/win.c
>>    Implement {G|S}etWindowLongPtr
> I don't want to see a whole wine recompilation every day, so I think
> those defs
>
> #define     SetWindowLong WINELIB_NAME_AW(SetWindowLong)
> +LONG_PTR    WINAPI SetWindowLongA(HWND,INT,LONG_PTR);
> +LONG_PTR    WINAPI SetWindowLongW(HWND,INT,LONG_PTR);
> +#define     SetWindowLongPtr WINELIB_NAME_AW(SetWindowLongPtr)
>
> should be instead
> #define     SetWindowLong WINELIB_NAME_AW(SetWindowLong)
> +LONG_PTR    WINAPI SetWindowLongPtrA(HWND,INT,LONG_PTR);
> +LONG_PTR    WINAPI SetWindowLongPtrW(HWND,INT,LONG_PTR);
> +#define     SetWindowLongPtr WINELIB_NAME_AW(SetWindowLongPtr)
>
Yes they should.  Heres the updated patch.

ChangeLog
 * include/winuser.h
 * win/win.c
   Implement {G|S}etWindowLongPtr

nog.


Index: include/winuser.h
===================================================================
RCS file: /home/wine/wine/include/winuser.h,v
retrieving revision 1.142
diff -u -r1.142 winuser.h
--- include/winuser.h	28 Aug 2002 23:38:10 -0000	1.142
+++ include/winuser.h	29 Sep 2002 14:23:35 -0000
@@ -1346,6 +1346,16 @@
 #define DWL_DLGPROC	    4
 #define DWL_USER	    8
 
+  /* Offsets for GetWindowLongPtr() and SetWindowLongPtr() */
+#define GWLP_USERDATA        (-21)
+#define GWLP_ID              (-12)
+#define GWLP_HWNDPARENT      (-8)
+#define GWLP_HINSTANCE       (-6)
+#define GWLP_WNDPROC         (-4)
+#define DWLP_MSGRESULT       0
+#define DWLP_DLGPROC         DWLP_MSGRESULT + sizeof(LRESULT)
+#define DWLP_USER            DWLP_DLGPROC + sizeof(DLGPROC)
+
   /* GetWindow() constants */
 #define GW_HWNDFIRST	0
 #define GW_HWNDLAST	1
@@ -4114,6 +4124,9 @@
 LONG        WINAPI GetWindowLongA(HWND,INT);
 LONG        WINAPI GetWindowLongW(HWND,INT);
 #define     GetWindowLong WINELIB_NAME_AW(GetWindowLong)
+LONG_PTR    WINAPI GetWindowLongPtrA(HWND,INT);
+LONG_PTR    WINAPI GetWindowLongPtrW(HWND,INT);
+#define     GetWindowLongPtr WINELIB_NAME_AW(GetWindowLongPtr)
 BOOL        WINAPI GetWindowPlacement(HWND,LPWINDOWPLACEMENT);
 BOOL        WINAPI GetWindowRect(HWND,LPRECT);
 INT         WINAPI GetWindowRgn(HWND,HRGN);
@@ -4326,6 +4339,9 @@
 LONG        WINAPI SetWindowLongA(HWND,INT,LONG);
 LONG        WINAPI SetWindowLongW(HWND,INT,LONG);
 #define     SetWindowLong WINELIB_NAME_AW(SetWindowLong)
+LONG_PTR    WINAPI SetWindowLongPtrA(HWND,INT,LONG_PTR);
+LONG_PTR    WINAPI SetWindowLongPtrW(HWND,INT,LONG_PTR);
+#define     SetWindowLongPtr WINELIB_NAME_AW(SetWindowLongPtr)
 BOOL      WINAPI SetWindowPlacement(HWND,const WINDOWPLACEMENT*);
 HHOOK       WINAPI SetWindowsHookA(INT,HOOKPROC);
 HHOOK       WINAPI SetWindowsHookW(INT,HOOKPROC);
Index: windows/win.c
===================================================================
RCS file: /home/wine/wine/windows/win.c,v
retrieving revision 1.192
diff -u -r1.192 win.c
--- windows/win.c	25 Sep 2002 03:25:43 -0000	1.192
+++ windows/win.c	29 Sep 2002 14:24:14 -0000
@@ -2180,6 +2182,24 @@
 
 
 /**********************************************************************
+ *              GetWindowLongPtrA (USER32.@)
+ */
+LONG_PTR WINAPI GetWindowLongPtrA( HWND hwnd, INT offset )
+{
+    return WIN_GetWindowLong( hwnd, offset, WIN_PROC_32A );
+}
+
+
+/**********************************************************************
+ *              GetWindowLongPtrW (USER32.@)
+ */
+LONG_PTR WINAPI GetWindowLongPtrW( HWND hwnd, INT offset )
+{
+    return WIN_GetWindowLong( hwnd, offset, WIN_PROC_32W );
+}
+
+
+/**********************************************************************
  *		SetWindowLong (USER.136)
  */
 LONG WINAPI SetWindowLong16( HWND16 hwnd, INT16 offset, LONG newval )
@@ -2268,6 +2288,24 @@
     INT offset, /* [in] offset, in bytes, of location to alter */
     LONG newval /* [in] new value of location */
 ) {
+    return WIN_SetWindowLong( hwnd, offset, newval, WIN_PROC_32W );
+}
+
+
+/**********************************************************************
+ *              SetWindowLongPtrA (USER32.@)
+ */
+LONG_PTR WINAPI SetWindowLongPtrA( HWND hwnd, INT offset, LONG_PTR newval )
+{
+    return WIN_SetWindowLong( hwnd, offset, newval, WIN_PROC_32A );
+}
+
+
+/**********************************************************************
+ *              SetWindowLongPtrW (USER32.@)
+ */
+LONG_PTR WINAPI SetWindowLongPtrW( HWND hwnd, INT offset, LONG_PTR newval )
+{
     return WIN_SetWindowLong( hwnd, offset, newval, WIN_PROC_32W );
 }
 


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux