Alex Henrie : crypt32/tests: Print an error if CertOpenStore fails.

Alexandre Julliard julliard at winehq.org
Mon Mar 13 15:40:31 CDT 2017


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

Author: Alex Henrie <alexhenrie24 at gmail.com>
Date:   Thu Mar  9 23:03:50 2017 -0700

crypt32/tests: Print an error if CertOpenStore fails.

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Erich E. Hoover <erich.e.hoover at wine-staging.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/crypt32/tests/crl.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/dlls/crypt32/tests/crl.c b/dlls/crypt32/tests/crl.c
index 9515c38..c350b20 100644
--- a/dlls/crypt32/tests/crl.c
+++ b/dlls/crypt32/tests/crl.c
@@ -148,6 +148,7 @@ static void testAddCRL(void)
     BOOL ret;
     DWORD GLE;
 
+    ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError());
     if (!store) return;
 
     /* Bad CRL encoding type */
@@ -425,21 +426,24 @@ static const BYTE rootSignedCRL[] = {
 
 static void testFindCRL(void)
 {
-    HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
-     CERT_STORE_CREATE_NEW_FLAG, NULL);
+    HCERTSTORE store;
     PCCRL_CONTEXT context;
     PCCERT_CONTEXT cert, endCert, rootCert;
     CRL_FIND_ISSUED_FOR_PARA issuedForPara = { NULL, NULL };
     DWORD count, revoked_count;
     BOOL ret;
 
-    if (!store) return;
     if (!pCertFindCRLInStore || !pCertFindCertificateInCRL)
     {
         win_skip("CertFindCRLInStore or CertFindCertificateInCRL not available\n");
         return;
     }
 
+    store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
+                          CERT_STORE_CREATE_NEW_FLAG, NULL);
+    ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError());
+    if (!store) return;
+
     ret = CertAddEncodedCRLToStore(store, X509_ASN_ENCODING, signedCRL,
      sizeof(signedCRL), CERT_STORE_ADD_ALWAYS, NULL);
     ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError());
@@ -783,6 +787,7 @@ static void testGetCRLFromStore(void)
     DWORD flags;
     BOOL ret;
 
+    ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError());
     if (!store) return;
 
     /* Crash




More information about the wine-cvs mailing list