Commit 4c90bbd6 authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

crypt32/tests: Use A-version for registry functions.

parent 5e1ca160
...@@ -84,6 +84,9 @@ static const struct OIDToAlgID algIDToOID[] = { ...@@ -84,6 +84,9 @@ static const struct OIDToAlgID algIDToOID[] = {
{ szOID_OIWSEC_sha1, CALG_SHA }, { szOID_OIWSEC_sha1, CALG_SHA },
}; };
static const WCHAR bogusDll[] = { 'b','o','g','u','s','.','d','l','l',0 };
static const WCHAR bogus2Dll[] = { 'b','o','g','u','s','2','.','d','l','l',0 };
static void testOIDToAlgID(void) static void testOIDToAlgID(void)
{ {
int i; int i;
...@@ -264,7 +267,6 @@ static void test_installOIDFunctionAddress(void) ...@@ -264,7 +267,6 @@ static void test_installOIDFunctionAddress(void)
static void test_registerOIDFunction(void) static void test_registerOIDFunction(void)
{ {
static const WCHAR bogusDll[] = { 'b','o','g','u','s','.','d','l','l',0 };
BOOL ret; BOOL ret;
/* oddly, this succeeds under WinXP; the function name key is merely /* oddly, this succeeds under WinXP; the function name key is merely
...@@ -315,9 +317,6 @@ static void test_registerOIDFunction(void) ...@@ -315,9 +317,6 @@ static void test_registerOIDFunction(void)
ok(ret, "CryptUnregisterOIDFunction failed: %d\n", GetLastError()); ok(ret, "CryptUnregisterOIDFunction failed: %d\n", GetLastError());
} }
static const WCHAR bogusDll[] = { 'b','o','g','u','s','.','d','l','l',0 };
static const WCHAR bogus2Dll[] = { 'b','o','g','u','s','2','.','d','l','l',0 };
static void test_registerDefaultOIDFunction(void) static void test_registerDefaultOIDFunction(void)
{ {
static const char fmt[] = static const char fmt[] =
...@@ -354,24 +353,26 @@ static void test_registerDefaultOIDFunction(void) ...@@ -354,24 +353,26 @@ static void test_registerDefaultOIDFunction(void)
ok(ret, "CryptRegisterDefaultOIDFunction failed: %08x\n", GetLastError()); ok(ret, "CryptRegisterDefaultOIDFunction failed: %08x\n", GetLastError());
sprintf(buf, fmt, 0, func); sprintf(buf, fmt, 0, func);
rc = RegOpenKeyA(HKEY_LOCAL_MACHINE, buf, &key); rc = RegOpenKeyA(HKEY_LOCAL_MACHINE, buf, &key);
ok(rc == 0, "Expected key to exist, RegOpenKeyW failed: %ld\n", rc); ok(rc == 0, "Expected key to exist, RegOpenKeyA failed: %ld\n", rc);
if (rc == 0) if (rc == 0)
{ {
static const WCHAR dllW[] = { 'D','l','l',0 }; static const CHAR dllA[] = "Dll";
WCHAR dllBuf[MAX_PATH]; static const CHAR bogusDll_A[] = "bogus.dll";
static const CHAR bogus2Dll_A[] = "bogus2.dll";
CHAR dllBuf[MAX_PATH];
DWORD type, size; DWORD type, size;
LPWSTR ptr; LPSTR ptr;
size = sizeof(dllBuf) / sizeof(dllBuf[0]); size = sizeof(dllBuf) / sizeof(dllBuf[0]);
rc = RegQueryValueExW(key, dllW, NULL, &type, (LPBYTE)dllBuf, &size); rc = RegQueryValueExA(key, dllA, NULL, &type, (LPBYTE)dllBuf, &size);
ok(rc == 0, ok(rc == 0,
"Expected Dll value to exist, RegQueryValueExW failed: %ld\n", rc); "Expected Dll value to exist, RegQueryValueExA failed: %ld\n", rc);
ok(type == REG_MULTI_SZ, "Expected type REG_MULTI_SZ, got %d\n", type); ok(type == REG_MULTI_SZ, "Expected type REG_MULTI_SZ, got %d\n", type);
/* bogusDll was registered first, so that should be first */ /* bogusDll was registered first, so that should be first */
ptr = dllBuf; ptr = dllBuf;
ok(!lstrcmpiW(ptr, bogusDll), "Unexpected dll\n"); ok(!lstrcmpiA(ptr, bogusDll_A), "Unexpected dll\n");
ptr += lstrlenW(ptr) + 1; ptr += lstrlenA(ptr) + 1;
ok(!lstrcmpiW(ptr, bogus2Dll), "Unexpected dll\n"); ok(!lstrcmpiA(ptr, bogus2Dll_A), "Unexpected dll\n");
RegCloseKey(key); RegCloseKey(key);
} }
/* Unregister both of them */ /* Unregister both of them */
......
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