[DESK] Do not load system-defined class name

In fact Windows XP/2003 desk.cpl uses only user-defined values,
and performs fallback to shell32.dll strings in case they are missing.

CORE-18565 CORE-8427
This commit is contained in:
Stanislav Motylkov 2022-10-30 15:04:41 +03:00
parent 6f03be8570
commit 9c21d0c124
No known key found for this signature in database
GPG key ID: AFE513258CBA9E92

View file

@ -285,20 +285,11 @@ DesktopOnInitDialog(IN HWND hwndDlg, IN PDESKTOP_DATA pData)
if (SHGetValue(HKEY_CURRENT_USER, szClassPath, IconChange[i].IconName, &dwType,
pData->LocalIcon[i].szTitle, &cbData) != ERROR_SUCCESS || dwType != REG_SZ)
{
/* Try loading system-defined class icon title */
StringCchCopy(szClassPath, _countof(szClassPath), szSysClass);
StringCchCat(szClassPath, _countof(szClassPath), IconChange[i].CLSID);
cbData = sizeof(pData->LocalIcon[i].szTitle);
if (SHGetValue(HKEY_CLASSES_ROOT, szClassPath, IconChange[i].IconName, &dwType,
pData->LocalIcon[i].szTitle, &cbData) != ERROR_SUCCESS || dwType != REG_SZ)
{
/* Fallback to predefined strings */
LoadString(GetModuleHandle(TEXT("shell32.dll")),
IconChange[i].TitleId,
pData->LocalIcon[i].szTitle,
_countof(pData->LocalIcon[i].szTitle));
}
/* Fallback to predefined strings */
LoadString(GetModuleHandle(TEXT("shell32.dll")),
IconChange[i].TitleId,
pData->LocalIcon[i].szTitle,
_countof(pData->LocalIcon[i].szTitle));
}
hIcon = GetIconFromLocation(pData->LocalIcon[i].szPath);