Module: wine Branch: master Commit: 0c4e151ee9b8a27d86857e51eeac47c5544c6581 URL: http://source.winehq.org/git/wine.git/?a=commit;h=0c4e151ee9b8a27d86857e51ee...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Dec 18 12:36:26 2009 +0100
user32: Pre-allocate the window procedure for the desktop class.
---
dlls/user32/controls.h | 8 +++++++- dlls/user32/desktop.c | 6 ++---- dlls/user32/winproc.c | 5 +++-- 3 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h index e7aa408..16ebe6d 100644 --- a/dlls/user32/controls.h +++ b/dlls/user32/controls.h @@ -33,6 +33,7 @@
enum builtin_winprocs { + /* dual A/W procs */ WINPROC_BUTTON = 0, WINPROC_COMBO, WINPROC_DEFWND, @@ -42,7 +43,10 @@ enum builtin_winprocs WINPROC_MDICLIENT, WINPROC_SCROLLBAR, WINPROC_STATIC, - NB_BUILTIN_WINPROCS + /* unicode-only procs */ + WINPROC_DESKTOP, + NB_BUILTIN_WINPROCS, + NB_BUILTIN_AW_WINPROCS = WINPROC_DESKTOP };
#define WINPROC_HANDLE (~0u >> 16) @@ -74,6 +78,8 @@ extern const struct builtin_class_descr MESSAGE_builtin_class DECLSPEC_HIDDEN; extern const struct builtin_class_descr SCROLL_builtin_class DECLSPEC_HIDDEN; extern const struct builtin_class_descr STATIC_builtin_class DECLSPEC_HIDDEN;
+extern LRESULT WINAPI DesktopWndProc(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN; + /* Wow handlers */
struct wow_handlers16 diff --git a/dlls/user32/desktop.c b/dlls/user32/desktop.c index a060aad..e29d72c 100644 --- a/dlls/user32/desktop.c +++ b/dlls/user32/desktop.c @@ -38,8 +38,6 @@ static HBITMAP hbitmapWallPaper; static SIZE bitmapSize; static BOOL fTileWallPaper;
-static LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam ); -
/********************************************************************* * desktop class descriptor @@ -49,7 +47,7 @@ const struct builtin_class_descr DESKTOP_builtin_class = (LPCWSTR)DESKTOP_CLASS_ATOM, /* name */ CS_DBLCLKS, /* style */ NULL, /* procA (winproc is Unicode only) */ - DesktopWndProc, /* procW */ + BUILTIN_WINPROC(WINPROC_DESKTOP), /* procW */ 0, /* extra */ IDC_ARROW, /* cursor */ (HBRUSH)(COLOR_BACKGROUND+1) /* brush */ @@ -115,7 +113,7 @@ static HBITMAP DESKTOP_LoadBitmap( HDC hdc, const char *filename ) /*********************************************************************** * DesktopWndProc */ -static LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam ) +LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam ) { if (message == WM_NCCREATE) return TRUE; return 0; /* all other messages are ignored */ diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index bd30b49..a5cbf32 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -74,6 +74,7 @@ static WINDOWPROC winproc_array[MAX_WINPROCS] = { MDIClientWndProcA, MDIClientWndProcW }, /* WINPROC_MDICLIENT */ { ScrollBarWndProcA, ScrollBarWndProcW }, /* WINPROC_SCROLLBAR */ { StaticWndProcA, StaticWndProcW }, /* WINPROC_STATIC */ + { NULL, DesktopWndProc }, /* WINPROC_DESKTOP */ };
static UINT winproc_used = NB_BUILTIN_WINPROCS; @@ -104,14 +105,14 @@ static inline WINDOWPROC *find_winproc( WNDPROC funcA, WNDPROC funcW ) { unsigned int i;
- for (i = 0; i < NB_BUILTIN_WINPROCS; i++) + for (i = 0; i < NB_BUILTIN_AW_WINPROCS; i++) { /* match either proc, some apps confuse A and W */ if (funcA && winproc_array[i].procA != funcA && winproc_array[i].procW != funcA) continue; if (funcW && winproc_array[i].procA != funcW && winproc_array[i].procW != funcW) continue; return &winproc_array[i]; } - for (i = NB_BUILTIN_WINPROCS; i < winproc_used; i++) + for (i = NB_BUILTIN_AW_WINPROCS; i < winproc_used; i++) { if (funcA && winproc_array[i].procA != funcA) continue; if (funcW && winproc_array[i].procW != funcW) continue;