crypt32: Use public APIs to empty a store.
This commit is contained in:
parent
bc37988dff
commit
6aa10439a9
|
@ -317,10 +317,21 @@ static BOOL CRYPT_MemDeleteCrl(PWINECRYPT_CERTSTORE store, void *pCrlContext)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CRYPT_MemEmptyStore(PWINE_MEMSTORE store)
|
static void CRYPT_EmptyStore(HCERTSTORE store)
|
||||||
{
|
{
|
||||||
ContextList_Empty(store->certs);
|
PCCERT_CONTEXT cert;
|
||||||
ContextList_Empty(store->crls);
|
PCCRL_CONTEXT crl;
|
||||||
|
|
||||||
|
do {
|
||||||
|
cert = CertEnumCertificatesInStore(store, NULL);
|
||||||
|
if (cert)
|
||||||
|
CertDeleteCertificateFromStore(cert);
|
||||||
|
} while (cert);
|
||||||
|
do {
|
||||||
|
crl = CertEnumCRLsInStore(store, NULL);
|
||||||
|
if (crl)
|
||||||
|
CertDeleteCRLFromStore(crl);
|
||||||
|
} while (crl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WINAPI CRYPT_MemCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
|
static void WINAPI CRYPT_MemCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
|
||||||
|
@ -1359,7 +1370,7 @@ static BOOL WINAPI CRYPT_RegControl(HCERTSTORE hCertStore, DWORD dwFlags,
|
||||||
{
|
{
|
||||||
case CERT_STORE_CTRL_RESYNC:
|
case CERT_STORE_CTRL_RESYNC:
|
||||||
CRYPT_RegFlushStore(store, FALSE);
|
CRYPT_RegFlushStore(store, FALSE);
|
||||||
CRYPT_MemEmptyStore((PWINE_MEMSTORE)store->memStore);
|
CRYPT_EmptyStore(store->memStore);
|
||||||
CRYPT_RegReadFromReg(store);
|
CRYPT_RegReadFromReg(store);
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
break;
|
break;
|
||||||
|
@ -1758,7 +1769,7 @@ static BOOL WINAPI CRYPT_FileControl(HCERTSTORE hCertStore, DWORD dwFlags,
|
||||||
switch (dwCtrlType)
|
switch (dwCtrlType)
|
||||||
{
|
{
|
||||||
case CERT_STORE_CTRL_RESYNC:
|
case CERT_STORE_CTRL_RESYNC:
|
||||||
CRYPT_MemEmptyStore((PWINE_MEMSTORE)store->memStore);
|
CRYPT_EmptyStore(store->memStore);
|
||||||
CRYPT_ReadSerializedFile(store->file, store);
|
CRYPT_ReadSerializedFile(store->file, store);
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue