[UXTHEME] EnumThemes: Don't fail if a theme doesn't have a tooltip. CORE-13732

This commit is contained in:
Giannis Adamopoulos 2017-11-19 16:02:44 +02:00
parent 3dbd44fde1
commit 3a68bebf87

View 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));