Alexandre Julliard : user32: Turn the static winproc into a Wow handler.

Alexandre Julliard julliard at winehq.org
Tue Dec 15 09:40:20 CST 2009


Module: wine
Branch: master
Commit: 8649f73056d79a06159b5b5787f0e86b4e2ab69a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8649f73056d79a06159b5b5787f0e86b4e2ab69a

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Dec 15 13:19:53 2009 +0100

user32: Turn the static winproc into a Wow handler.

---

 dlls/user32/controls.h |    3 +++
 dlls/user32/msg16.c    |   19 +++++++++++++++++++
 dlls/user32/static.c   |   25 +++----------------------
 dlls/user32/winproc.c  |    2 ++
 4 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h
index 82036bf..036282b 100644
--- a/dlls/user32/controls.h
+++ b/dlls/user32/controls.h
@@ -66,6 +66,7 @@ struct wow_handlers16
     LRESULT (*edit_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
     LRESULT (*listbox_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
     LRESULT (*scrollbar_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
+    LRESULT (*static_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
 };
 
 struct wow_handlers32
@@ -75,6 +76,7 @@ struct wow_handlers32
     LRESULT (*edit_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
     LRESULT (*listbox_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
     LRESULT (*scrollbar_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
+    LRESULT (*static_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
 };
 
 extern struct wow_handlers16 wow_handlers DECLSPEC_HIDDEN;
@@ -84,6 +86,7 @@ extern LRESULT ComboWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN
 extern LRESULT EditWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
 extern LRESULT ListBoxWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
 extern LRESULT ScrollBarWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
+extern LRESULT StaticWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
 
 extern void register_wow_handlers(void) DECLSPEC_HIDDEN;
 extern void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new,
diff --git a/dlls/user32/msg16.c b/dlls/user32/msg16.c
index 239e8e5..7ccf049 100644
--- a/dlls/user32/msg16.c
+++ b/dlls/user32/msg16.c
@@ -1191,6 +1191,24 @@ static LRESULT scrollbar_proc16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
 }
 
 
+/***********************************************************************
+ *           static_proc16
+ */
+static LRESULT static_proc16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode )
+{
+    switch (msg)
+    {
+    case STM_SETICON16:
+        wParam = (WPARAM)HICON_32( (HICON16)wParam );
+        return wow_handlers32.static_proc( hwnd, STM_SETICON, wParam, lParam, FALSE );
+    case STM_GETICON16:
+        return HICON_16( wow_handlers32.static_proc( hwnd, STM_GETICON, wParam, lParam, FALSE ));
+    default:
+        return wow_handlers32.static_proc( hwnd, msg, wParam, lParam, unicode );
+    }
+}
+
+
 void register_wow_handlers(void)
 {
     static const struct wow_handlers16 handlers16 =
@@ -1200,6 +1218,7 @@ void register_wow_handlers(void)
         edit_proc16,
         listbox_proc16,
         scrollbar_proc16,
+        static_proc16,
     };
 
     UserRegisterWowHandlers( &handlers16, &wow_handlers32 );
diff --git a/dlls/user32/static.c b/dlls/user32/static.c
index 80c502d..b33033a 100644
--- a/dlls/user32/static.c
+++ b/dlls/user32/static.c
@@ -47,7 +47,6 @@
 #include "windef.h"
 #include "winbase.h"
 #include "wingdi.h"
-#include "wine/winuser16.h"
 #include "controls.h"
 #include "user_private.h"
 #include "wine/debug.h"
@@ -400,8 +399,7 @@ static BOOL hasTextStyle( DWORD style )
 /***********************************************************************
  *           StaticWndProc_common
  */
-static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
-                                     LPARAM lParam, BOOL unicode )
+LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode )
 {
     LRESULT lResult = 0;
     LONG full_style = GetWindowLongW( hwnd, GWL_STYLE );
@@ -607,29 +605,12 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
 }
 
 /***********************************************************************
- *           StaticWndProc_wrapper16
- */
-static LRESULT StaticWndProc_wrapper16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode )
-{
-    switch (msg)
-    {
-    case STM_SETICON16:
-        wParam = (WPARAM)HICON_32( (HICON16)wParam );
-        return StaticWndProc_common( hwnd, STM_SETICON, wParam, lParam, FALSE );
-    case STM_GETICON16:
-        return HICON_16( StaticWndProc_common( hwnd, STM_GETICON, wParam, lParam, FALSE ));
-    default:
-        return StaticWndProc_common( hwnd, msg, wParam, lParam, unicode );
-    }
-}
-
-/***********************************************************************
  *           StaticWndProcA
  */
 static LRESULT WINAPI StaticWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
 {
     if (!IsWindow( hWnd )) return 0;
-    return StaticWndProc_wrapper16(hWnd, uMsg, wParam, lParam, FALSE);
+    return wow_handlers.static_proc(hWnd, uMsg, wParam, lParam, FALSE);
 }
 
 /***********************************************************************
@@ -638,7 +619,7 @@ static LRESULT WINAPI StaticWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
 static LRESULT WINAPI StaticWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
 {
     if (!IsWindow( hWnd )) return 0;
-    return StaticWndProc_wrapper16(hWnd, uMsg, wParam, lParam, TRUE);
+    return wow_handlers.static_proc(hWnd, uMsg, wParam, lParam, TRUE);
 }
 
 static void STATIC_PaintOwnerDrawfn( HWND hwnd, HDC hdc, DWORD style )
diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c
index d434961..67671c9 100644
--- a/dlls/user32/winproc.c
+++ b/dlls/user32/winproc.c
@@ -2393,6 +2393,7 @@ void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new, struct wo
     orig->edit_proc      = EditWndProc_common;
     orig->listbox_proc   = ListBoxWndProc_common;
     orig->scrollbar_proc = ScrollBarWndProc_common;
+    orig->static_proc    = StaticWndProc_common;
 
     wow_handlers = *new;
 }
@@ -2404,4 +2405,5 @@ struct wow_handlers16 wow_handlers =
     EditWndProc_common,
     ListBoxWndProc_common,
     ScrollBarWndProc_common,
+    StaticWndProc_common,
 };




More information about the wine-cvs mailing list