Alexandre Julliard : user32: Pre-allocate the window procedure for the combobox class.

Alexandre Julliard julliard at winehq.org
Thu Dec 17 10:37:10 CST 2009


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Dec 17 12:57:22 2009 +0100

user32: Pre-allocate the window procedure for the combobox class.

---

 dlls/user32/combo.c    |   30 ++++--------------------------
 dlls/user32/controls.h |    1 +
 dlls/user32/winproc.c  |   13 +++++++++++++
 3 files changed, 18 insertions(+), 26 deletions(-)

diff --git a/dlls/user32/combo.c b/dlls/user32/combo.c
index c405c1a..948c6a7 100644
--- a/dlls/user32/combo.c
+++ b/dlls/user32/combo.c
@@ -86,9 +86,6 @@ static UINT	CBitHeight, CBitWidth;
 #define COMBO_EDITBUTTONSPACE()  0
 #define EDIT_CONTROL_PADDING()   1
 
-static LRESULT WINAPI ComboWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
-static LRESULT WINAPI ComboWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
-
 /*********************************************************************
  * combo class descriptor
  */
@@ -97,8 +94,8 @@ const struct builtin_class_descr COMBO_builtin_class =
 {
     comboboxW,            /* name */
     CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW, /* style  */
-    ComboWndProcA,        /* procA */
-    ComboWndProcW,        /* procW */
+    NULL,                 /* procA */
+    BUILTIN_WINPROC(WINPROC_COMBO), /* procW */
     sizeof(HEADCOMBO *),  /* extra */
     IDC_ARROW,            /* cursor */
     0                     /* brush */
@@ -1839,6 +1836,8 @@ LRESULT ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar
       TRACE("[%p]: msg %s wp %08lx lp %08lx\n",
             hwnd, SPY_GetMsgName(message, hwnd), wParam, lParam );
 
+      if (!IsWindow(hwnd)) return 0;
+
       if( lphc || message == WM_NCCREATE )
       switch(message)
       {
@@ -2219,27 +2218,6 @@ LRESULT ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar
                        DefWindowProcA(hwnd, message, wParam, lParam);
 }
 
-/***********************************************************************
- *           ComboWndProcA
- *
- * This is just a wrapper for the real ComboWndProc which locks/unlocks
- * window structs.
- */
-static LRESULT WINAPI ComboWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
-{
-    if (!IsWindow(hwnd)) return 0;
-    return wow_handlers.combo_proc( hwnd, message, wParam, lParam, FALSE );
-}
-
-/***********************************************************************
- *           ComboWndProcW
- */
-static LRESULT WINAPI ComboWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
-{
-    if (!IsWindow(hwnd)) return 0;
-    return wow_handlers.combo_proc( hwnd, message, wParam, lParam, TRUE );
-}
-
 /*************************************************************************
  *           GetComboBoxInfo   (USER32.@)
  */
diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h
index 501520f..76c714c 100644
--- a/dlls/user32/controls.h
+++ b/dlls/user32/controls.h
@@ -34,6 +34,7 @@
 enum builtin_winprocs
 {
     WINPROC_BUTTON = 0,
+    WINPROC_COMBO,
     NB_BUILTIN_WINPROCS
 };
 
diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c
index dd3e234..32b94b4 100644
--- a/dlls/user32/winproc.c
+++ b/dlls/user32/winproc.c
@@ -53,10 +53,13 @@ WNDPROC EDIT_winproc_handle = 0;
 
 static LRESULT WINAPI ButtonWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
 static LRESULT WINAPI ButtonWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+static LRESULT WINAPI ComboWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+static LRESULT WINAPI ComboWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
 
 static WINDOWPROC winproc_array[MAX_WINPROCS] =
 {
     { ButtonWndProcA, ButtonWndProcW },  /* WINPROC_BUTTON */
+    { ComboWndProcA, ComboWndProcW },    /* WINPROC_COMBO */
 };
 
 static UINT builtin_used = NB_BUILTIN_WINPROCS;
@@ -1052,6 +1055,16 @@ static LRESULT WINAPI ButtonWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM
     return wow_handlers.button_proc( hwnd, msg, wParam, lParam, TRUE );
 }
 
+static LRESULT WINAPI ComboWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
+{
+    return wow_handlers.combo_proc( hwnd, message, wParam, lParam, FALSE );
+}
+
+static LRESULT WINAPI ComboWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
+{
+    return wow_handlers.combo_proc( hwnd, message, wParam, lParam, TRUE );
+}
+
 
 /**********************************************************************
  *		UserRegisterWowHandlers (USER32.@)




More information about the wine-cvs mailing list