Commit b5e5be13 authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

bcrypt/tests: Workaround RegGetValueW not being present in XP.

parent c64cdc1f
...@@ -75,18 +75,19 @@ static void test_BCryptGetFipsAlgorithmMode(void) ...@@ -75,18 +75,19 @@ static void test_BCryptGetFipsAlgorithmMode(void)
'L','s','a',0}; 'L','s','a',0};
static const WCHAR policyValueXPW[] = { static const WCHAR policyValueXPW[] = {
'F','I','P','S','A','l','g','o','r','i','t','h','m','P','o','l','i','c','y',0}; 'F','I','P','S','A','l','g','o','r','i','t','h','m','P','o','l','i','c','y',0};
HKEY hkey = NULL;
BOOLEAN expected; BOOLEAN expected;
BOOLEAN enabled; BOOLEAN enabled;
DWORD value, count[2] = {sizeof(value), sizeof(value)}; DWORD value, count[2] = {sizeof(value), sizeof(value)};
NTSTATUS ret; NTSTATUS ret;
if (!RegGetValueW(HKEY_LOCAL_MACHINE, policyKeyVistaW, policyValueVistaW, if (RegOpenKeyW(HKEY_LOCAL_MACHINE, policyKeyVistaW, &hkey) == ERROR_SUCCESS &&
RRF_RT_REG_DWORD, NULL, &value, &count[0])) RegQueryValueExW(hkey, policyValueVistaW, NULL, NULL, (void *)&value, &count[0]) == ERROR_SUCCESS)
{ {
expected = !!value; expected = !!value;
} }
else if (!RegGetValueW(HKEY_LOCAL_MACHINE, policyKeyXPW, policyValueXPW, else if (RegOpenKeyW(HKEY_LOCAL_MACHINE, policyKeyXPW, &hkey) == ERROR_SUCCESS &&
RRF_RT_REG_DWORD, NULL, &value, &count[1])) RegQueryValueExW(hkey, policyValueXPW, NULL, NULL, (void *)&value, &count[0]) == ERROR_SUCCESS)
{ {
expected = !!value; expected = !!value;
} }
...@@ -96,6 +97,7 @@ static void test_BCryptGetFipsAlgorithmMode(void) ...@@ -96,6 +97,7 @@ static void test_BCryptGetFipsAlgorithmMode(void)
todo_wine todo_wine
ok(0, "Neither XP or Vista key is present\n"); ok(0, "Neither XP or Vista key is present\n");
} }
RegCloseKey(hkey);
ret = BCryptGetFipsAlgorithmMode(&enabled); ret = BCryptGetFipsAlgorithmMode(&enabled);
ok(ret == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got 0x%x\n", ret); ok(ret == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got 0x%x\n", ret);
......
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