Commit 0c4e151e authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 14fdced3
......@@ -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
......
......@@ -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 */
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment