Michael Stefaniuc : bcrypt/tests: Use wide-char string literals.

Alexandre Julliard julliard at winehq.org
Thu Oct 8 15:20:04 CDT 2020


Module: wine
Branch: master
Commit: d541f5cffead2adc08f8b2200d6465dd1a8a35ad
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=d541f5cffead2adc08f8b2200d6465dd1a8a35ad

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Wed Oct  7 23:34:28 2020 +0200

bcrypt/tests: Use wide-char string literals.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/bcrypt/tests/bcrypt.c | 26 ++++++--------------------
 1 file changed, 6 insertions(+), 20 deletions(-)

diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index 7fdc0ac7fb..d499ce65a6 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -99,33 +99,20 @@ static void test_BCryptGenRandom(void)
 
 static void test_BCryptGetFipsAlgorithmMode(void)
 {
-    static const WCHAR policyKeyVistaW[] = {
-        'S','y','s','t','e','m','\\',
-        'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
-        'C','o','n','t','r','o','l','\\',
-        'L','s','a','\\',
-        'F','I','P','S','A','l','g','o','r','i','t','h','m','P','o','l','i','c','y',0};
-    static const WCHAR policyValueVistaW[] = {'E','n','a','b','l','e','d',0};
-    static const WCHAR policyKeyXPW[] = {
-        'S','y','s','t','e','m','\\',
-        'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
-        'C','o','n','t','r','o','l','\\',
-        'L','s','a',0};
-    static const WCHAR policyValueXPW[] = {
-        '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 enabled;
     DWORD value, count[2] = {sizeof(value), sizeof(value)};
     NTSTATUS ret;
 
-    if (RegOpenKeyW(HKEY_LOCAL_MACHINE, policyKeyVistaW, &hkey) == ERROR_SUCCESS &&
-        RegQueryValueExW(hkey, policyValueVistaW, NULL, NULL, (void *)&value, &count[0]) == ERROR_SUCCESS)
+    if (RegOpenKeyW(HKEY_LOCAL_MACHINE,
+                    L"System\\CurrentControlSet\\Control\\Lsa\\FIPSAlgorithmPolicy", &hkey) == ERROR_SUCCESS &&
+        RegQueryValueExW(hkey, L"Enabled", NULL, NULL, (void *)&value, &count[0]) == ERROR_SUCCESS)
     {
         expected = !!value;
     }
-      else if (RegOpenKeyW(HKEY_LOCAL_MACHINE, policyKeyXPW, &hkey) == ERROR_SUCCESS &&
-               RegQueryValueExW(hkey, policyValueXPW, NULL, NULL, (void *)&value, &count[0]) == ERROR_SUCCESS)
+      else if (RegOpenKeyW(HKEY_LOCAL_MACHINE, L"System\\CurrentControlSet\\Control\\Lsa", &hkey) == ERROR_SUCCESS &&
+               RegQueryValueExW(hkey, L"FIPSAlgorithmPolicy", NULL, NULL, (void *)&value, &count[0]) == ERROR_SUCCESS)
     {
         expected = !!value;
     }
@@ -2173,13 +2160,12 @@ static void test_ECDH(void)
 
 static void test_BCryptEnumContextFunctions(void)
 {
-    static const WCHAR sslW[] = {'S','S','L',0};
     CRYPT_CONTEXT_FUNCTIONS *buffer;
     NTSTATUS status;
     ULONG buflen;
 
     buffer = NULL;
-    status = pBCryptEnumContextFunctions( CRYPT_LOCAL, sslW, NCRYPT_SCHANNEL_INTERFACE, &buflen, &buffer );
+    status = pBCryptEnumContextFunctions( CRYPT_LOCAL, L"SSL", NCRYPT_SCHANNEL_INTERFACE, &buflen, &buffer );
     todo_wine ok( status == STATUS_SUCCESS, "got %08x\n", status);
     if (status == STATUS_SUCCESS) pBCryptFreeBuffer( buffer );
 }




More information about the wine-cvs mailing list