Jacek Caban : comdlg32: Improve error handling in get_config_key_string.

Alexandre Julliard julliard at winehq.org
Fri May 8 15:20:32 CDT 2020


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri May  8 16:41:12 2020 +0200

comdlg32: Improve error handling in get_config_key_string.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comdlg32/filedlg.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c
index 6b79fcfc83..538358bd5f 100644
--- a/dlls/comdlg32/filedlg.c
+++ b/dlls/comdlg32/filedlg.c
@@ -250,11 +250,10 @@ static BOOL get_config_key_string(HKEY hkey, const WCHAR *name, WCHAR **value)
     DWORD type, size;
     WCHAR *str;
 
-    if (hkey && !RegQueryValueExW(hkey, name, 0, &type, NULL, &size))
-    {
-        if (type != REG_SZ && type != REG_EXPAND_SZ)
-            return FALSE;
-    }
+    if (RegQueryValueExW(hkey, name, 0, &type, NULL, &size))
+        return FALSE;
+    if (type != REG_SZ && type != REG_EXPAND_SZ)
+        return FALSE;
 
     str = heap_alloc(size);
     if (RegQueryValueExW(hkey, name, 0, &type, (BYTE *)str, &size))




More information about the wine-cvs mailing list