win32: change path to OpenSC windows registers
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4935 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
aed53df545
commit
e259021d36
@ -475,7 +475,7 @@ static void process_config_file(sc_context_t *ctx, struct _sc_ctx_options *opts)
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
conf_path = getenv("OPENSC_CONF");
|
conf_path = getenv("OPENSC_CONF");
|
||||||
if (!conf_path) {
|
if (!conf_path) {
|
||||||
rc = RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\OpenSC", 0, KEY_QUERY_VALUE, &hKey);
|
rc = RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\OpenSC Project\\OpenSC", 0, KEY_QUERY_VALUE, &hKey);
|
||||||
if (rc == ERROR_SUCCESS) {
|
if (rc == ERROR_SUCCESS) {
|
||||||
temp_len = PATH_MAX;
|
temp_len = PATH_MAX;
|
||||||
rc = RegQueryValueEx( hKey, "ConfigFile", NULL, NULL, (LPBYTE) temp_path, &temp_len);
|
rc = RegQueryValueEx( hKey, "ConfigFile", NULL, NULL, (LPBYTE) temp_path, &temp_len);
|
||||||
@ -486,7 +486,7 @@ static void process_config_file(sc_context_t *ctx, struct _sc_ctx_options *opts)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!conf_path) {
|
if (!conf_path) {
|
||||||
rc = RegOpenKeyEx( HKEY_LOCAL_MACHINE, "Software\\OpenSC", 0, KEY_QUERY_VALUE, &hKey );
|
rc = RegOpenKeyEx( HKEY_LOCAL_MACHINE, "Software\\OpenSC Project\\OpenSC", 0, KEY_QUERY_VALUE, &hKey );
|
||||||
if (rc == ERROR_SUCCESS) {
|
if (rc == ERROR_SUCCESS) {
|
||||||
temp_len = PATH_MAX;
|
temp_len = PATH_MAX;
|
||||||
rc = RegQueryValueEx( hKey, "ConfigFile", NULL, NULL, (LPBYTE) temp_path, &temp_len);
|
rc = RegQueryValueEx( hKey, "ConfigFile", NULL, NULL, (LPBYTE) temp_path, &temp_len);
|
||||||
|
@ -328,7 +328,7 @@ sc_profile_load(struct sc_profile *profile, const char *filename)
|
|||||||
}
|
}
|
||||||
if (!profile_dir) {
|
if (!profile_dir) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
rc = RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\OpenSC", 0, KEY_QUERY_VALUE, &hKey);
|
rc = RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\OpenSC Project\\OpenSC", 0, KEY_QUERY_VALUE, &hKey);
|
||||||
if (rc == ERROR_SUCCESS) {
|
if (rc == ERROR_SUCCESS) {
|
||||||
temp_len = PATH_MAX;
|
temp_len = PATH_MAX;
|
||||||
rc = RegQueryValueEx(hKey, "ProfileDir", NULL, NULL, (LPBYTE) temp_path, &temp_len);
|
rc = RegQueryValueEx(hKey, "ProfileDir", NULL, NULL, (LPBYTE) temp_path, &temp_len);
|
||||||
@ -337,7 +337,7 @@ sc_profile_load(struct sc_profile *profile, const char *filename)
|
|||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
}
|
}
|
||||||
if (!profile_dir) {
|
if (!profile_dir) {
|
||||||
rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\OpenSC", 0, KEY_QUERY_VALUE, &hKey);
|
rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\OpenSC Project\\OpenSC", 0, KEY_QUERY_VALUE, &hKey);
|
||||||
if (rc == ERROR_SUCCESS) {
|
if (rc == ERROR_SUCCESS) {
|
||||||
temp_len = PATH_MAX;
|
temp_len = PATH_MAX;
|
||||||
rc = RegQueryValueEx(hKey, "ProfileDir", NULL, NULL, (LPBYTE) temp_path, &temp_len);
|
rc = RegQueryValueEx(hKey, "ProfileDir", NULL, NULL, (LPBYTE) temp_path, &temp_len);
|
||||||
|
Loading…
Reference in New Issue
Block a user