ntdll: Use proper absolute paths for registry keys.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2022-07-04 14:38:35 +02:00
parent b2bf7b6b89
commit c6d9640007
4 changed files with 12 additions and 15 deletions

View file

@ -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 ))
{

View file

@ -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};

View file

@ -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','\\',

View file

@ -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;