crypt32: Use CertSaveStore to save file stores.

oldstable
Juan Lang 2007-09-27 14:01:30 -07:00 committed by Alexandre Julliard
parent 6471621f5e
commit 9c55a71f8f
1 changed files with 5 additions and 2 deletions

View File

@ -39,7 +39,8 @@ static void WINAPI CRYPT_FileCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
TRACE("(%p, %08x)\n", store, dwFlags);
if (store->dirty)
CRYPT_WriteSerializedStoreToFile(store->file, store->memStore);
CertSaveStore(store->memStore, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
CERT_STORE_SAVE_AS_STORE, CERT_STORE_SAVE_TO_FILE, store->file, 0);
CertCloseStore(store->memStore, dwFlags);
CloseHandle(store->file);
CryptMemFree(store);
@ -108,7 +109,9 @@ static BOOL WINAPI CRYPT_FileControl(HCERTSTORE hCertStore, DWORD dwFlags,
ret = FALSE;
}
else if (store->dirty)
ret = CRYPT_WriteSerializedStoreToFile(store->file, store->memStore);
ret = CertSaveStore(store->memStore,
X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
CERT_STORE_SAVE_AS_STORE, CERT_STORE_SAVE_TO_FILE, store->file, 0);
else
ret = TRUE;
break;