[PATCH v4 0/1] MR11055: loader: Add default SQMClient registry key
On Windows the key `HKLM\SOFTWARE\Microsoft\SQMClient` is populated with a random UUID when SQM is first used to identify each device. This MR makes wineboot fill it with a random UUID on initialization. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54021 -- v4: wineboot: Create SQMClient MachineId registry key https://gitlab.winehq.org/wine/wine/-/merge_requests/11055
From: Rose Hellsing <rose@pinkro.se> On Windows the key HKLM\SOFTWARE\Microsoft\SQMClient is populated with a random UUID when SQM is first used to identify each device. In wine this is now done on wineboot initialization. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54021 --- programs/wineboot/Makefile.in | 2 +- programs/wineboot/wineboot.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/programs/wineboot/Makefile.in b/programs/wineboot/Makefile.in index d346b8984b1..2d3b4dc2bde 100644 --- a/programs/wineboot/Makefile.in +++ b/programs/wineboot/Makefile.in @@ -1,5 +1,5 @@ MODULE = wineboot.exe -IMPORTS = uuid advapi32 ws2_32 kernelbase +IMPORTS = uuid rpcrt4 advapi32 ws2_32 kernelbase DELAYIMPORTS = shell32 shlwapi version user32 gdi32 setupapi newdev wininet EXTRADLLFLAGS = -mconsole diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c index 6ffcbe1266c..3152ae1eeb0 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c @@ -912,6 +912,26 @@ static void create_volatile_environment_registry_key(void) RegCloseKey( hkey ); } +static void create_sqmclient_registry_key(void) +{ + HKEY hkey; + LONG r; + UUID uuid; + RPC_WSTR uuid_str; + + r = RegCreateKeyExW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\SQMClient", 0, NULL, 0, + KEY_ALL_ACCESS, NULL, &hkey, NULL ); + if (r) return; + + r = RegQueryValueExW( hkey, L"MachineId", NULL, NULL, NULL, NULL ); + if (r == ERROR_FILE_NOT_FOUND && UuidCreate( &uuid ) == S_OK && UuidToStringW( &uuid, &uuid_str ) == RPC_S_OK) + { + set_reg_value( hkey, L"MachineId", uuid_str ); + RpcStringFreeW( &uuid_str ); + } + RegCloseKey( hkey ); +} + static const WCHAR *get_known_dll_ntdir( WORD machine ) { switch (machine) @@ -1900,6 +1920,7 @@ int __cdecl main( int argc, char *argv[] ) start_services_process(); } if (init || update) update_wineprefix( update ); + create_sqmclient_registry_key(); create_volatile_environment_registry_key(); create_known_dlls(); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11055
On Tue Jun 2 19:35:09 2026 +0000, Rose Hellsing wrote:
changed this line in [version 4 of the diff](/wine/wine/-/merge_requests/11055/diffs?diff_id=272312&start_sha=fd1f525688d31473e0739ca2ea0db8aa6a48069d#2b4d6fc87c1beea0829c92565fb052f93f1b1592_931_929) Changed the patch subject and collapsed it all into one if statement.
Should the entire if statement be on one line? Feels a bit long like this -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11055#note_142035
This merge request was approved by Paul Gofman. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11055
participants (3)
-
Paul Gofman (@gofman) -
Rose Hellsing -
Rose Hellsing (@axtlos)