Hans Leidekker : cryptui: Honour hDestCertStore in CryptUIWizImport, be more verbose about its shortcomings.
Alexandre Julliard
julliard at winehq.org
Wed Oct 22 08:00:25 CDT 2008
Module: wine
Branch: master
Commit: 8cbc6f951f6eee6c81545908fdc97360dc47b933
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8cbc6f951f6eee6c81545908fdc97360dc47b933
Author: Hans Leidekker <hans at codeweavers.com>
Date: Wed Oct 22 10:42:34 2008 +0200
cryptui: Honour hDestCertStore in CryptUIWizImport, be more verbose about its shortcomings.
---
dlls/cryptui/main.c | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c
index 0aab87e..482bd14 100644
--- a/dlls/cryptui/main.c
+++ b/dlls/cryptui/main.c
@@ -156,17 +156,21 @@ BOOL WINAPI CryptUIWizImport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardT
HeapFree(GetProcessHeap(), 0, buffer);
return FALSE;
}
- /* FIXME: verify certificate and determine store name dynamically */
- if (!(store = CertOpenStore(CERT_STORE_PROV_SYSTEM_W, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER, Root)))
+ if (hDestCertStore) store = hDestCertStore;
+ else
{
- WARN("unable to open certificate store\n");
- CertFreeCertificateContext(cert);
- HeapFree(GetProcessHeap(), 0, buffer);
- return FALSE;
+ FIXME("certificate store should be determined dynamically, picking Root store\n");
+ if (!(store = CertOpenStore(CERT_STORE_PROV_SYSTEM_W, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER, Root)))
+ {
+ WARN("unable to open certificate store\n");
+ CertFreeCertificateContext(cert);
+ HeapFree(GetProcessHeap(), 0, buffer);
+ return FALSE;
+ }
}
ret = CertAddCertificateContextToStore(store, cert, CERT_STORE_ADD_REPLACE_EXISTING, NULL);
- CertCloseStore(store, 0);
+ if (!hDestCertStore) CertCloseStore(store, 0);
CertFreeCertificateContext(cert);
HeapFree(GetProcessHeap(), 0, buffer);
return ret;
More information about the wine-cvs
mailing list