Signed-off-by: Torge Matthies openglfreak@googlemail.com
-- v6: loader: Add Default, Failed, and LastKnownGood values to HKLM\System\Select. server: Create link from HKLM\System\CurrentControlSet to ControlSet001. advapi32/tests: Add test for CurrentControlSet link.
From: Torge Matthies openglfreak@googlemail.com
Signed-off-by: Torge Matthies openglfreak@googlemail.com --- dlls/advapi32/tests/registry.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index 8bffefe8628..86784a16d5c 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -4955,6 +4955,39 @@ static void test_RegRenameKey(void) RegCloseKey(key); }
+static inline BOOL check_cs_number( const WCHAR *str ) +{ + if (str[0] < '0' || str[0] > '9' || str[1] < '0' || str[1] > '9' || str[2] < '0' || str[2] > '9') + return FALSE; + if (str[0] == '0' && str[1] == '0' && str[2] == '0') + return FALSE; + return TRUE; +} + +static void test_control_set_symlink(void) +{ + static const WCHAR target_pfxW[] = L"\REGISTRY\Machine\System\ControlSet"; + DWORD target_len, type, len, err; + BYTE buffer[1024]; + HKEY key; + + target_len = sizeof(target_pfxW) + 3 * sizeof(WCHAR); + + err = RegOpenKeyExA( HKEY_LOCAL_MACHINE, "System\CurrentControlSet", REG_OPTION_OPEN_LINK, KEY_QUERY_VALUE, &key ); + ok( err == ERROR_SUCCESS, "RegOpenKeyEx failed error %lu\n", err ); + len = sizeof(buffer); + err = RegQueryValueExA( key, "SymbolicLinkValue", NULL, &type, buffer, &len ); + todo_wine + ok( err == ERROR_SUCCESS, "RegQueryValueEx failed error %lu\n", err ); + todo_wine + ok( len == target_len - sizeof(WCHAR), "wrong len %lu\n", len ); + todo_wine + ok( !_wcsnicmp( (WCHAR*)buffer, target_pfxW, ARRAY_SIZE(target_pfxW) - 1 ) && + check_cs_number( (WCHAR*)buffer + ARRAY_SIZE(target_pfxW) - 1 ), + "wrong link target\n" ); + RegCloseKey( key ); +} + START_TEST(registry) { /* Load pointers for functions that are not available in all Windows versions */ @@ -4996,6 +5029,7 @@ START_TEST(registry) test_EnumDynamicTimeZoneInformation(); test_perflib_key(); test_RegRenameKey(); + test_control_set_symlink();
/* cleanup */ delete_key( hkey_main );
From: Torge Matthies openglfreak@googlemail.com
Signed-off-by: Torge Matthies openglfreak@googlemail.com --- dlls/advapi32/tests/registry.c | 3 --- server/registry.c | 28 ++++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index 86784a16d5c..54a9b5be2a2 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -4977,11 +4977,8 @@ static void test_control_set_symlink(void) ok( err == ERROR_SUCCESS, "RegOpenKeyEx failed error %lu\n", err ); len = sizeof(buffer); err = RegQueryValueExA( key, "SymbolicLinkValue", NULL, &type, buffer, &len ); - todo_wine ok( err == ERROR_SUCCESS, "RegQueryValueEx failed error %lu\n", err ); - todo_wine ok( len == target_len - sizeof(WCHAR), "wrong len %lu\n", len ); - todo_wine ok( !_wcsnicmp( (WCHAR*)buffer, target_pfxW, ARRAY_SIZE(target_pfxW) - 1 ) && check_cs_number( (WCHAR*)buffer + ARRAY_SIZE(target_pfxW) - 1 ), "wrong link target\n" ); diff --git a/server/registry.c b/server/registry.c index 629d67c832f..76ea3912e03 100644 --- a/server/registry.c +++ b/server/registry.c @@ -1892,10 +1892,18 @@ void init_registry(void) 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\', 'P','e','r','f','l','i','b','\', '0','0','9'}; + static const WCHAR system[] = {'S','y','s','t','e','m'}; + static const WCHAR ccs[] = {'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t'}; + static const WCHAR cs001_path[] = {'\','R','E','G','I','S','T','R','Y','\', + 'M','a','c','h','i','n','e','\', + 'S','y','s','t','e','m','\', + 'C','o','n','t','r','o','l','S','e','t','0','0','1'}; static const struct unicode_str root_name = { REGISTRY, sizeof(REGISTRY) }; static const struct unicode_str HKLM_name = { HKLM, sizeof(HKLM) }; static const struct unicode_str HKU_name = { HKU_default, sizeof(HKU_default) }; static const struct unicode_str perflib_name = { perflib, sizeof(perflib) }; + static const struct unicode_str system_name = { system, sizeof(system) }; + static const struct unicode_str ccs_name = { ccs, sizeof(ccs) };
WCHAR *current_user_path; struct unicode_str current_user_str; @@ -1912,11 +1920,27 @@ void init_registry(void) assert( root_key ); release_object( root_key );
- /* load system.reg into Registry\Machine */ - + /* create the Registry\Machine key */ if (!(hklm = create_key_recursive( root_key, &HKLM_name, current_time ))) fatal_error( "could not create Machine registry key\n" );
+ /* create the Registry\Machine\System\CurrentControlSet symlink */ + if ((key = create_key_recursive( hklm, &system_name, current_time ))) + { + struct key *subkey; + subkey = create_key_object( &key->obj, &ccs_name, OBJ_OPENIF | OBJ_OPENLINK, + REG_OPTION_CREATE_LINK, current_time, NULL ); + release_object( key ); + if (subkey) + { + if (subkey->flags & KEY_SYMLINK) + set_value( subkey, &symlink_str, REG_LINK, cs001_path, sizeof(cs001_path) ); + release_object( subkey ); + } + } + + /* load system.reg into Registry\Machine */ + if (!load_init_registry_from_file( "system.reg", hklm )) { if ((p = getenv( "WINEARCH" )) && !strcmp( p, "win32" ))
From: Torge Matthies openglfreak@googlemail.com
Signed-off-by: Torge Matthies openglfreak@googlemail.com --- loader/wine.inf.in | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 382808c4876..8eaaddbef1e 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -602,6 +602,9 @@ HKLM,System\CurrentControlSet\Control\TimeZoneInformation,"TimeZoneKeyName",2,"" HKLM,System\CurrentControlSet\Control\VirtualDeviceDrivers,,16 HKLM,System\CurrentControlSet\Control\VMM32Files,,16 HKLM,System\Select,"Current",0x10003,1 +HKLM,System\Select,"Default",0x10003,1 +HKLM,System\Select,"Failed",0x10003,0 +HKLM,System\Select,"LastKnownGood",0x10003,1 HKCU,AppEvents\Schemes\Apps\Explorer\Navigating.Current,,,"" HKCU,Software\Microsoft\Protected Storage System Provider,,16 ; Some apps requires at least four subkeys of Active Setup\Installed Components
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=139106
Your paranoid android.
=== debian11 (build log) ===
Error: Mount manager not running, most likely your WINEPREFIX wasn't created correctly. Task: WineTest did not produce the win32 report
=== debian11b (build log) ===
Error: Mount manager not running, most likely your WINEPREFIX wasn't created correctly. Task: WineTest did not produce the wow32 report
@julliard If I make the symlink volatile, new / updated prefixes won't work correctly with older Wine versions, because the older versions would create a new CurrentControlSet key and populate it with the defaults. If I keep the key non-volatile, it will be backward-compatible.