Skip to content

Commit

Permalink
Fix for registry interface changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ranvis committed Feb 11, 2023
1 parent 9be8821 commit 85d47e0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions windows/pageant.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "licence.h"
#include "ini.h"
#include "pageant-rc.h"
#include "platform.h"

#include <shellapi.h>

Expand Down Expand Up @@ -628,7 +629,7 @@ static int app_conf_get_int(const char *name, int def, int min, int max)
if (!get_ini_int(APPNAME, name, inifile, &value))
value = def;
} else {
HKEY hkey = open_regkey(false, HKEY_CURRENT_USER, PUTTY_REG_POS "\\" APPNAME);
HKEY hkey = open_regkey_ro(HKEY_CURRENT_USER, PUTTY_REG_POS "\\" APPNAME);
if (hkey) {
DWORD dw;
if (get_reg_dword(hkey, name, &dw))
Expand Down Expand Up @@ -802,7 +803,7 @@ static int do_accept_agent_request(int type, const RSAKey *rsaKey, const ssh2_us
if (get_use_inifile()) {
value = get_ini_sz(APPNAME, keyname, inifile);
} else {
HKEY hkey = open_regkey(false, HKEY_CURRENT_USER, PUTTY_REG_POS "\\" APPNAME);
HKEY hkey = open_regkey_ro(HKEY_CURRENT_USER, PUTTY_REG_POS "\\" APPNAME);
if (hkey) {
value = get_reg_sz(hkey, keyname);
close_regkey(hkey);
Expand Down Expand Up @@ -843,13 +844,13 @@ static int do_accept_agent_request(int type, const RSAKey *rsaKey, const ssh2_us
} else {
HKEY hkey;
if (info.dont_ask_again) {
hkey = open_regkey(true, HKEY_CURRENT_USER, PUTTY_REG_POS "\\" APPNAME);
hkey = create_regkey(HKEY_CURRENT_USER, PUTTY_REG_POS "\\" APPNAME);
if (hkey) {
put_reg_sz(hkey, keyname, (accept ? VALUE_ACCEPT : VALUE_REFUSE));
close_regkey(hkey);
}
} else {
hkey = open_regkey(false, HKEY_CURRENT_USER, PUTTY_REG_POS "\\" APPNAME);
hkey = open_regkey_rw(HKEY_CURRENT_USER, PUTTY_REG_POS "\\" APPNAME);
if (hkey) {
del_regkey(hkey, keyname);
close_regkey(hkey);
Expand Down

0 comments on commit 85d47e0

Please sign in to comment.