Alexandre Julliard : user32: Create the desktop window to trigger builtin class registration before accessing the class list .
Alexandre Julliard
julliard at winehq.org
Mon Oct 28 15:13:05 CDT 2013
Module: wine
Branch: master
Commit: 4c41c20e0227dfff62aebfc9b4d392121b4d28f3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4c41c20e0227dfff62aebfc9b4d392121b4d28f3
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Oct 28 15:24:58 2013 +0100
user32: Create the desktop window to trigger builtin class registration before accessing the class list.
---
dlls/user32/class.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/dlls/user32/class.c b/dlls/user32/class.c
index e03272f..fa340dc 100644
--- a/dlls/user32/class.c
+++ b/dlls/user32/class.c
@@ -268,6 +268,8 @@ static CLASS *CLASS_FindClass( LPCWSTR name, HINSTANCE hinstance )
struct list *ptr;
ATOM atom = get_int_atom_value( name );
+ GetDesktopWindow(); /* create the desktop window to trigger builtin class registration */
+
USER_Lock();
LIST_FOR_EACH( ptr, &class_list )
@@ -507,7 +509,7 @@ ATOM WINAPI RegisterClassExA( const WNDCLASSEXA* wc )
CLASS *classPtr;
HINSTANCE instance;
- InitOnceExecuteOnce( &init_once, register_builtins, NULL, NULL );
+ GetDesktopWindow(); /* create the desktop window to trigger builtin class registration */
if (wc->cbSize != sizeof(*wc) || wc->cbClsExtra < 0 || wc->cbWndExtra < 0 ||
wc->hInstance == user32_module) /* we can't register a class for user32 */
@@ -562,7 +564,7 @@ ATOM WINAPI RegisterClassExW( const WNDCLASSEXW* wc )
CLASS *classPtr;
HINSTANCE instance;
- InitOnceExecuteOnce( &init_once, register_builtins, NULL, NULL );
+ GetDesktopWindow(); /* create the desktop window to trigger builtin class registration */
if (wc->cbSize != sizeof(*wc) || wc->cbClsExtra < 0 || wc->cbWndExtra < 0 ||
wc->hInstance == user32_module) /* we can't register a class for user32 */
@@ -620,7 +622,7 @@ BOOL WINAPI UnregisterClassW( LPCWSTR className, HINSTANCE hInstance )
{
CLASS *classPtr = NULL;
- InitOnceExecuteOnce( &init_once, register_builtins, NULL, NULL );
+ GetDesktopWindow(); /* create the desktop window to trigger builtin class registration */
SERVER_START_REQ( destroy_class )
{
@@ -1122,8 +1124,6 @@ BOOL WINAPI GetClassInfoExA( HINSTANCE hInstance, LPCSTR name, WNDCLASSEXA *wc )
TRACE("%p %s %p\n", hInstance, debugstr_a(name), wc);
- InitOnceExecuteOnce( &init_once, register_builtins, NULL, NULL );
-
if (!wc)
{
SetLastError( ERROR_NOACCESS );
@@ -1175,8 +1175,6 @@ BOOL WINAPI GetClassInfoExW( HINSTANCE hInstance, LPCWSTR name, WNDCLASSEXW *wc
TRACE("%p %s %p\n", hInstance, debugstr_w(name), wc);
- InitOnceExecuteOnce( &init_once, register_builtins, NULL, NULL );
-
if (!wc)
{
SetLastError( ERROR_NOACCESS );
More information about the wine-cvs
mailing list