Commit 217e0119 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

crypt32: Get rid of no longer needed hCertStore checks.

parent e7ab43c4
......@@ -555,15 +555,7 @@ BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext,
ret = FALSE;
break;
case CERT_ACCESS_STATE_PROP_ID:
if (pCertContext->hCertStore)
ret = CertGetStoreProperty(pCertContext->hCertStore, dwPropId,
pvData, pcbData);
else
{
DWORD state = 0;
ret = CertContext_CopyParam(pvData, pcbData, &state, sizeof(state));
}
ret = CertGetStoreProperty(cert->ctx.hCertStore, dwPropId, pvData, pcbData);
break;
case CERT_KEY_PROV_HANDLE_PROP_ID:
{
......
......@@ -499,14 +499,7 @@ BOOL WINAPI CertGetCRLContextProperty(PCCRL_CONTEXT pCRLContext,
}
else
{
if (pCRLContext->hCertStore)
ret = CertGetStoreProperty(pCRLContext->hCertStore, dwPropId,
pvData, pcbData);
else
{
*(DWORD *)pvData = 0;
ret = TRUE;
}
ret = CertGetStoreProperty(pCRLContext->hCertStore, dwPropId, pvData, pcbData);
}
break;
default:
......
......@@ -341,26 +341,21 @@ PCCTL_CONTEXT WINAPI CertFindCTLInStore(HCERTSTORE hCertStore,
BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext)
{
WINECRYPT_CERTSTORE *hcs = pCtlContext->hCertStore;
ctl_t *ctl = ctl_from_ptr(pCtlContext);
BOOL ret;
TRACE("(%p)\n", pCtlContext);
if (!pCtlContext)
ret = TRUE;
else if (!pCtlContext->hCertStore)
ret = CertFreeCTLContext(pCtlContext);
else
{
WINECRYPT_CERTSTORE *hcs = pCtlContext->hCertStore;
ctl_t *ctl = ctl_from_ptr(pCtlContext);
return TRUE;
if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
ret = FALSE;
else
ret = hcs->vtbl->ctls.delete(hcs, &ctl->base);
if (ret)
ret = CertFreeCTLContext(pCtlContext);
}
if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
return FALSE;
ret = hcs->vtbl->ctls.delete(hcs, &ctl->base);
if (ret)
ret = CertFreeCTLContext(pCtlContext);
return ret;
}
......@@ -621,14 +616,7 @@ BOOL WINAPI CertGetCTLContextProperty(PCCTL_CONTEXT pCTLContext,
}
else
{
if (pCTLContext->hCertStore)
ret = CertGetStoreProperty(pCTLContext->hCertStore, dwPropId,
pvData, pcbData);
else
{
*(DWORD *)pvData = 0;
ret = TRUE;
}
ret = CertGetStoreProperty(pCTLContext->hCertStore, dwPropId, pvData, pcbData);
}
break;
default:
......
......@@ -949,24 +949,17 @@ PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore, PCCERT_
BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext)
{
BOOL ret;
WINECRYPT_CERTSTORE *hcs = pCertContext->hCertStore;
TRACE("(%p)\n", pCertContext);
if (!pCertContext)
ret = TRUE;
else if (!pCertContext->hCertStore)
ret = CertFreeCertificateContext(pCertContext);
else
{
WINECRYPT_CERTSTORE *hcs = pCertContext->hCertStore;
return TRUE;
if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
ret = FALSE;
else
ret = hcs->vtbl->certs.delete(hcs, &cert_from_ptr(pCertContext)->base);
}
return ret;
if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
return FALSE;
return hcs->vtbl->certs.delete(hcs, &cert_from_ptr(pCertContext)->base);
}
BOOL WINAPI CertAddCRLContextToStore(HCERTSTORE hCertStore,
......@@ -1091,25 +1084,20 @@ BOOL WINAPI CertAddCRLContextToStore(HCERTSTORE hCertStore,
BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext)
{
WINECRYPT_CERTSTORE *hcs = pCrlContext->hCertStore;
BOOL ret;
TRACE("(%p)\n", pCrlContext);
if (!pCrlContext)
ret = TRUE;
else if (!pCrlContext->hCertStore)
ret = CertFreeCRLContext(pCrlContext);
else
{
WINECRYPT_CERTSTORE *hcs = pCrlContext->hCertStore;
return TRUE;
if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
ret = FALSE;
else
ret = hcs->vtbl->crls.delete(hcs, &crl_from_ptr(pCrlContext)->base);
if (ret)
ret = CertFreeCRLContext(pCrlContext);
}
if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
return FALSE;
ret = hcs->vtbl->crls.delete(hcs, &crl_from_ptr(pCrlContext)->base);
if (ret)
ret = CertFreeCRLContext(pCrlContext);
return ret;
}
......
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