Win64 patch 3/13

Ge van Geldorp ge at gse.nl
Mon Jun 19 13:03:35 CDT 2006


Changelog:
  Ge van Geldorp <ge at gse.nl>
  - Implement Get/SetWindowLongPtrA/W for Win64 (they are #defines in Win32)

Index: dlls/user/user_private.h
===================================================================
RCS file: /home/wine/wine/dlls/user/user_private.h,v
retrieving revision 1.20
diff -u -r1.20 user_private.h
--- dlls/user/user_private.h	10 Aug 2005 09:56:23 -0000	1.20
+++ dlls/user/user_private.h	19 Jun 2006 16:46:45 -0000
@@ -31,6 +31,8 @@
 #include "wine/windef16.h"
 #include "wine/winbase16.h"
 
+#include "winproc.h"
+
 extern WORD USER_HeapSel;
 
 static inline HLOCAL16 LOCAL_Alloc( HANDLE16 ds, UINT16 flags, WORD size )
@@ -281,4 +283,7 @@
 
 extern void CURSORICON_FreeModuleIcons( HMODULE16 hModule );
 
+LONG_PTR WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type );
+LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval, WINDOWPROCTYPE type );
+
 #endif /* __WINE_USER_PRIVATE_H */
Index: dlls/user/win.c
===================================================================
RCS file: /home/wine/wine/dlls/user/win.c,v
retrieving revision 1.29
diff -u -r1.29 win.c
--- dlls/user/win.c	7 Mar 2006 12:13:45 -0000	1.29
+++ dlls/user/win.c	19 Jun 2006 16:46:47 -0000
@@ -1827,7 +1827,7 @@
  *
  * Helper function for GetWindowLong().
  */
-static LONG_PTR WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type )
+LONG_PTR WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type )
 {
     LONG_PTR retvalue = 0;
     WND *wndPtr;
@@ -1941,8 +1941,8 @@
  * 0 is the failure code. However, in the case of failure SetLastError
  * must be set to distinguish between a 0 return value and a failure.
  */
-static LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval,
-                                   WINDOWPROCTYPE type )
+LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval,
+                            WINDOWPROCTYPE type )
 {
     STYLESTRUCT style;
     BOOL ok;
--- /dev/null	2006-06-19 18:35:16.644352750 +0200
+++ dlls/user/win64.c	2006-06-19 17:30:48.000000000 +0200
@@ -0,0 +1,70 @@
+/*
+ * Window related functions for Win64
+ *
+ * Copyright 2006 Ge van Geldorp <ge at gse.nl>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "config.h"
+#include "wine/port.h"
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "winproc.h"
+#include "wine/debug.h"
+#include "user_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(win);
+
+/**********************************************************************
+ *		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 );
+}
+
+
+/**********************************************************************
+ *		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 );
+}
--- dlls/user/Makefile.in.patch2	2006-06-19 18:43:24.000000000 +0200
+++ dlls/user/Makefile.in	2006-06-19 18:49:18.000000000 +0200
@@ -78,7 +78,8 @@
 	wnd16.c
 
 C_SRCS64 = \
-	class64.c
+	class64.c \
+	win64.c
 
 SPEC_SRC64 = user32_64.spec
 
--- dlls/user/user32_64.spec.patch2	2006-06-19 18:44:16.000000000 +0200
+++ dlls/user/user32_64.spec	2006-06-19 18:44:02.000000000 +0200
@@ -376,6 +376,8 @@
 @ stdcall GetWindowInfo(long ptr)
 @ stdcall GetWindowLongA(long long)
 @ stdcall GetWindowLongW(long long)
+@ stdcall GetWindowLongPtrA(long long)
+@ stdcall GetWindowLongPtrW(long long)
 # @ stub GetWindowModuleFileName
 @ stdcall GetWindowModuleFileNameA(long ptr long)
 @ stdcall GetWindowModuleFileNameW(long ptr long)



More information about the wine-patches mailing list