mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-16 04:36:58 +00:00
kernelbase: Always try to open the Wow6432Node in open_key().
This commit is contained in:
parent
0da843f082
commit
31ee0b309b
|
@ -226,7 +226,6 @@ static NTSTATUS open_key( HKEY *retkey, HKEY root, UNICODE_STRING name, DWORD op
|
||||||
{
|
{
|
||||||
OBJECT_ATTRIBUTES attr;
|
OBJECT_ATTRIBUTES attr;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
BOOL force_wow32 = is_win64 && (access & KEY_WOW64_32KEY);
|
|
||||||
HANDLE subkey;
|
HANDLE subkey;
|
||||||
WCHAR *buffer = name.Buffer;
|
WCHAR *buffer = name.Buffer;
|
||||||
DWORD i, len = name.Length / sizeof(WCHAR);
|
DWORD i, len = name.Length / sizeof(WCHAR);
|
||||||
|
@ -240,7 +239,7 @@ static NTSTATUS open_key( HKEY *retkey, HKEY root, UNICODE_STRING name, DWORD op
|
||||||
attr.SecurityDescriptor = NULL;
|
attr.SecurityDescriptor = NULL;
|
||||||
attr.SecurityQualityOfService = NULL;
|
attr.SecurityQualityOfService = NULL;
|
||||||
|
|
||||||
if (!force_wow32)
|
if (!(is_win64 && (access & KEY_WOW64_32KEY)))
|
||||||
{
|
{
|
||||||
if (options & REG_OPTION_OPEN_LINK) attr.Attributes |= OBJ_OPENLINK;
|
if (options & REG_OPTION_OPEN_LINK) attr.Attributes |= OBJ_OPENLINK;
|
||||||
status = NtOpenKeyEx( (HANDLE *)retkey, access, &attr, options );
|
status = NtOpenKeyEx( (HANDLE *)retkey, access, &attr, options );
|
||||||
|
@ -278,16 +277,14 @@ static NTSTATUS open_key( HKEY *retkey, HKEY root, UNICODE_STRING name, DWORD op
|
||||||
buffer += i;
|
buffer += i;
|
||||||
len -= i;
|
len -= i;
|
||||||
|
|
||||||
if (force_wow32)
|
name.Buffer = buffer;
|
||||||
|
name.Length = len * sizeof(WCHAR);
|
||||||
|
if (!is_wow6432node( &name ))
|
||||||
{
|
{
|
||||||
name.Buffer = buffer;
|
if ((subkey = open_wow6432node( attr.RootDirectory )))
|
||||||
name.Length = len * sizeof(WCHAR);
|
|
||||||
if (is_wow6432node( &name )) force_wow32 = FALSE;
|
|
||||||
else if ((subkey = open_wow6432node( attr.RootDirectory )))
|
|
||||||
{
|
{
|
||||||
NtClose( attr.RootDirectory );
|
NtClose( attr.RootDirectory );
|
||||||
attr.RootDirectory = subkey;
|
attr.RootDirectory = subkey;
|
||||||
force_wow32 = FALSE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue