Alexandre Julliard : user32: Simplify the window structure creation. Get rid of the unused clsStyle field.
Alexandre Julliard
julliard at winehq.org
Mon Feb 25 14:21:26 CST 2008
Module: wine
Branch: master
Commit: 4273a8ab868f90b2af34db25884f8ceb8ad5b30d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4273a8ab868f90b2af34db25884f8ceb8ad5b30d
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Feb 25 15:55:17 2008 +0100
user32: Simplify the window structure creation. Get rid of the unused clsStyle field.
---
dlls/user32/class.c | 12 +++---------
dlls/user32/controls.h | 2 +-
dlls/user32/win.c | 11 +++++------
include/win.h | 1 -
4 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/dlls/user32/class.c b/dlls/user32/class.c
index eee9c1d..94bc639 100644
--- a/dlls/user32/class.c
+++ b/dlls/user32/class.c
@@ -433,17 +433,11 @@ void CLASS_RegisterBuiltinClasses(void)
/***********************************************************************
- * CLASS_AddWindow
- *
- * Add a new window using this class, and set the necessary
- * information inside the window structure.
+ * get_class_winproc
*/
-void CLASS_AddWindow( CLASS *class, WND *win, BOOL unicode )
+WNDPROC get_class_winproc( CLASS *class )
{
- win->class = class;
- win->clsStyle = class->style;
- win->winproc = class->winproc;
- if (WINPROC_IsUnicode( win->winproc, unicode )) win->flags |= WIN_ISUNICODE;
+ return class->winproc;
}
diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h
index 812710c..ef56432 100644
--- a/dlls/user32/controls.h
+++ b/dlls/user32/controls.h
@@ -63,7 +63,7 @@ struct tagCLASS; /* opaque structure */
struct tagWND;
extern ATOM get_int_atom_value( LPCWSTR name ) DECLSPEC_HIDDEN;
extern void CLASS_RegisterBuiltinClasses(void) DECLSPEC_HIDDEN;
-extern void CLASS_AddWindow( struct tagCLASS *class, struct tagWND *win, BOOL unicode ) DECLSPEC_HIDDEN;
+extern WNDPROC get_class_winproc( struct tagCLASS *class ) DECLSPEC_HIDDEN;
extern void CLASS_FreeModuleClasses( HMODULE16 hModule ) DECLSPEC_HIDDEN;
/* defwnd proc */
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index 8e02a5d..f5fee96 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -133,7 +133,8 @@ static WND *create_window_handle( HWND parent, HWND owner, LPCWSTR name,
return NULL;
}
- if (!(win = HeapAlloc( GetProcessHeap(), 0, sizeof(WND) + extra_bytes - sizeof(win->wExtra) )))
+ if (!(win = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
+ sizeof(WND) + extra_bytes - sizeof(win->wExtra) )))
{
SERVER_START_REQ( destroy_window )
{
@@ -163,13 +164,11 @@ static WND *create_window_handle( HWND parent, HWND owner, LPCWSTR name,
win->hwndSelf = handle;
win->parent = full_parent;
win->owner = full_owner;
+ win->class = class;
+ win->winproc = get_class_winproc( class );
win->dwMagic = WND_MAGIC;
- win->flags = 0;
win->cbWndExtra = extra_bytes;
- SetRectEmpty( &win->rectWindow );
- SetRectEmpty( &win->rectClient );
- memset( win->wExtra, 0, extra_bytes );
- CLASS_AddWindow( class, win, unicode );
+ if (WINPROC_IsUnicode( win->winproc, unicode )) win->flags |= WIN_ISUNICODE;
return win;
}
diff --git a/include/win.h b/include/win.h
index ac6b753..baa8c6d 100644
--- a/include/win.h
+++ b/include/win.h
@@ -49,7 +49,6 @@ typedef struct tagWND
void *pHScroll; /* Horizontal scroll-bar info */
DWORD dwStyle; /* Window style (from CreateWindow) */
DWORD dwExStyle; /* Extended style (from CreateWindowEx) */
- DWORD clsStyle; /* Class style at window creation */
UINT_PTR wIDmenu; /* ID or hmenu (from CreateWindow) */
DWORD helpContext; /* Help context ID */
UINT flags; /* Misc. flags (see below) */
More information about the wine-cvs
mailing list