This MR separates comctl32 into v5 and v6. A full branch is at https://gitlab.winehq.org/zhiyi/wine/-/commits/comctl32-separation. The remaining commits are to remove items that shouldn't be in v5. comctl32-version_6 in wine-staging can be dropped after this MR.
-- v9: comctl32/tests: Add version tests. user32: Load version for comctl32 v6 window classes. comctl32/tests: Fix a window leak.
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/tests/datetime.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c index e2a2967e831..0f15f88b9b0 100644 --- a/dlls/comctl32/tests/datetime.c +++ b/dlls/comctl32/tests/datetime.c @@ -722,6 +722,8 @@ static void test_dtm_set_and_get_system_time(void) expect(4, (LRESULT)getSt.wDayOfWeek); st.wDayOfWeek = 4; expect_systime(&st, &getSt); + + DestroyWindow(hWnd); }
static void test_dtm_set_and_get_systemtime_with_limits(void)
From: Zhiyi Zhang zzhang@codeweavers.com
So that versioned window classes gets registered as well. Otherwise, comctl32 v6 fails to register its window classes when comctl32 v5 classes are still being used. This can happen, for example, when creating a window using comctl32 v5, then unload comctl32 v5 and not destroying the window, and then load comctl32 v6. --- dlls/user32/class.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/class.c b/dlls/user32/class.c index 3b84d0840f3..43636975e89 100644 --- a/dlls/user32/class.c +++ b/dlls/user32/class.c @@ -202,7 +202,8 @@ void get_class_version( UNICODE_STRING *name, UNICODE_STRING *version, BOOL load { if (load && !(hmod = GetModuleHandleW( L"comctl32" ))) hmod = LoadLibraryW( L"comctl32" ); } - else if (!RtlFindActivationContextSectionString( 0, NULL, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, name, &data )) + + if (!RtlFindActivationContextSectionString( 0, NULL, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, name, &data )) { struct wndclass_redirect_data {
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/tests/misc.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index 657376f49ce..7bda458c7e7 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -22,6 +22,7 @@ #include <windows.h> #include <commctrl.h> #include <uxtheme.h> +#include <shlwapi.h>
#include "wine/test.h" #include "v6util.h" @@ -37,6 +38,7 @@ static BOOL (WINAPI * pStr_SetPtrA)(LPSTR, LPCSTR); static INT (WINAPI * pStr_GetPtrW)(LPCWSTR, LPWSTR, INT); static BOOL (WINAPI * pStr_SetPtrW)(LPWSTR, LPCWSTR);
+static HRESULT (WINAPI *pDllGetVersion)(DLLVERSIONINFO *); static BOOL (WINAPI *pSetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR); static BOOL (WINAPI *pRemoveWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR); static LRESULT (WINAPI *pDefSubclassProc)(HWND, UINT, WPARAM, LPARAM); @@ -92,6 +94,8 @@ static BOOL InitFunctionPtrs(void) COMCTL32_GET_PROC(235, Str_GetPtrW) COMCTL32_GET_PROC(236, Str_SetPtrW)
+ pDllGetVersion = (void *)GetProcAddress(hComctl32, "DllGetVersion"); + return TRUE; }
@@ -108,6 +112,8 @@ static BOOL init_functions_v6(void) COMCTL32_GET_PROC(412, RemoveWindowSubclass) COMCTL32_GET_PROC(413, DefSubclassProc)
+ pDllGetVersion = (void *)GetProcAddress(hComctl32, "DllGetVersion"); + return TRUE; }
@@ -1284,6 +1290,19 @@ static void test_WM_SETFONT(void) DestroyWindow(parent); }
+static void test_version(BOOL v6) +{ + DLLVERSIONINFO info; + HRESULT hr; + + info.cbSize = sizeof(info); + hr = pDllGetVersion(&info); + ok(hr == S_OK, "DllGetVersion failed, hr %#lx.\n", hr); + + todo_wine_if(v6) + ok(info.dwMajorVersion == (v6 ? 6 : 5), "Got unexpected major version %lu.\n", info.dwMajorVersion); +} + START_TEST(misc) { ULONG_PTR ctx_cookie; @@ -1298,6 +1317,7 @@ START_TEST(misc) test_comctl32_classes(FALSE); test_WM_STYLECHANGED(); test_WM_SETFONT(); + test_version(FALSE);
FreeLibrary(hComctl32);
@@ -1314,6 +1334,7 @@ START_TEST(misc) test_WM_SYSCOLORCHANGE(); test_WM_STYLECHANGED(); test_WM_SETFONT(); + test_version(TRUE);
unload_v6_module(ctx_cookie, hCtx); FreeLibrary(hComctl32);
v9: Remove the commit that does the separation of v5 and v6. Alexandre is taking care of the loader improvements needed to load two dlls with the same name. Thanks, Alexandre.