[PATCH] advapi32: support the KEY_WOW64_* flags
Mikołaj Zalewski
mikolaj at zalewski.pl
Wed Jul 23 16:36:06 CDT 2008
---
dlls/advapi32/registry.c | 2 +-
dlls/advapi32/tests/registry.c | 22 ++++++++++++++++++++++
include/winnt.h | 3 +++
3 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
index 55607c2..9018139 100644
--- a/dlls/advapi32/registry.c
+++ b/dlls/advapi32/registry.c
@@ -45,7 +45,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(reg);
/* allowed bits for access mask */
-#define KEY_ACCESS_MASK (KEY_ALL_ACCESS | MAXIMUM_ALLOWED)
+#define KEY_ACCESS_MASK (KEY_ALL_ACCESS | MAXIMUM_ALLOWED | KEY_WOW64_RES)
#define HKEY_SPECIAL_ROOT_FIRST HKEY_CLASSES_ROOT
#define HKEY_SPECIAL_ROOT_LAST HKEY_DYN_DATA
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
index 9d5d4c2..ac0cd08 100644
--- a/dlls/advapi32/tests/registry.c
+++ b/dlls/advapi32/tests/registry.c
@@ -949,6 +949,17 @@ static void test_reg_open_key(void)
ok(ret == ERROR_BAD_PATHNAME || /* NT/2k/XP */
ret == ERROR_FILE_NOT_FOUND /* Win9x,ME */
, "expected ERROR_BAD_PATHNAME or ERROR_FILE_NOT_FOUND, got %d\n", ret);
+
+ /* WOW64 flags */
+ hkResult = NULL;
+ ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software", 0, KEY_READ|KEY_WOW64_32KEY, &hkResult);
+ ok(ret == ERROR_SUCCESS && hkResult != NULL, "RegOpenKeyEx with KEY_WOW64_32KEY failed (err=%u)\n", ret);
+ RegCloseKey(hkResult);
+
+ hkResult = NULL;
+ ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software", 0, KEY_READ|KEY_WOW64_64KEY, &hkResult);
+ ok(ret == ERROR_SUCCESS && hkResult != NULL, "RegOpenKeyEx with KEY_WOW64_64KEY failed (err=%u)\n", ret);
+ RegCloseKey(hkResult);
}
static void test_reg_create_key(void)
@@ -974,6 +985,17 @@ static void test_reg_create_key(void)
ok(!ret, "RegCreateKeyExA failed with error %d\n", ret);
RegDeleteKey(hkey1, NULL);
}
+
+ /* WOW64 flags - open an existing key */
+ hkey1 = NULL;
+ ret = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software", 0, NULL, 0, KEY_READ|KEY_WOW64_32KEY, NULL, &hkey1, NULL);
+ ok(ret == ERROR_SUCCESS && hkey1 != NULL, "RegOpenKeyEx with KEY_WOW64_32KEY failed (err=%u)\n", ret);
+ RegCloseKey(hkey1);
+
+ hkey1 = NULL;
+ ret = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software", 0, NULL, 0, KEY_READ|KEY_WOW64_32KEY, NULL, &hkey1, NULL);
+ ok(ret == ERROR_SUCCESS && hkey1 != NULL, "RegOpenKeyEx with KEY_WOW64_64KEY failed (err=%u)\n", ret);
+ RegCloseKey(hkey1);
}
static void test_reg_close_key(void)
diff --git a/include/winnt.h b/include/winnt.h
index 28a3986..e8a37f5 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -4566,6 +4566,9 @@ typedef struct _TAPE_GET_MEDIA_PARAMETERS {
#define KEY_ENUMERATE_SUB_KEYS 0x00000008
#define KEY_NOTIFY 0x00000010
#define KEY_CREATE_LINK 0x00000020
+#define KEY_WOW64_64KEY 0x00000100
+#define KEY_WOW64_32KEY 0x00000200
+#define KEY_WOW64_RES 0x00000300
/* for RegKeyRestore flags */
#define REG_WHOLE_HIVE_VOLATILE 0x00000001
--
1.5.4
--------------020800020104030007080801--
More information about the wine-patches
mailing list