[UXTHEME] EnumThemes: Don't fail if a theme doesn't have a tooltip. CORE-13732
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Sun, 19 Nov 2017 14:02:44 +0000 (16:02 +0200)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Sun, 19 Nov 2017 14:02:44 +0000 (16:02 +0200)
dll/win32/uxtheme/system.c

index 6496377..84d703d 100644 (file)
@@ -1259,14 +1259,20 @@ HRESULT WINAPI EnumThemes(LPCWSTR pszThemePath, ENUMTHEMEPROC callback,
                 wsprintfW(szPath, szFormat, szDir, wfd.cFileName, wfd.cFileName);
 
                 hr = GetThemeDocumentationProperty(szPath, szDisplayName, szName, sizeof(szName)/sizeof(szName[0]));
-                if(SUCCEEDED(hr))
-                    hr = GetThemeDocumentationProperty(szPath, szTooltip, szTip, sizeof(szTip)/sizeof(szTip[0]));
-                if(SUCCEEDED(hr)) {
-                    TRACE("callback(%s,%s,%s,%p)\n", debugstr_w(szPath), debugstr_w(szName), debugstr_w(szTip), lpData);
-                    if(!callback(NULL, szPath, szName, szTip, NULL, lpData)) {
-                        TRACE("callback ended enum\n");
-                        break;
-                    }
+                if(FAILED(hr))
+                {
+                    ERR("Failed to get theme name from %S\n", szPath);
+                    continue;
+                }
+
+                hr = GetThemeDocumentationProperty(szPath, szTooltip, szTip, sizeof(szTip)/sizeof(szTip[0]));
+                if (FAILED(hr))
+                    szTip[0] = 0;
+
+                TRACE("callback(%s,%s,%s,%p)\n", debugstr_w(szPath), debugstr_w(szName), debugstr_w(szTip), lpData);
+                if(!callback(NULL, szPath, szName, szTip, NULL, lpData)) {
+                    TRACE("callback ended enum\n");
+                    break;
                 }
             }
         } while(FindNextFileW(hFind, &wfd));