CryptUIWizImport with preselected store?

  • Thread starter Thread starter Headshaker
  • Start date Start date
H

Headshaker

Guest
I use the CryptUIWizImport function in my application, which works quite well, but now i want to change the behaviour of this function to set the destination store preselected, like in the windows built-in certmgr.msc tool (see the attached screenshot).

I read the official microsoft documenation, which says to set the hDestCertStoreparameter, which works, but i did not get the expected result comapared to the behaviour of certmgr.msc. it says inside the predefined store field Durch das Programm festgelegt (german language; engl: Defined by the program), but in the certmgr.msc when i use the import function i got this text Eigene Zertifikate (german language; engl. Own certificates). Both times i tried to import a certificate into the My store which is equivalent to german Eigene Zertifikate

My code looks this:

HCERTSTORE certStore = CertOpenStore(
CERT_STORE_PROV_SYSTEM,
X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
0,
CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_OPEN_EXISTING_FLAG,
L"My"
);

return CryptUIWizImport(
CRYPTUI_WIZ_IMPORT_ALLOW_CERT | CRYPTUI_WIZ_IMPORT_TO_CURRENTUSER,
nullptr,
nullptr,
nullptr,
certStore
);

So my code seems to look right or i am wrong?



Continue reading...
 
Back
Top