From 5f727cb2afbfafc3b396cf4902e55ca95dbc69d5 Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Tue, 26 Aug 2008 12:10:52 +0200 Subject: [PATCH] crypt32/tests: Use CryptAcquireContextA instead of CryptAcquireContextW. --- dlls/crypt32/tests/msg.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index 369576d3139..ba35b891311 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -1900,7 +1900,7 @@ static void test_signed_msg_get_param(void) if (!ret && GetLastError() == NTE_EXISTS) ret = pCryptAcquireContextA(&signer.hCryptProv, cspNameA, NULL, PROV_RSA_FULL, 0); - ok(ret, "CryptAcquireContextW failed: %x\n", GetLastError()); + ok(ret, "CryptAcquireContextA failed: %x\n", GetLastError()); msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, CMSG_CRYPT_RELEASE_CONTEXT_FLAG, CMSG_SIGNED, &signInfo, NULL, NULL); ok(msg != NULL, "CryptMsgOpenToEncode failed: %x\n", GetLastError()); @@ -1935,12 +1935,12 @@ static void test_signed_msg_get_param(void) signer.SignerId.dwIdChoice = CERT_ID_KEY_IDENTIFIER; signer.SignerId.KeyId.cbData = sizeof(serialNum); signer.SignerId.KeyId.pbData = (BYTE *)serialNum; - ret = CryptAcquireContextW(&signer.hCryptProv, cspNameW, NULL, + ret = pCryptAcquireContextA(&signer.hCryptProv, cspNameA, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); if (!ret && GetLastError() == NTE_EXISTS) - ret = CryptAcquireContextW(&signer.hCryptProv, cspNameW, NULL, + ret = pCryptAcquireContextA(&signer.hCryptProv, cspNameA, NULL, PROV_RSA_FULL, 0); - ok(ret, "CryptAcquireContextW failed: %x\n", GetLastError()); + ok(ret, "CryptAcquireContextA failed: %x\n", GetLastError()); msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, CMSG_CRYPT_RELEASE_CONTEXT_FLAG, CMSG_SIGNED, &signInfo, NULL, NULL); ok(msg != NULL, "CryptMsgOpenToEncode failed: %x\n", GetLastError()); @@ -2791,6 +2791,8 @@ static BOOL detect_nt(void) CMSG_SIGNER_ENCODE_INFO signer = { sizeof(signer), 0 }; CERT_INFO certInfo = { 0 }; + if (!pCryptAcquireContextW) + return FALSE; certInfo.SerialNumber.cbData = sizeof(serialNum); certInfo.SerialNumber.pbData = serialNum;