## WINELINKING environment variable
`WINELINKING` is an optional environment variable that controls how Wine installs its built-in (“fake”) DLLs into a Wine prefix.\ Instead of always copying the PE template into the prefix, Wine can:
* create a symbolic link to the original PE file, * create a hard link to the original PE file, or * attempt a filesystem-level copy-on-write (reflink) clone.
This can significantly reduce disk usage and speed up prefix creation on filesystems that support these features.
`WINELINKING` is only consulted when installing built-in DLLs (the fake DLLs generated by `setupapi`). It does **not** affect how applications copy or install their own files inside the prefix.
### Supported values
`WINELINKING` recognizes the following values:
* `WINELINKING=sym`\ Wine attempts to create a **symbolic link** in the prefix that points to the original built-in PE file in the Wine installation. * `WINELINKING=hard`\ Wine attempts to create a **hard link** to the original built-in PE file, so both paths refer to the same underlying file on disk. * `WINELINKING=cow`\ Wine attempts a **copy-on-write (CoW) / reflink clone** of the original PE file. On filesystems that support extent cloning, this creates a logical copy that shares physical blocks until one of the copies is modified.
If `WINELINKING` is not set, or set to any other value, Wine falls back to the traditional behavior: the built-in DLL is copied into the prefix with a normal write.
Signed-off-by: Nikita strudelll@etersoft.ru
From: strudelll strudelll@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@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(); }
This merge request was closed by Zhiyi Zhang.
There is already https://gitlab.winehq.org/wine/wine/-/merge_requests/9391. Please address the comments in [MR9391](https://gitlab.winehq.org/wine/wine/-/merge_requests/9391) and don't open duplicate MRs. Meanwhile, the description in this MR doesn't make any sense.