Alexandre Julliard : user32: Pre-allocate the window procedure for the menu class.
Alexandre Julliard
julliard at winehq.org
Fri Dec 18 10:49:09 CST 2009
Module: wine
Branch: master
Commit: e6f15c5886d734e965cd3f272e35de0081fd4401
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e6f15c5886d734e965cd3f272e35de0081fd4401
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Dec 18 12:37:58 2009 +0100
user32: Pre-allocate the window procedure for the menu class.
---
dlls/user32/controls.h | 2 ++
dlls/user32/menu.c | 6 ++----
dlls/user32/winproc.c | 1 +
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h
index 726ca72..6925f33 100644
--- a/dlls/user32/controls.h
+++ b/dlls/user32/controls.h
@@ -46,6 +46,7 @@ enum builtin_winprocs
/* unicode-only procs */
WINPROC_DESKTOP,
WINPROC_ICONTITLE,
+ WINPROC_MENU,
NB_BUILTIN_WINPROCS,
NB_BUILTIN_AW_WINPROCS = WINPROC_DESKTOP
};
@@ -81,6 +82,7 @@ extern const struct builtin_class_descr STATIC_builtin_class DECLSPEC_HIDDEN;
extern LRESULT WINAPI DesktopWndProc(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
extern LRESULT WINAPI IconTitleWndProc(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
+extern LRESULT WINAPI PopupMenuWndProc(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
/* Wow handlers */
diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
index 2f0ffc2..4e03651 100644
--- a/dlls/user32/menu.c
+++ b/dlls/user32/menu.c
@@ -183,8 +183,6 @@ static HMENU top_popup_hmenu;
/* Flag set by EndMenu() to force an exit from menu tracking */
static BOOL fEndMenu = FALSE;
-static LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
-
DWORD WINAPI DrawMenuBarTemp(HWND hwnd, HDC hDC, LPRECT lprect, HMENU hMenu, HFONT hFont);
static BOOL SetMenuItemInfo_common( MENUITEM *, const MENUITEMINFOW *, BOOL);
@@ -197,7 +195,7 @@ const struct builtin_class_descr MENU_builtin_class =
(LPCWSTR)POPUPMENU_CLASS_ATOM, /* name */
CS_DROPSHADOW | CS_SAVEBITS | CS_DBLCLKS, /* style */
NULL, /* procA (winproc is Unicode only) */
- PopupMenuWndProc, /* procW */
+ BUILTIN_WINPROC(WINPROC_MENU), /* procW */
sizeof(HMENU), /* extra */
IDC_ARROW, /* cursor */
(HBRUSH)(COLOR_MENU+1) /* brush */
@@ -3442,7 +3440,7 @@ BOOL WINAPI TrackPopupMenu( HMENU hMenu, UINT wFlags, INT x, INT y,
*
* NOTE: Windows has totally different (and undocumented) popup wndproc.
*/
-static LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
+LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
{
TRACE("hwnd=%p msg=0x%04x wp=0x%04lx lp=0x%08lx\n", hwnd, message, wParam, lParam);
diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c
index 0f9b6f2..15920a1 100644
--- a/dlls/user32/winproc.c
+++ b/dlls/user32/winproc.c
@@ -76,6 +76,7 @@ static WINDOWPROC winproc_array[MAX_WINPROCS] =
{ StaticWndProcA, StaticWndProcW }, /* WINPROC_STATIC */
{ NULL, DesktopWndProc }, /* WINPROC_DESKTOP */
{ NULL, IconTitleWndProc }, /* WINPROC_ICONTITLE */
+ { NULL, PopupMenuWndProc }, /* WINPROC_MENU */
};
static UINT winproc_used = NB_BUILTIN_WINPROCS;
More information about the wine-cvs
mailing list