Dmitry Timoshkov : crypt32/tests: Link to BCryptDestroyKey directly.

Alexandre Julliard julliard at winehq.org
Wed Apr 14 16:01:19 CDT 2021


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

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Wed Apr 14 13:15:00 2021 +0300

crypt32/tests: Link to BCryptDestroyKey directly.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/crypt32/tests/encode.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c
index 7c72eba1b9b..9597f1dfec1 100644
--- a/dlls/crypt32/tests/encode.c
+++ b/dlls/crypt32/tests/encode.c
@@ -30,7 +30,6 @@
 
 static BOOL (WINAPI *pCryptDecodeObjectEx)(DWORD,LPCSTR,const BYTE*,DWORD,DWORD,PCRYPT_DECODE_PARA,void*,DWORD*);
 static BOOL (WINAPI *pCryptEncodeObjectEx)(DWORD,LPCSTR,const void*,DWORD,PCRYPT_ENCODE_PARA,void*,DWORD*);
-static DWORD (WINAPI *pBCryptDestroyKey)(BCRYPT_KEY_HANDLE);
 
 struct encodedInt
 {
@@ -8475,7 +8474,7 @@ static void testImportPublicKey(HCRYPTPROV csp, PCERT_PUBLIC_KEY_INFO info)
         ret = CryptImportPublicKeyInfoEx2(X509_ASN_ENCODING,
          &context->pCertInfo->SubjectPublicKeyInfo, 0, NULL, &key2);
         ok(ret, "CryptImportPublicKeyInfoEx2 failed: %08x\n", GetLastError());
-        if (pBCryptDestroyKey) pBCryptDestroyKey(key2);
+        BCryptDestroyKey(key2);
 
         CertFreeCertificateContext(context);
     }
@@ -8510,7 +8509,7 @@ START_TEST(encode)
 {
     static const DWORD encodings[] = { X509_ASN_ENCODING, PKCS_7_ASN_ENCODING,
      X509_ASN_ENCODING | PKCS_7_ASN_ENCODING };
-    HMODULE hCrypt32, hBcrypt;
+    HMODULE hCrypt32;
     DWORD i;
 
     hCrypt32 = GetModuleHandleA("crypt32.dll");
@@ -8522,9 +8521,6 @@ START_TEST(encode)
         return;
     }
 
-    hBcrypt = GetModuleHandleA("bcrypt.dll");
-    pBCryptDestroyKey = (void*)GetProcAddress(hBcrypt, "BCryptDestroyKey");
-
     for (i = 0; i < ARRAY_SIZE(encodings); i++)
     {
         test_encodeInt(encodings[i]);




More information about the wine-cvs mailing list