From: Zhiyi Zhang zzhang@codeweavers.com
When comctl32 v6 is loaded and v6 manifest is disabled, comctl32 v5 should be used when creating a common control window. However, before this patch, GetModuleHandleW(L"comctl32") return a handle to comctl32 v6 in this case, so comctl32 v5 doesn't get loaded and creating comctl32 v5 windows fails. We need to check if comctl32 v5 is actually loaded by using GetModuleHandleW() with the absolute path of the comctl32 v5 dll.
Fix Word 2010 file open dialog doesn't show a listview. --- dlls/comctl32/tests/misc.c | 5 ----- dlls/user32/class.c | 11 ++++++----- 2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index 064f7d06da3..c61b71b6309 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -45,7 +45,6 @@ static BOOL (WINAPI *pRemoveWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR); static LRESULT (WINAPI *pDefSubclassProc)(HWND, UINT, WPARAM, LPARAM);
static HMODULE hComctl32; -static BOOL todo_create_v5_window;
/* For message tests */ enum seq_index @@ -416,10 +415,7 @@ static void check_class( const char *name, int must_exist, UINT style, UINT igno ok( !wc.hInstance, "System class %s has hInstance %p\n", name, wc.hInstance );
hwnd = CreateWindowA(name, 0, 0, 0, 0, 0, 0, 0, NULL, GetModuleHandleA(NULL), 0); - todo_wine_if(todo_create_v5_window) ok( hwnd != NULL, "Failed to create window for class %s.\n", name ); - if (!hwnd) - return; GetClassNameA(hwnd, buff, ARRAY_SIZE(buff)); ok( !strcmp(name, buff), "Unexpected class name %s, expected %s.\n", buff, name );
@@ -1454,7 +1450,6 @@ START_TEST(misc) unload_v6_module(ctx_cookie, hCtx);
/* Now that v6 manifest is deactivated, test that comctl32 v5 windows can be created */ - todo_create_v5_window = TRUE; test_comctl32_classes(FALSE);
FreeLibrary(hComctl32); diff --git a/dlls/user32/class.c b/dlls/user32/class.c index 43636975e89..a754720caec 100644 --- a/dlls/user32/class.c +++ b/dlls/user32/class.c @@ -198,11 +198,6 @@ void get_class_version( UNICODE_STRING *name, UNICODE_STRING *version, BOOL load
if (IS_INTRESOURCE( name->Buffer ) || is_builtin_class( name->Buffer )) return;
- if (is_comctl32_class( name->Buffer )) - { - if (load && !(hmod = GetModuleHandleW( L"comctl32" ))) hmod = LoadLibraryW( L"comctl32" ); - } - if (!RtlFindActivationContextSectionString( 0, NULL, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, name, &data )) { struct wndclass_redirect_data @@ -228,6 +223,12 @@ void get_class_version( UNICODE_STRING *name, UNICODE_STRING *version, BOOL load name->Length = wndclass->name_len; name->Buffer[name->Length / sizeof(WCHAR)] = 0; } + /* comctl32 v5 */ + else if (load && is_comctl32_class( name->Buffer )) + { + hmod = GetModuleHandleW( L"C:\windows\system32\comctl32.dll" ); + if (!hmod) hmod = LoadLibraryW( L"C:\windows\system32\comctl32.dll" ); + }
if (load && hmod) {