Hugh McMaster : regedit: Directly use RegQueryValueExW() instead of a helper function.

Alexandre Julliard julliard at winehq.org
Wed Jul 6 16:56:56 CDT 2022


Module: wine
Branch: master
Commit: 97a380209391fd65fc99f2ee2a69efc181662ea8
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=97a380209391fd65fc99f2ee2a69efc181662ea8

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Wed Jul  6 22:35:15 2022 +1000

regedit: Directly use RegQueryValueExW() instead of a helper function.

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/regedit/edit.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/programs/regedit/edit.c b/programs/regedit/edit.c
index b70176fbbc2..330b535d732 100644
--- a/programs/regedit/edit.c
+++ b/programs/regedit/edit.c
@@ -178,11 +178,6 @@ static INT_PTR CALLBACK bin_modify_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wPara
     return FALSE;
 }
 
-static BOOL value_exists(HWND hwnd, HKEY hKey, const WCHAR *value_name)
-{
-    return !RegQueryValueExW(hKey, value_name, NULL, NULL, NULL, NULL);
-}
-
 static LPWSTR read_value(HWND hwnd, HKEY hKey, LPCWSTR valueName, DWORD *lpType, LONG *len)
 {
     DWORD valueDataLen;
@@ -523,7 +518,7 @@ BOOL RenameValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR oldName, LPC
 	return FALSE;
     }
 
-    if (value_exists(hwnd, hKey, newName)) {
+    if (!RegQueryValueExW(hKey, newName, NULL, NULL, NULL, NULL)) {
         error_code_messagebox(hwnd, IDS_VALUE_EXISTS, oldName);
         goto done;
     }




More information about the wine-cvs mailing list