# HG changeset patch # User Andre Heinecke # Date 1395681763 0 # Node ID bd5a5d3e56742c4eb0209bf415663cffa4794247 # Parent 095d0e7f8ed40904efee7e5baed70a207b3ea458 We decided to use bool. So let's use it. diff -r 095d0e7f8ed4 -r bd5a5d3e5674 cinst/main.c --- a/cinst/main.c Mon Mar 24 17:21:25 2014 +0000 +++ b/cinst/main.c Mon Mar 24 17:22:43 2014 +0000 @@ -233,7 +233,7 @@ } #ifdef WIN32 - return install_certificates_win((const char**) to_install, 1); + return install_certificates_win((const char**) to_install, true); //remove_certificates_win((const char**) to_remove, 1); #endif diff -r 095d0e7f8ed4 -r bd5a5d3e5674 cinst/windowsstore.c --- a/cinst/windowsstore.c Mon Mar 24 17:21:25 2014 +0000 +++ b/cinst/windowsstore.c Mon Mar 24 17:22:43 2014 +0000 @@ -25,17 +25,15 @@ return bufPtr; } -int install_certificates_win(const char **to_install, int user_store) +int install_certificates_win(const char **to_install, bool user_store) { int i = 0; HCERTSTORE hStore = NULL; if (user_store) { - // Access user store hStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER, L"Root"); } else { - // Access machine store hStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_LOCAL_MACHINE, L"Root"); } @@ -85,6 +83,7 @@ i++; free(buf); } + if(hStore) { CertCloseStore(hStore, 0); }