https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3a68bebf87e8254c97b193...
commit 3a68bebf87e8254c97b1938f0f4609a034ab8e06 Author: Giannis Adamopoulos gadamopoulos@reactos.org AuthorDate: Sun Nov 19 16:02:44 2017 +0200
[UXTHEME] EnumThemes: Don't fail if a theme doesn't have a tooltip. CORE-13732 --- dll/win32/uxtheme/system.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/dll/win32/uxtheme/system.c b/dll/win32/uxtheme/system.c index 6496377111..84d703d157 100644 --- a/dll/win32/uxtheme/system.c +++ b/dll/win32/uxtheme/system.c @@ -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));