crypt32: Always return TRUE from CertFreeCertificateContext.

This commit is contained in:
Jacek Caban 2013-10-18 10:50:03 +02:00 committed by Alexandre Julliard
parent 1c049e5031
commit f329de4df4
2 changed files with 9 additions and 6 deletions

View File

@ -370,13 +370,11 @@ PCCERT_CONTEXT WINAPI CertDuplicateCertificateContext(PCCERT_CONTEXT pCertContex
BOOL WINAPI CertFreeCertificateContext(PCCERT_CONTEXT pCertContext)
{
BOOL ret = TRUE;
TRACE("(%p)\n", pCertContext);
if (pCertContext)
ret = Context_Release(&cert_from_ptr(pCertContext)->base);
return ret;
Context_Release(&cert_from_ptr(pCertContext)->base);
return TRUE;
}
DWORD WINAPI CertEnumCertificateContextProperties(PCCERT_CONTEXT pCertContext,

View File

@ -725,7 +725,8 @@ static void testDupCert(void)
dupContext = CertDuplicateCertificateContext(context);
ok(dupContext == context, "context != dupContext\n");
CertFreeCertificateContext(dupContext);
ret = CertFreeCertificateContext(dupContext);
ok(ret, "CertFreeCertificateContext failed\n");
store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL);
ok(store != NULL, "CertOpenStore failed: %d\n", GetLastError());
@ -760,7 +761,8 @@ static void testDupCert(void)
ok(context2->hCertStore == context->hCertStore, "Unexpected hCertStore\n");
CertFreeCertificateContext(context2);
CertFreeCertificateContext(context);
ret = CertFreeCertificateContext(context);
ok(ret, "CertFreeCertificateContext failed\n");
CertCloseStore(store, 0);
CertCloseStore(store2, 0);
@ -768,6 +770,9 @@ static void testDupCert(void)
SetLastError(0xdeadbeef);
context = CertDuplicateCertificateContext(NULL);
ok(context == NULL, "Expected context to be NULL\n");
ret = CertFreeCertificateContext(NULL);
ok(ret, "CertFreeCertificateContext failed\n");
}
static void testLinkCert(void)