Nikolay Sivov : comdlg32: Add some traces for custom Places (Coverity).

Alexandre Julliard julliard at winehq.org
Mon Apr 2 16:32:52 CDT 2018


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sun Apr  1 11:32:23 2018 +0300

comdlg32: Add some traces for custom Places (Coverity).

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

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

diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c
index 43d5f41..7bed515 100644
--- a/dlls/comdlg32/filedlg.c
+++ b/dlls/comdlg32/filedlg.c
@@ -312,14 +312,21 @@ static void filedlg_collect_places_pidls(FileOpenDlgInfos *fodInfos)
             static const WCHAR placeW[] = {'P','l','a','c','e','%','d',0};
             WCHAR nameW[8];
             DWORD value;
+            HRESULT hr;
             WCHAR *str;
 
             sprintfW(nameW, placeW, i);
             if (get_config_key_dword(hkey, nameW, &value))
-                SHGetSpecialFolderLocation(NULL, value, &fodInfos->places[i]);
+            {
+                hr = SHGetSpecialFolderLocation(NULL, value, &fodInfos->places[i]);
+                if (FAILED(hr))
+                    WARN("Unrecognized special folder %u.\n", value);
+            }
             else if (get_config_key_string(hkey, nameW, &str))
             {
-                SHParseDisplayName(str, NULL, &fodInfos->places[i], 0, NULL);
+                hr = SHParseDisplayName(str, NULL, &fodInfos->places[i], 0, NULL);
+                if (FAILED(hr))
+                    WARN("Failed to parse custom places location, %s.\n", debugstr_w(str));
                 heap_free(str);
             }
         }




More information about the wine-cvs mailing list