Commit 6cbe072c authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

kernelbase: Use KEY_WOW64_64KEY flag when 64 bit registry access is assumed.

parent 61983465
......@@ -2778,6 +2778,28 @@ static void test_redirection(void)
RegCloseKey( root32 );
RegCloseKey( root64 );
err = RegCreateKeyExW( HKEY_LOCAL_MACHINE, L"Software\\WOW6432Node\\test1\\test2", 0, NULL, 0,
KEY_WRITE | KEY_WOW64_32KEY, NULL, &key, NULL );
ok(!err, "got %#lx.\n", err);
RegCloseKey(key);
err = RegCreateKeyExW( HKEY_LOCAL_MACHINE, L"Software\\test1\\test2", 0, NULL, 0, KEY_WRITE | KEY_WOW64_32KEY,
NULL, &key, NULL );
ok(!err, "got %#lx.\n", err);
RegCloseKey(key);
err = RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"Software\\test1\\test2", 0, KEY_WRITE | KEY_WOW64_32KEY, &key );
ok(!err, "got %#lx.\n", err);
RegCloseKey(key);
if (pRegDeleteTreeA)
{
err = pRegDeleteTreeA(HKEY_LOCAL_MACHINE, "Software\\WOW6432Node\\test1");
ok(!err, "got %#lx.\n", err);
err = pRegDeleteTreeA(HKEY_LOCAL_MACHINE, "Software\\test1");
ok(err == ERROR_FILE_NOT_FOUND, "got %#lx.\n", err);
}
/* Software\Classes is shared/reflected so behavior is different */
err = RegCreateKeyExA( HKEY_LOCAL_MACHINE, "Software\\Classes\\Wine",
......
......@@ -165,7 +165,7 @@ static HANDLE open_wow6432node( HANDLE key )
attr.Attributes = 0;
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
if (NtOpenKeyEx( &ret, MAXIMUM_ALLOWED, &attr, 0 )) return key;
if (NtOpenKeyEx( &ret, MAXIMUM_ALLOWED | KEY_WOW64_64KEY, &attr, 0 )) return key;
return ret;
}
......@@ -211,7 +211,7 @@ static NTSTATUS open_key( HKEY *retkey, HKEY root, UNICODE_STRING *name, DWORD o
static NTSTATUS open_subkey( HKEY *subkey, HKEY root, UNICODE_STRING *name, DWORD options, ACCESS_MASK access )
{
BOOL is_wow64_key = (is_win64 && (access & KEY_WOW64_32KEY)) || (is_wow64 && !(access & KEY_WOW64_64KEY));
ACCESS_MASK access_64 = access & ~KEY_WOW64_32KEY;
ACCESS_MASK access_64 = (access & ~KEY_WOW64_32KEY) | KEY_WOW64_64KEY;
DWORD i = 0, len = name->Length / sizeof(WCHAR);
WCHAR *buffer = name->Buffer;
UNICODE_STRING str;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment