[PATCH 0/1] MR9391: uxtheme/tests: Verify GetCurrentThemeName() returns Aero\Aero.msstyles on Windows
Problem Native Windows returns a theme path ending with \\Aero\\Aero.msstyles from GetCurrentThemeName(), even when “Light” is selected. Wine currently returns ...\\light\\light.msstyles which confuses some WPF installers. Windows evidence Windows 11 24H2: system.c:830: theme=L"C:\\WINDOWS\\resources\\themes\\Aero\\Aero.msstyles" Result: test passed (0 failures) (full log attached in the bug / can reattach in MR if needed) Wine behavior (before fix) theme=L"C:\\windows\\resources\\themes\\light\\light.msstyles" (test is marked todo_wine to keep CI green until the fix) This MR 1/2 uxtheme/tests: Add a conformance test that documents Windows behavior (Aero\\Aero.msstyles); mark check as todo_wine on Wine. 2/2 uxtheme: Return Aero.msstyles from GetCurrentThemeName() when Light is active, matching Windows. Notes - Minimal diff; no formatting changes. - Test passes on Windows; after the fix it also passes on Wine (todo_wine can be dropped). Add a conformance test that calls GetCurrentThemeName() and checks that the returned path ends with \\Aero\\Aero.msstyles (regardless of Light/Dark). Skip if theming is inactive. On Wine this currently returns ...\\light\\light.msstyles, so the check is wrapped in todo_wine. Tested on: - Windows 10 22H2: theme=Aero\\Aero.msstyles (passes) - Windows 11 24H2: theme=Aero\\Aero.msstyles (passes) Signed-off-by: Nikita strudelll(a)etersoft.ru -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9391
From: strudelll <strudelll(a)etersoft.ru> Add a conformance test that calls GetCurrentThemeName() and checks that the returned path ends with \Aero\Aero.msstyles (regardless of Light/Dark). Skip if theming is inactive. On Wine this currently returns ...\light\light.msstyles, so the check is wrapped in todo_wine. Tested on: - Windows 10 22H2: theme=Aero\Aero.msstyles (passes) - Windows 11 24H2: theme=Aero\Aero.msstyles (passes) Signed-off-by: Nikita <strudelll(a)etersoft.ru> --- dlls/uxtheme/tests/system.c | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c index 6597dc274cd..994775d523b 100644 --- a/dlls/uxtheme/tests/system.c +++ b/dlls/uxtheme/tests/system.c @@ -36,6 +36,10 @@ #include "v6util.h" +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) +#endif + static HTHEME (WINAPI * pOpenThemeDataEx)(HWND, LPCWSTR, DWORD); static HTHEME (WINAPI *pOpenThemeDataForDpi)(HWND, LPCWSTR, UINT); static HRESULT (WINAPI *pOpenThemeFile)(const WCHAR *, const WCHAR *, const WCHAR *, HANDLE, DWORD); @@ -782,6 +786,55 @@ static void test_OpenThemeDataForDpi(void) } } +static BOOL ends_with_i(const WCHAR *s, const WCHAR *suffix) +{ + size_t ls, lt; + size_t i; + + if (!s || !suffix) return FALSE; + ls = lstrlenW(s); + lt = lstrlenW(suffix); + if (lt > ls) return FALSE; + for (i = 0; i < lt; ++i) + { + WCHAR a = s[ls - lt + i], b = suffix[i]; + if (a >= L'A' && a <= L'Z') a += L'a' - L'A'; + if (b >= L'A' && b <= L'Z') b += L'a' - L'A'; + if (a != b) return FALSE; + } + return TRUE; +} + +static BOOL ends_with_aero_msstyles(const WCHAR *path) +{ + static const WCHAR suf1[] = L"\\Aero\\Aero.msstyles"; + static const WCHAR suf2[] = L"/Aero/Aero.msstyles"; + return ends_with_i(path, suf1) || ends_with_i(path, suf2); +} + +static void test_GetCurrentThemeName_maps_to_aero(void) +{ + HRESULT hr; + WCHAR theme[MAX_PATH], color[64], size[64]; + + if (!IsThemeActive()) + { + win_skip("Themes are inactive on this system.\n"); + return; + } + + theme[0] = color[0] = size[0] = 0; + hr = GetCurrentThemeName(theme, ARRAY_SIZE(theme), color, ARRAY_SIZE(color), + size, ARRAY_SIZE(size)); + ok(hr == S_OK, "GetCurrentThemeName failed, hr=%#lx\n", hr); + trace("theme=%s color=%s size=%s\n", + wine_dbgstr_w(theme), wine_dbgstr_w(color), wine_dbgstr_w(size)); + + todo_wine ok(ends_with_aero_msstyles(theme), + "Expected '\\\\Aero\\\\Aero.msstyles', got %s\n", + wine_dbgstr_w(theme)); +} + static void test_GetCurrentThemeName(void) { BOOL bThemeActive; @@ -2836,6 +2889,8 @@ START_TEST(system) unload_v6_module(ctx_cookie, ctx); } + test_GetCurrentThemeName_maps_to_aero(); + /* Test EnableTheming() in the end because it may disable theming */ test_EnableTheming(); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9391
Wine currently returns ...\\light\\light.msstyles which confuses some WPF installers.
Could you give me a link to the WPF installer. If returning a different name other than Aero.msstyles breaks the installer, doesn't it mean that the same thing will happen on Windows? Because obviously you can use other themes on Windows. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9391#note_121125
yes, of course you just need to create a link -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9391#note_121134
On Fri Nov 7 07:51:26 2025 +0000, nikita pushkarev wrote:
yes, of course you just need to create a link I meant is there a download link for the WPF installer?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9391#note_121135
participants (3)
-
nikita pushkarev (@strudelll) -
strudelll -
Zhiyi Zhang (@zhiyi)