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