From: Rémi Bernon rbernon@codeweavers.com
--- dlls/user32/tests/class.c | 104 +++++++++++++++++++------------------- dlls/win32u/class.c | 13 +++-- server/atom.c | 21 ++++++++ server/class.c | 3 +- server/protocol.def | 3 +- 5 files changed, 80 insertions(+), 64 deletions(-)
diff --git a/dlls/user32/tests/class.c b/dlls/user32/tests/class.c index e6c841857cf..38490ae2049 100644 --- a/dlls/user32/tests/class.c +++ b/dlls/user32/tests/class.c @@ -1659,9 +1659,9 @@ static void test_actctx_classes(void) check_class_info_a( hinst, wc.lpszClassName, NULL ); class = RegisterClassA( &wc_double_version ); ok( class != 0, "RegisterClassA failed, error %lu\n", GetLastError() ); - todo_wine check_atom_name_a( class, wc_double_version.lpszClassName ); + check_atom_name_a( class, wc_double_version.lpszClassName ); tmp_class = check_class_info_a( hinst, "4.3.2.1!4.3.2.1!ClassVersion", &wc_double_version ); - todo_wine check_atom_name_a( tmp_class, "4.3.2.1!ClassVersion" ); + check_atom_name_a( tmp_class, "4.3.2.1!ClassVersion" ); ret = UnregisterClassA( "4.3.2.1!4.3.2.1!ClassVersion", hinst ); ok( ret, "UnregisterClassA failed, error %lu\n", GetLastError() ); check_atom_name_a( class, NULL ); @@ -1677,13 +1677,13 @@ static void test_actctx_classes(void) check_class_info_a( hinst, wc.lpszClassName, NULL ); class = RegisterClassA( &wc ); ok( class != 0, "RegisterClassA failed, error %lu\n", GetLastError() ); - todo_wine check_atom_name_a( class, wc.lpszClassName ); + check_atom_name_a( class, wc.lpszClassName ); tmp_class = check_class_info_a( hinst, MAKEINTRESOURCEA( class ), &wc ); - todo_wine check_atom_name_a( tmp_class, wc.lpszClassName ); + check_atom_name_a( tmp_class, wc.lpszClassName ); ret = DeactivateActCtx( 0, cookie ); ok( ret, "DeactivateActCtx failed, error %lu\n", GetLastError() ); - todo_wine check_atom_name_a( class, wc.lpszClassName ); - todo_wine check_class_info_a( hinst, MAKEINTRESOURCEA( class ), NULL ); + check_atom_name_a( class, wc.lpszClassName ); + check_class_info_a( hinst, MAKEINTRESOURCEA( class ), NULL );
/* when context is active, UnregisterClassA is possible by atom, versioned, base names */ @@ -1712,11 +1712,11 @@ static void test_actctx_classes(void)
/* when context isn't active, UnregisterClassA is possible by versioned name only */ ret = UnregisterClassA( MAKEINTRESOURCEA( class ), hinst ); - todo_wine ok( !ret, "UnregisterClassA succeeded\n" ); + ok( !ret, "UnregisterClassA succeeded\n" ); ret = UnregisterClassA( wc.lpszClassName, hinst ); ok( !ret, "UnregisterClassA succeeded\n" ); ret = UnregisterClassA( wc_versioned.lpszClassName, hinst ); - todo_wine ok( ret, "UnregisterClassA failed, error %lu\n", GetLastError() ); + ok( ret, "UnregisterClassA failed, error %lu\n", GetLastError() );
/* registering versioned class while context isn't active */ @@ -1853,14 +1853,14 @@ static void test_actctx_classes(void)
/* versioned class can be registered when context is active, returns same atom as unversioned */ tmp_class = RegisterClassA( &wc_leak ); - todo_wine ok( tmp_class == class, "RegisterClassA failed, error %lu\n", GetLastError() ); + ok( tmp_class == class, "RegisterClassA failed, error %lu\n", GetLastError() ); check_atom_name_a( class, wc_leak.lpszClassName ); tmp_class = check_class_info_a( hinst, MAKEINTRESOURCEA( class ), &wc_leak ); - todo_wine check_atom_name_a( tmp_class, wc_leak.lpszClassName ); + check_atom_name_a( tmp_class, wc_leak.lpszClassName ); tmp_class = check_class_info_a( hinst, wc_leak.lpszClassName, &wc_leak ); - todo_wine check_atom_name_a( tmp_class, wc_leak.lpszClassName ); + check_atom_name_a( tmp_class, wc_leak.lpszClassName ); tmp_class = check_class_info_a( hinst, wc_leak_versioned.lpszClassName, &wc ); - todo_wine check_atom_name_a( tmp_class, wc_leak.lpszClassName ); + check_atom_name_a( tmp_class, wc_leak.lpszClassName );
/* versioned class can be unregistered with its base name */ ret = UnregisterClassA( wc_leak.lpszClassName, hinst ); @@ -1906,22 +1906,22 @@ static void test_actctx_classes(void) ok( ret, "ActivateActCtx failed, error %lu\n", GetLastError() ); class = RegisterClassA( &wc ); ok( class != 0, "RegisterClassA failed, error %lu\n", GetLastError() ); - todo_wine check_atom_name_a( class, wc.lpszClassName ); + check_atom_name_a( class, wc.lpszClassName ); tmp_class = check_class_info_a( hinst, MAKEINTRESOURCEA( class ), &wc ); - todo_wine check_atom_name_a( tmp_class, wc.lpszClassName ); + check_atom_name_a( tmp_class, wc.lpszClassName ); tmp_class = check_class_info_a( hinst, wc.lpszClassName, &wc ); - todo_wine check_atom_name_a( tmp_class, wc.lpszClassName ); + check_atom_name_a( tmp_class, wc.lpszClassName ); tmp_class = check_class_info_a( hinst, wc_versioned.lpszClassName, &wc ); - todo_wine check_atom_name_a( tmp_class, wc.lpszClassName ); + check_atom_name_a( tmp_class, wc.lpszClassName );
/* when context isn't active, class info is available by versioned name only */ ret = DeactivateActCtx( 0, cookie ); ok( ret, "DeactivateActCtx failed, error %lu\n", GetLastError() ); - todo_wine check_atom_name_a( class, wc.lpszClassName ); - todo_wine check_class_info_a( hinst, MAKEINTRESOURCEA( class ), NULL ); + check_atom_name_a( class, wc.lpszClassName ); + check_class_info_a( hinst, MAKEINTRESOURCEA( class ), NULL ); check_class_info_a( hinst, wc.lpszClassName, NULL ); tmp_class = check_class_info_a( hinst, wc_versioned.lpszClassName, &wc ); - todo_wine check_atom_name_a( tmp_class, wc.lpszClassName ); + check_atom_name_a( tmp_class, wc.lpszClassName );
/* when context is active, CreateWindow is allowed by atom, versioned, base names */ @@ -1944,8 +1944,7 @@ static void test_actctx_classes(void) ret = DeactivateActCtx( 0, cookie ); ok( ret, "DeactivateActCtx failed, error %lu\n", GetLastError() ); hwnd = CreateWindowExA( 0, MAKEINTRESOURCEA( class ), NULL, 0, 0, 0, 0, 0, 0, 0, hinst, 0 ); - todo_wine ok( !hwnd, "CreateWindowExA succeeded\n" ); - if (hwnd) DestroyWindow( hwnd ); + ok( !hwnd, "CreateWindowExA succeeded\n" ); hwnd = CreateWindowExA( 0, wc.lpszClassName, NULL, 0, 0, 0, 0, 0, 0, 0, hinst, 0 ); ok( !hwnd, "CreateWindowExA succeeded\n" ); hwnd = CreateWindowExA( 0, wc_versioned.lpszClassName, NULL, 0, 0, 0, 0, 0, 0, 0, hinst, 0 ); @@ -1999,12 +1998,12 @@ static void test_actctx_classes(void) ok( ret, "ActivateActCtx failed, error %lu\n", GetLastError() ); class = RegisterClassA( &wc ); ok( class != 0, "RegisterClassA failed, error %lu\n", GetLastError() ); - todo_wine check_atom_name_a( class, wc.lpszClassName ); + check_atom_name_a( class, wc.lpszClassName );
hwnd = CreateWindowExA( 0, wc_versioned.lpszClassName, NULL, 0, 0, 0, 0, 0, 0, 0, hinst, 0 ); ok( hwnd != NULL, "CreateWindowExA failed, error %lu\n", GetLastError() ); tmp_hwnd = FindWindowExA( NULL, NULL, MAKEINTRESOURCEA( class ), NULL ); - todo_wine ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); + ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); tmp_hwnd = FindWindowExA( NULL, NULL, wc.lpszClassName, NULL ); ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); tmp_hwnd = FindWindowExA(NULL, NULL, wc_versioned.lpszClassName, NULL); @@ -2014,7 +2013,7 @@ static void test_actctx_classes(void) ok( ret, "DeactivateActCtx failed, error %lu\n", GetLastError() );
tmp_hwnd = FindWindowExA( NULL, NULL, MAKEINTRESOURCEA( class ), NULL ); - todo_wine ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); + ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); tmp_hwnd = FindWindowExA( NULL, NULL, wc.lpszClassName, NULL ); ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); tmp_hwnd = FindWindowExA(NULL, NULL, wc_versioned.lpszClassName, NULL); @@ -2024,7 +2023,7 @@ static void test_actctx_classes(void) hwnd = CreateWindowExA( 0, wc_versioned.lpszClassName, NULL, 0, 0, 0, 0, 0, 0, 0, hinst, 0 ); ok( hwnd != NULL, "CreateWindowExA failed, error %lu\n", GetLastError() ); tmp_hwnd = FindWindowExA( NULL, NULL, MAKEINTRESOURCEA( class ), NULL ); - todo_wine ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); + ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); tmp_hwnd = FindWindowExA( NULL, NULL, wc.lpszClassName, NULL ); ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); tmp_hwnd = FindWindowExA( NULL, NULL, wc_versioned.lpszClassName, NULL ); @@ -2042,19 +2041,19 @@ static void test_actctx_classes(void) check_class_info_a( hinst, MAKEINTRESOURCEA(1234), NULL ); check_class_info_a( hinst, wc_integral.lpszClassName, NULL ); class = RegisterClassA( &wc_integral_int ); - todo_wine ok( class == 1234, "RegisterClassA failed, error %lu\n", GetLastError() ); + ok( class == 1234, "RegisterClassA failed, error %lu\n", GetLastError() ); tmp_class = check_class_info_a( hinst, MAKEINTRESOURCEA(1234), &wc_integral_int ); - todo_wine ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); + ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); tmp_class = check_class_info_a( hinst, wc_integral.lpszClassName, &wc_integral_int ); - todo_wine ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); + ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); ret = UnregisterClassA( MAKEINTRESOURCEA( class ), hinst ); ok( ret, "UnregisterClassA failed, error %lu\n", GetLastError() ); class = RegisterClassA( &wc_integral ); - todo_wine ok( class == 1234, "RegisterClassA failed, error %lu\n", GetLastError() ); + ok( class == 1234, "RegisterClassA failed, error %lu\n", GetLastError() ); tmp_class = check_class_info_a( hinst, MAKEINTRESOURCEA(1234), &wc_integral ); - todo_wine ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); + ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); tmp_class = check_class_info_a( hinst, wc_integral.lpszClassName, &wc_integral ); - todo_wine ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); + ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); ret = DeactivateActCtx( 0, cookie ); ok( ret, "DeactivateActCtx failed, error %lu\n", GetLastError() );
@@ -2065,15 +2064,15 @@ static void test_actctx_classes(void) ret = UnregisterClassA( MAKEINTRESOURCEA(1234), hinst ); ok( ret, "UnregisterClassA failed, error %lu\n", GetLastError() ); class = RegisterClassA( &wc_integral ); - todo_wine ok( class == 1234, "RegisterClassA failed, error %lu\n", GetLastError() ); + ok( class == 1234, "RegisterClassA failed, error %lu\n", GetLastError() ); ret = UnregisterClassA( wc_integral.lpszClassName, hinst ); ok( ret, "UnregisterClassA failed, error %lu\n", GetLastError() ); class = RegisterClassA( &wc_integral ); - todo_wine ok( class == 1234, "RegisterClassA failed, error %lu\n", GetLastError() ); + ok( class == 1234, "RegisterClassA failed, error %lu\n", GetLastError() ); ret = UnregisterClassA( wc_integral_versioned.lpszClassName, hinst ); ok( ret, "UnregisterClassA failed, error %lu\n", GetLastError() ); class = RegisterClassA( &wc_integral ); - todo_wine ok( class == 1234, "RegisterClassA failed, error %lu\n", GetLastError() ); + ok( class == 1234, "RegisterClassA failed, error %lu\n", GetLastError() ); ret = DeactivateActCtx( 0, cookie ); ok( ret, "DeactivateActCtx failed, error %lu\n", GetLastError() );
@@ -2145,14 +2144,14 @@ static void test_actctx_classes(void)
/* versioned class can be registered when context is active, returns same atom as unversioned */ tmp_class = RegisterClassA( &wc_integral ); - todo_wine ok( tmp_class == class, "RegisterClassA failed, error %lu\n", GetLastError() ); + ok( tmp_class == class, "RegisterClassA failed, error %lu\n", GetLastError() );
tmp_class = check_class_info_a( hinst, MAKEINTRESOURCEA( class ), &wc_integral ); - todo_wine ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); + ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); tmp_class = check_class_info_a( hinst, wc_integral.lpszClassName, &wc_integral ); - todo_wine ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); + ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); tmp_class = check_class_info_a( hinst, wc_integral_versioned.lpszClassName, &wc_integral ); - todo_wine ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); + ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() );
/* versioned class can be unregistered with its base name */ ret = UnregisterClassA( wc_integral.lpszClassName, hinst ); @@ -2173,21 +2172,21 @@ static void test_actctx_classes(void) ret = ActivateActCtx( context, &cookie ); ok( ret, "ActivateActCtx failed, error %lu\n", GetLastError() ); class = RegisterClassA( &wc_integral ); - todo_wine ok( class == 1234, "RegisterClassA failed, error %lu\n", GetLastError() ); + ok( class == 1234, "RegisterClassA failed, error %lu\n", GetLastError() ); tmp_class = check_class_info_a( hinst, MAKEINTRESOURCEA( class ), &wc_integral ); - todo_wine ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); + ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); tmp_class = check_class_info_a( hinst, wc_integral.lpszClassName, &wc_integral ); - todo_wine ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); + ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); tmp_class = check_class_info_a( hinst, wc_integral_versioned.lpszClassName, &wc_integral ); - todo_wine ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); + ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() );
/* class info is available by versioned name only, if context isn't active. */ ret = DeactivateActCtx( 0, cookie ); ok( ret, "DeactivateActCtx failed, error %lu\n", GetLastError() ); - todo_wine check_class_info_a( hinst, MAKEINTRESOURCEA( class ), NULL ); + check_class_info_a( hinst, MAKEINTRESOURCEA( class ), NULL ); check_class_info_a( hinst, wc_integral.lpszClassName, NULL ); tmp_class = check_class_info_a( hinst, wc_integral_versioned.lpszClassName, &wc_integral ); - todo_wine ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() ); + ok( tmp_class == 1234, "GetClassInfoA failed, error %lu\n", GetLastError() );
/* CreateWindow is allowed by atom, versioned, base names when context is active */ @@ -2210,8 +2209,7 @@ static void test_actctx_classes(void) ret = DeactivateActCtx( 0, cookie ); ok( ret, "DeactivateActCtx failed, error %lu\n", GetLastError() ); hwnd = CreateWindowExA( 0, MAKEINTRESOURCEA( class ), NULL, 0, 0, 0, 0, 0, 0, 0, hinst, 0 ); - todo_wine ok( !hwnd, "CreateWindowExA succeeded\n" ); - if (hwnd) DestroyWindow( hwnd ); + ok( !hwnd, "CreateWindowExA succeeded\n" ); hwnd = CreateWindowExA( 0, wc_integral.lpszClassName, NULL, 0, 0, 0, 0, 0, 0, 0, hinst, 0 ); ok( !hwnd, "CreateWindowExA succeeded\n" ); hwnd = CreateWindowExA( 0, wc_integral_versioned.lpszClassName, NULL, 0, 0, 0, 0, 0, 0, 0, hinst, 0 ); @@ -2263,14 +2261,14 @@ static void test_actctx_classes(void) ret = ActivateActCtx( context, &cookie ); ok( ret, "ActivateActCtx failed, error %lu\n", GetLastError() ); class = RegisterClassA( &wc_integral ); - todo_wine ok( class == 1234, "RegisterClassA failed, error %lu\n", GetLastError() ); + ok( class == 1234, "RegisterClassA failed, error %lu\n", GetLastError() );
hwnd = CreateWindowExA( 0, wc_integral_versioned.lpszClassName, NULL, 0, 0, 0, 0, 0, 0, 0, hinst, 0 ); ok( hwnd != NULL, "CreateWindowExA failed, error %lu\n", GetLastError() ); tmp_hwnd = FindWindowExA( NULL, NULL, MAKEINTRESOURCEA( class ), NULL ); - todo_wine ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); + ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); tmp_hwnd = FindWindowExA( NULL, NULL, wc_integral.lpszClassName, NULL ); - todo_wine ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); + ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); tmp_hwnd = FindWindowExA(NULL, NULL, wc_integral_versioned.lpszClassName, NULL); ok( tmp_hwnd == NULL, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() );
@@ -2278,9 +2276,9 @@ static void test_actctx_classes(void) ok( ret, "DeactivateActCtx failed, error %lu\n", GetLastError() );
tmp_hwnd = FindWindowExA( NULL, NULL, MAKEINTRESOURCEA( class ), NULL ); - todo_wine ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); + ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); tmp_hwnd = FindWindowExA( NULL, NULL, wc_integral.lpszClassName, NULL ); - todo_wine ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); + ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); tmp_hwnd = FindWindowExA(NULL, NULL, wc_integral_versioned.lpszClassName, NULL); ok( tmp_hwnd == NULL, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); DestroyWindow( hwnd ); @@ -2288,9 +2286,9 @@ static void test_actctx_classes(void) hwnd = CreateWindowExA( 0, wc_integral_versioned.lpszClassName, NULL, 0, 0, 0, 0, 0, 0, 0, hinst, 0 ); ok( hwnd != NULL, "CreateWindowExA failed, error %lu\n", GetLastError() ); tmp_hwnd = FindWindowExA( NULL, NULL, MAKEINTRESOURCEA( class ), NULL ); - todo_wine ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); + ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); tmp_hwnd = FindWindowExA( NULL, NULL, wc_integral.lpszClassName, NULL ); - todo_wine ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); + ok( tmp_hwnd == hwnd, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); tmp_hwnd = FindWindowExA( NULL, NULL, wc_integral_versioned.lpszClassName, NULL ); ok( tmp_hwnd == NULL, "FindWindowExA returned %p, error %lu\n", tmp_hwnd, GetLastError() ); DestroyWindow( hwnd ); diff --git a/dlls/win32u/class.c b/dlls/win32u/class.c index 6695c06acbb..3f241501e83 100644 --- a/dlls/win32u/class.c +++ b/dlls/win32u/class.c @@ -59,7 +59,7 @@ typedef struct tagCLASS HICON hIconSmIntern; /* Internal small icon, derived from hIcon */ HCURSOR hCursor; /* Default cursor */ HBRUSH hbrBackground; /* Default background */ - ATOM atomName; /* Name of the class */ + ATOM atom; /* name of the class */ WCHAR name[MAX_ATOM_LEN + 1]; WCHAR *basename; /* Base name for redirected classes, pointer within 'name'. */ struct client_menu_name menu_name; /* Default menu name */ @@ -505,7 +505,7 @@ ATOM WINAPI NtUserRegisterClassExWOW( const WNDCLASSEXW *wc, UNICODE_STRING *nam req->atom = wine_server_add_atom( req, name ); req->name_offset = version->Length / sizeof(WCHAR); ret = !wine_server_call_err( req ); - class->atomName = reply->atom; + atom = reply->atom; } SERVER_END_REQ; if (!ret) @@ -525,8 +525,6 @@ ATOM WINAPI NtUserRegisterClassExWOW( const WNDCLASSEXW *wc, UNICODE_STRING *nam if (class->local) list_add_head( &class_list, &class->entry ); else list_add_tail( &class_list, &class->entry );
- atom = class->atomName; - TRACE( "name=%s->%s atom=%04x wndproc=%p hinst=%p bg=%p style=%08x clsExt=%d winExt=%d class=%p\n", debugstr_w(wc->lpszClassName), debugstr_us(name), atom, wc->lpfnWndProc, instance, wc->hbrBackground, wc->style, wc->cbClsExtra, wc->cbWndExtra, class ); @@ -536,6 +534,7 @@ ATOM WINAPI NtUserRegisterClassExWOW( const WNDCLASSEXW *wc, UNICODE_STRING *nam class->hIconSmIntern = sm_icon; class->hCursor = wc->hCursor; class->hbrBackground = wc->hbrBackground; + class->atom = atom; class->winproc = alloc_winproc( wc->lpfnWndProc, ansi ); if (client_menu_name) class->menu_name = *client_menu_name; release_class_ptr( class ); @@ -606,7 +605,7 @@ ATOM WINAPI NtUserGetClassInfoEx( HINSTANCE instance, UNICODE_STRING *name, WNDC }
if (menu_name) *menu_name = class->menu_name; - atom = class->atomName; + atom = class->atom; release_class_ptr( class ); return atom; } @@ -719,7 +718,7 @@ INT WINAPI NtUserGetClassName( HWND hwnd, BOOL real, UNICODE_STRING *name ) req->extra_offset = -1; req->extra_size = 0; if (!wine_server_call_err( req )) - atom = reply->base_atom; + atom = reply->old_atom; } SERVER_END_REQ;
@@ -1076,7 +1075,7 @@ static ULONG_PTR get_class_long_size( HWND hwnd, INT offset, UINT size, BOOL ans retvalue = ansi ? (ULONG_PTR)class->menu_name.nameA : (ULONG_PTR)class->menu_name.nameW; break; case GCW_ATOM: - retvalue = class->atomName; + retvalue = class->atom; break; default: RtlSetLastWin32Error( ERROR_INVALID_INDEX ); diff --git a/server/atom.c b/server/atom.c index 41b2f48928d..2995ee0b2d9 100644 --- a/server/atom.c +++ b/server/atom.c @@ -248,6 +248,24 @@ static void atom_table_destroy( struct object *obj ) for (i = 0; i < table->count; i++) free( table->atoms[i] ); }
+static atom_t get_int_atom_value( const struct unicode_str *name ) +{ + const WCHAR *ptr = name->str; + const WCHAR *end = ptr + name->len / sizeof(WCHAR); + unsigned int ret = 0; + + if (IS_INTRESOURCE(ptr)) return LOWORD(ptr); + + if (*ptr++ != '#') return 0; + while (ptr < end) + { + if (*ptr < '0' || *ptr > '9') return 0; + ret = ret * 10 + *ptr++ - '0'; + if (ret >= MAXINTATOM) return 0; + } + return ret; +} + /* find an atom entry in its hash list */ static struct atom_entry *find_atom_entry( struct atom_table *table, const struct unicode_str *str, unsigned short hash ) @@ -278,6 +296,7 @@ atom_t add_atom( struct atom_table *table, const struct unicode_str *str ) set_error( STATUS_INVALID_PARAMETER ); return 0; } + if ((atom = get_int_atom_value( str ))) return atom;
hash = hash_strW( str->str, str->len, ARRAY_SIZE(table->entries) ); if ((entry = find_atom_entry( table, str, hash ))) /* exists already */ @@ -328,6 +347,7 @@ atom_t find_atom( struct atom_table *table, const struct unicode_str *str ) { struct atom_entry *entry; unsigned short hash; + atom_t atom;
if (!str->len) { @@ -339,6 +359,7 @@ atom_t find_atom( struct atom_table *table, const struct unicode_str *str ) set_error( STATUS_INVALID_PARAMETER ); return 0; } + if ((atom = get_int_atom_value( str ))) return atom;
hash = hash_strW( str->str, str->len, ARRAY_SIZE(table->entries) ); if (!(entry = find_atom_entry( table, str, hash ))) diff --git a/server/class.c b/server/class.c index c98c171e035..3b2d38a3bfd 100644 --- a/server/class.c +++ b/server/class.c @@ -212,7 +212,7 @@ DECL_HANDLER(create_class) class->style = req->style; class->win_extra = req->win_extra; class->client_ptr = req->client_ptr; - reply->atom = atom; + reply->atom = base_atom; }
/* destroy a window class */ @@ -277,7 +277,6 @@ DECL_HANDLER(set_class_info) reply->old_extra = class->nb_extra_bytes; reply->old_win_extra = class->win_extra; reply->old_instance = class->instance; - reply->base_atom = class->base_atom;
if (req->flags & SET_CLASS_STYLE) class->style = req->style; if (req->flags & SET_CLASS_WINEXTRA) class->win_extra = req->win_extra; diff --git a/server/protocol.def b/server/protocol.def index f7f4d463b7d..1d8ef4ac930 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3262,8 +3262,7 @@ enum caret_state data_size_t extra_size; /* size to set in extra bytes */ lparam_t extra_value; /* value to set in extra bytes */ @REPLY - atom_t old_atom; /* previous class atom */ - atom_t base_atom; /* base class atom */ + atom_t old_atom; /* previous class base atom */ mod_handle_t old_instance; /* previous module instance */ lparam_t old_extra_value; /* old value in extra bytes */ unsigned int old_style; /* previous class style */