crypt32: Implement CertAddEncodedCertificateToSystemStoreA/W.

This commit is contained in:
Juan Lang 2009-11-03 13:54:15 -08:00 committed by Alexandre Julliard
parent 5df2626aae
commit d8094382a8
3 changed files with 47 additions and 2 deletions

View File

@ -71,6 +71,44 @@ BOOL WINAPI CertAddEncodedCertificateToStore(HCERTSTORE hCertStore,
return ret; return ret;
} }
BOOL WINAPI CertAddEncodedCertificateToSystemStoreA(LPCSTR pszCertStoreName,
const BYTE *pbCertEncoded, DWORD cbCertEncoded)
{
HCERTSTORE store;
BOOL ret = FALSE;
TRACE("(%s, %p, %d)\n", debugstr_a(pszCertStoreName), pbCertEncoded,
cbCertEncoded);
store = CertOpenSystemStoreA(0, pszCertStoreName);
if (store)
{
ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING,
pbCertEncoded, cbCertEncoded, CERT_STORE_ADD_USE_EXISTING, NULL);
CertCloseStore(store, 0);
}
return ret;
}
BOOL WINAPI CertAddEncodedCertificateToSystemStoreW(LPCWSTR pszCertStoreName,
const BYTE *pbCertEncoded, DWORD cbCertEncoded)
{
HCERTSTORE store;
BOOL ret = FALSE;
TRACE("(%s, %p, %d)\n", debugstr_w(pszCertStoreName), pbCertEncoded,
cbCertEncoded);
store = CertOpenSystemStoreW(0, pszCertStoreName);
if (store)
{
ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING,
pbCertEncoded, cbCertEncoded, CERT_STORE_ADD_USE_EXISTING, NULL);
CertCloseStore(store, 0);
}
return ret;
}
BOOL WINAPI CertAddCertificateLinkToStore(HCERTSTORE hCertStore, BOOL WINAPI CertAddCertificateLinkToStore(HCERTSTORE hCertStore,
PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition, PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition,
PCCERT_CONTEXT *ppCertContext) PCCERT_CONTEXT *ppCertContext)

View File

@ -5,8 +5,8 @@
@ stdcall CertAddEncodedCRLToStore(ptr long ptr long long ptr) @ stdcall CertAddEncodedCRLToStore(ptr long ptr long long ptr)
@ stdcall CertAddEncodedCTLToStore(ptr long ptr long long ptr) @ stdcall CertAddEncodedCTLToStore(ptr long ptr long long ptr)
@ stdcall CertAddEncodedCertificateToStore(ptr long ptr long long ptr) @ stdcall CertAddEncodedCertificateToStore(ptr long ptr long long ptr)
@ stub CertAddEncodedCertificateToSystemStoreA @ stdcall CertAddEncodedCertificateToSystemStoreA(str ptr long)
@ stub CertAddEncodedCertificateToSystemStoreW @ stdcall CertAddEncodedCertificateToSystemStoreW(wstr ptr long)
@ stdcall CertAddEnhancedKeyUsageIdentifier(ptr str) @ stdcall CertAddEnhancedKeyUsageIdentifier(ptr str)
@ stdcall CertAddSerializedElementToStore(ptr ptr long long long long ptr ptr) @ stdcall CertAddSerializedElementToStore(ptr ptr long long long long ptr ptr)
@ stdcall CertAddStoreToCollection(ptr ptr long long) @ stdcall CertAddStoreToCollection(ptr ptr long long)

View File

@ -4054,6 +4054,13 @@ BOOL WINAPI CertAddEncodedCertificateToStore(HCERTSTORE hCertStore,
DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded, DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded,
DWORD dwAddDisposition, PCCERT_CONTEXT *ppCertContext); DWORD dwAddDisposition, PCCERT_CONTEXT *ppCertContext);
BOOL WINAPI CertAddEncodedCertificateToSystemStoreA(LPCSTR pszCertStoreName,
const BYTE *pbCertEncoded, DWORD cbCertEncoded);
BOOL WINAPI CertAddEncodedCertificateToSystemStoreW(LPCWSTR pszCertStoreName,
const BYTE *pbCertEncoded, DWORD cbCertEncoded);
#define CertAddEncodedCertificateToSystemStore \
WINELIB_NAME_AW(CertAddEncodedCertificateToSystemStore)
BOOL WINAPI CertAddEncodedCRLToStore(HCERTSTORE hCertStore, BOOL WINAPI CertAddEncodedCRLToStore(HCERTSTORE hCertStore,
DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded, DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded,
DWORD dwAddDisposition, PCCRL_CONTEXT *ppCrlContext); DWORD dwAddDisposition, PCCRL_CONTEXT *ppCrlContext);