Signed-off-by: Serge Gautherie winehq-git_serge_180711@gautherie.fr --- Suggested follow-up TODO: Add a testcase where these flags make a difference, which I am not familiar with. --- dlls/advapi32/tests/registry.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index e4d4893..7eec709 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -772,10 +772,28 @@ static void test_get_value(void) ok(type == REG_DWORD, "type=%d\n", type); ok(dw == 0x12345678, "dw=%d\n", dw);
+ /* Check RRF_SUBKEY_WOW64*KEY validation on a case without a subkey */ + ret = pRegGetValueA(hkey_main, NULL, "DWORD", RRF_RT_REG_DWORD | RRF_SUBKEY_WOW6464KEY | RRF_SUBKEY_WOW6432KEY, NULL, NULL, NULL); + ok(ret == ERROR_INVALID_PARAMETER || broken(ret == ERROR_SUCCESS), /* Before Win10 */ + "ret=%d\n", ret); + ret = pRegGetValueA(hkey_main, NULL, "DWORD", RRF_RT_REG_DWORD | RRF_SUBKEY_WOW6464KEY, NULL, NULL, NULL); + ok(ret == ERROR_SUCCESS, "ret=%d\n", ret); + ret = pRegGetValueA(hkey_main, NULL, "DWORD", RRF_RT_REG_DWORD | RRF_SUBKEY_WOW6432KEY, NULL, NULL, NULL); + ok(ret == ERROR_SUCCESS, "ret=%d\n", ret); + /* Query by subkey-name */ ret = pRegGetValueA(HKEY_CURRENT_USER, "Software\Wine\Test", "DWORD", RRF_RT_REG_DWORD, NULL, NULL, NULL); ok(ret == ERROR_SUCCESS, "ret=%d\n", ret);
+ /* Check RRF_SUBKEY_WOW64*KEY validation on a case with a subkey */ + ret = pRegGetValueA(HKEY_CURRENT_USER, "Software\Wine\Test", "DWORD", RRF_RT_REG_DWORD | RRF_SUBKEY_WOW6464KEY | RRF_SUBKEY_WOW6432KEY, NULL, NULL, NULL); + ok(ret == ERROR_INVALID_PARAMETER || broken(ret == ERROR_SUCCESS), /* Before Win10 */ + "ret=%d\n", ret); + ret = pRegGetValueA(HKEY_CURRENT_USER, "Software\Wine\Test", "DWORD", RRF_RT_REG_DWORD | RRF_SUBKEY_WOW6464KEY, NULL, NULL, NULL); + ok(ret == ERROR_SUCCESS, "ret=%d\n", ret); + ret = pRegGetValueA(HKEY_CURRENT_USER, "Software\Wine\Test", "DWORD", RRF_RT_REG_DWORD | RRF_SUBKEY_WOW6432KEY, NULL, NULL, NULL); + ok(ret == ERROR_SUCCESS, "ret=%d\n", ret); + /* Query REG_DWORD using RRF_RT_REG_BINARY (restricted) */ size = type = dw = 0xdeadbeef; ret = pRegGetValueA(hkey_main, NULL, "DWORD", RRF_RT_REG_BINARY, &type, &dw, &size);
On 3/21/20 10:21 AM, Serge Gautherie wrote:
Signed-off-by: Serge Gautherie winehq-git_serge_180711@gautherie.fr
Suggested follow-up TODO: Add a testcase where these flags make a difference, which I am not familiar with.
HKLM\Software is reflected.
dlls/advapi32/tests/registry.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index e4d4893..7eec709 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -772,10 +772,28 @@ static void test_get_value(void) ok(type == REG_DWORD, "type=%d\n", type); ok(dw == 0x12345678, "dw=%d\n", dw);
/* Check RRF_SUBKEY_WOW64*KEY validation on a case without a subkey */
ret = pRegGetValueA(hkey_main, NULL, "DWORD", RRF_RT_REG_DWORD | RRF_SUBKEY_WOW6464KEY | RRF_SUBKEY_WOW6432KEY, NULL, NULL, NULL);
ok(ret == ERROR_INVALID_PARAMETER || broken(ret == ERROR_SUCCESS), /* Before Win10 */
"ret=%d\n", ret);
ret = pRegGetValueA(hkey_main, NULL, "DWORD", RRF_RT_REG_DWORD | RRF_SUBKEY_WOW6464KEY, NULL, NULL, NULL);
ok(ret == ERROR_SUCCESS, "ret=%d\n", ret);
ret = pRegGetValueA(hkey_main, NULL, "DWORD", RRF_RT_REG_DWORD | RRF_SUBKEY_WOW6432KEY, NULL, NULL, NULL);
ok(ret == ERROR_SUCCESS, "ret=%d\n", ret);
/* Query by subkey-name */ ret = pRegGetValueA(HKEY_CURRENT_USER, "Software\Wine\Test", "DWORD", RRF_RT_REG_DWORD, NULL, NULL, NULL); ok(ret == ERROR_SUCCESS, "ret=%d\n", ret);
/* Check RRF_SUBKEY_WOW64*KEY validation on a case with a subkey */
ret = pRegGetValueA(HKEY_CURRENT_USER, "Software\Wine\Test", "DWORD", RRF_RT_REG_DWORD | RRF_SUBKEY_WOW6464KEY | RRF_SUBKEY_WOW6432KEY, NULL, NULL, NULL);
ok(ret == ERROR_INVALID_PARAMETER || broken(ret == ERROR_SUCCESS), /* Before Win10 */
"ret=%d\n", ret);
ret = pRegGetValueA(HKEY_CURRENT_USER, "Software\Wine\Test", "DWORD", RRF_RT_REG_DWORD | RRF_SUBKEY_WOW6464KEY, NULL, NULL, NULL);
ok(ret == ERROR_SUCCESS, "ret=%d\n", ret);
ret = pRegGetValueA(HKEY_CURRENT_USER, "Software\Wine\Test", "DWORD", RRF_RT_REG_DWORD | RRF_SUBKEY_WOW6432KEY, NULL, NULL, NULL);
ok(ret == ERROR_SUCCESS, "ret=%d\n", ret);
/* Query REG_DWORD using RRF_RT_REG_BINARY (restricted) */ size = type = dw = 0xdeadbeef; ret = pRegGetValueA(hkey_main, NULL, "DWORD", RRF_RT_REG_BINARY, &type, &dw, &size);