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

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


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

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

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

---

 dlls/user32/controls.h |    1 +
 dlls/user32/listbox.c  |   27 ++++-----------------------
 dlls/user32/winproc.c  |   13 +++++++++++++
 3 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h
index 8325d8d..d5760d6 100644
--- a/dlls/user32/controls.h
+++ b/dlls/user32/controls.h
@@ -36,6 +36,7 @@ enum builtin_winprocs
     WINPROC_BUTTON = 0,
     WINPROC_COMBO,
     WINPROC_EDIT,
+    WINPROC_LISTBOX,
     NB_BUILTIN_WINPROCS
 };
 
diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c
index 50fc762..4bc9664 100644
--- a/dlls/user32/listbox.c
+++ b/dlls/user32/listbox.c
@@ -128,9 +128,6 @@ typedef enum
 
 static TIMER_DIRECTION LISTBOX_Timer = LB_TIMER_NONE;
 
-static LRESULT WINAPI ListBoxWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
-static LRESULT WINAPI ListBoxWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
-
 static LRESULT LISTBOX_GetItemRect( const LB_DESCR *descr, INT index, RECT *rect );
 
 /*********************************************************************
@@ -141,8 +138,8 @@ const struct builtin_class_descr LISTBOX_builtin_class =
 {
     listboxW,             /* name */
     CS_DBLCLKS /*| CS_PARENTDC*/,  /* style */
-    ListBoxWndProcA,      /* procA */
-    ListBoxWndProcW,      /* procW */
+    NULL,                 /* procA */
+    BUILTIN_WINPROC(WINPROC_LISTBOX), /* procW */
     sizeof(LB_DESCR *),   /* extra */
     IDC_ARROW,            /* cursor */
     0                     /* brush */
@@ -157,8 +154,8 @@ const struct builtin_class_descr COMBOLBOX_builtin_class =
 {
     combolboxW,           /* name */
     CS_DBLCLKS | CS_SAVEBITS,  /* style */
-    ListBoxWndProcA,      /* procA */
-    ListBoxWndProcW,      /* procW */
+    NULL,                 /* procA */
+    BUILTIN_WINPROC(WINPROC_LISTBOX), /* procW */
     sizeof(LB_DESCR *),   /* extra */
     IDC_ARROW,            /* cursor */
     0                     /* brush */
@@ -3179,19 +3176,3 @@ LRESULT ListBoxWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
     return unicode ? DefWindowProcW( hwnd, msg, wParam, lParam ) :
                      DefWindowProcA( hwnd, msg, wParam, lParam );
 }
-
-/***********************************************************************
- *           ListBoxWndProcA
- */
-static LRESULT WINAPI ListBoxWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
-{
-    return wow_handlers.listbox_proc( hwnd, msg, wParam, lParam, FALSE );
-}
-
-/***********************************************************************
- *           ListBoxWndProcW
- */
-static LRESULT WINAPI ListBoxWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
-{
-    return wow_handlers.listbox_proc( hwnd, msg, wParam, lParam, TRUE );
-}
diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c
index d0b4e90..96c4749 100644
--- a/dlls/user32/winproc.c
+++ b/dlls/user32/winproc.c
@@ -55,12 +55,15 @@ static LRESULT WINAPI ComboWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM
 static LRESULT WINAPI ComboWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
 LRESULT WINAPI EditWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
 static LRESULT WINAPI EditWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+static LRESULT WINAPI ListBoxWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+static LRESULT WINAPI ListBoxWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
 
 static WINDOWPROC winproc_array[MAX_WINPROCS] =
 {
     { ButtonWndProcA, ButtonWndProcW },  /* WINPROC_BUTTON */
     { ComboWndProcA, ComboWndProcW },    /* WINPROC_COMBO */
     { EditWndProcA, EditWndProcW },      /* WINPROC_EDIT */
+    { ListBoxWndProcA, ListBoxWndProcW },/* WINPROC_LISTBOX */
 };
 
 static UINT builtin_used = NB_BUILTIN_WINPROCS;
@@ -1076,6 +1079,16 @@ static LRESULT WINAPI EditWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
     return wow_handlers.edit_proc( hwnd, msg, wParam, lParam, TRUE );
 }
 
+static LRESULT WINAPI ListBoxWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
+{
+    return wow_handlers.listbox_proc( hwnd, msg, wParam, lParam, FALSE );
+}
+
+static LRESULT WINAPI ListBoxWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
+{
+    return wow_handlers.listbox_proc( hwnd, msg, wParam, lParam, TRUE );
+}
+
 
 /**********************************************************************
  *		UserRegisterWowHandlers (USER32.@)




More information about the wine-cvs mailing list