From 14c7a69c79e331f004eabd1bc2402a3023bc2c47 Mon Sep 17 00:00:00 2001 From: Selva Nair Date: Sun, 2 Apr 2023 13:02:09 -0400 Subject: [PATCH] fixup! Password-reveal: Respect group policy setting, if any - Minor edit in registry.c --- registry.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/registry.c b/registry.c index 94fce0ed..1e088a18 100644 --- a/registry.c +++ b/registry.c @@ -213,7 +213,7 @@ GetRegistryKeys () } /* Read group policy setting for password reveal */ - status = RegOpenKeyEx(HKEY_CURRENT_USER, L"Software\\Policies\\Microsoft\\Windows\\CredUI", 0, KEY_READ, ®key); + status = RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\Policies\\Microsoft\\Windows\\CredUI", 0, KEY_READ, ®key); if (status != ERROR_SUCCESS || !GetRegistryValueNumeric(regkey, L"DisablePasswordReveal", &o.disable_password_reveal)) { @@ -225,7 +225,9 @@ GetRegistryKeys () PrintDebug(L"from policy: %ls = %lu", L"DisablePasswordReveal", o.disable_password_reveal); } if (status == ERROR_SUCCESS) + { RegCloseKey(regkey); + } ExpandOptions (); return true;