Module: wine Branch: master Commit: c6d96400076fd907378f8f2817d99ff4a4b1e9f4 URL: https://source.winehq.org/git/wine.git/?a=commit;h=c6d96400076fd907378f8f281...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Jul 4 14:38:35 2022 +0200
ntdll: Use proper absolute paths for registry keys.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ntdll/loader.c | 10 ++-------- dlls/ntdll/unix/env.c | 6 ++++-- dlls/ntdll/unix/system.c | 3 ++- dlls/ntdll/version.c | 8 ++++---- 4 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index d750f7a7579..20a96664825 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -3488,13 +3488,7 @@ static NTSTATUS query_string_option( HANDLE hkey, LPCWSTR name, ULONG type, NTSTATUS WINAPI LdrQueryImageFileExecutionOptions( const UNICODE_STRING *key, LPCWSTR value, ULONG type, void *data, ULONG in_size, ULONG *out_size ) { - static const WCHAR optionsW[] = {'M','a','c','h','i','n','e','\', - 'S','o','f','t','w','a','r','e','\', - 'M','i','c','r','o','s','o','f','t','\', - 'W','i','n','d','o','w','s',' ','N','T','\', - 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\', - 'I','m','a','g','e',' ','F','i','l','e',' ', - 'E','x','e','c','u','t','i','o','n',' ','O','p','t','i','o','n','s','\'}; + static const WCHAR optionsW[] = L"\Registry\Machine\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options"; WCHAR path[MAX_PATH + ARRAY_SIZE( optionsW )]; OBJECT_ATTRIBUTES attr; UNICODE_STRING name_str; @@ -3932,7 +3926,7 @@ static void load_global_options(void) attr.Attributes = OBJ_CASE_INSENSITIVE; attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - RtlInitUnicodeString( &name_str, L"Machine\System\CurrentControlSet\Control\Session Manager" ); + RtlInitUnicodeString( &name_str, L"\Registry\Machine\System\CurrentControlSet\Control\Session Manager" );
if (!NtOpenKey( &hkey, KEY_QUERY_VALUE, &attr )) { diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index f69e4e80f0d..161367e354f 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -1725,11 +1725,13 @@ static ULONG get_dword_option( HANDLE key, const WCHAR *name, ULONG defval ) */ static void load_global_options( const UNICODE_STRING *image ) { - static const WCHAR optionsW[] = {'M','a','c','h','i','n','e','\','S','o','f','t','w','a','r','e','\', + static const WCHAR optionsW[] = {'\','R','e','g','i','s','t','r','y','\', + 'M','a','c','h','i','n','e','\','S','o','f','t','w','a','r','e','\', 'M','i','c','r','o','s','o','f','t','\','W','i','n','d','o','w','s',' ','N','T','\', 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\', 'I','m','a','g','e',' ','F','i','l','e',' ','E','x','e','c','u','t','i','o','n',' ','O','p','t','i','o','n','s',0}; - static const WCHAR sessionW[] = {'M','a','c','h','i','n','e','\','S','y','s','t','e','m','\', + static const WCHAR sessionW[] = {'\','R','e','g','i','s','t','r','y','\', + 'M','a','c','h','i','n','e','\','S','y','s','t','e','m','\', 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\', 'C','o','n','t','r','o','l','\','S','e','s','s','i','o','n',' ','M','a','n','a','g','e','r',0}; static const WCHAR globalflagW[] = {'G','l','o','b','a','l','F','l','a','g',0}; diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 0df20aff3d5..f374fdec131 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -2115,7 +2115,8 @@ static void find_reg_tz_info(RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi, const char* static const WCHAR mui_stdW[] = { 'M','U','I','_','S','t','d',0 }; static const WCHAR mui_dltW[] = { 'M','U','I','_','D','l','t',0 }; static const WCHAR tziW[] = { 'T','Z','I',0 }; - static const WCHAR Time_ZonesW[] = { 'M','a','c','h','i','n','e','\', + static const WCHAR Time_ZonesW[] = { '\','R','e','g','i','s','t','r','y','\', + 'M','a','c','h','i','n','e','\', 'S','o','f','t','w','a','r','e','\', 'M','i','c','r','o','s','o','f','t','\', 'W','i','n','d','o','w','s',' ','N','T','\', diff --git a/dlls/ntdll/version.c b/dlls/ntdll/version.c index 492c24cc636..b9eabb31154 100644 --- a/dlls/ntdll/version.c +++ b/dlls/ntdll/version.c @@ -264,7 +264,7 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version ) attr.Attributes = 0; attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - RtlInitUnicodeString( &nameW, L"Machine\Software\Microsoft\Windows NT\CurrentVersion" ); + RtlInitUnicodeString( &nameW, L"\Registry\Machine\Software\Microsoft\Windows NT\CurrentVersion" );
if (NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr )) return FALSE;
@@ -311,7 +311,7 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
/* get service pack version */
- RtlInitUnicodeString( &nameW, L"Machine\System\CurrentControlSet\Control\Windows" ); + RtlInitUnicodeString( &nameW, L"\Registry\Machine\System\CurrentControlSet\Control\Windows" ); if (!NtOpenKey( &hkey2, KEY_ALL_ACCESS, &attr )) { RtlInitUnicodeString( &valueW, L"CSDVersion" ); @@ -329,7 +329,7 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
/* get product type */
- RtlInitUnicodeString( &nameW, L"Machine\System\CurrentControlSet\Control\ProductOptions" ); + RtlInitUnicodeString( &nameW, L"\Registry\Machine\System\CurrentControlSet\Control\ProductOptions" ); if (!NtOpenKey( &hkey2, KEY_ALL_ACCESS, &attr )) { RtlInitUnicodeString( &valueW, L"ProductType" ); @@ -373,7 +373,7 @@ static BOOL get_win9x_registry_version( RTL_OSVERSIONINFOEXW *version ) attr.Attributes = 0; attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - RtlInitUnicodeString( &nameW, L"Machine\Software\Microsoft\Windows\CurrentVersion" ); + RtlInitUnicodeString( &nameW, L"\Registry\Machine\Software\Microsoft\Windows\CurrentVersion" );
if (NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr )) return FALSE;