mirror of
https://github.com/reactos/reactos.git
synced 2025-07-30 19:01:54 +00:00
[RAPPS] Re-add support for icons named after the ini file
This commit is contained in:
parent
12caaece25
commit
7a2c1f7d0b
1 changed files with 19 additions and 5 deletions
|
@ -92,18 +92,32 @@ VOID CAvailableApplicationInfo::RetrieveGeneralInfo(AvailableStrings& AvlbString
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ATL::CStringW IconPath = AvlbStrings.szAppsPath;
|
||||||
|
PathAppendW(IconPath.GetBuffer(MAX_PATH), L"icons");
|
||||||
|
|
||||||
// TODO: are we going to support specify an URL for an icon ?
|
// TODO: are we going to support specify an URL for an icon ?
|
||||||
ATL::CStringW IconLocation;
|
ATL::CStringW IconLocation;
|
||||||
if (GetString(L"Icon", IconLocation))
|
if (GetString(L"Icon", IconLocation))
|
||||||
{
|
{
|
||||||
// TODO: Does the filename contain anything stuff like ":" "<" ">" ?
|
|
||||||
// these stuff may lead to security issues
|
|
||||||
ATL::CStringW IconPath = AvlbStrings.szAppsPath;
|
|
||||||
PathAppendW(IconPath.GetBuffer(MAX_PATH), L"icons");
|
|
||||||
BOOL bSuccess = PathAppendNoDirEscapeW(IconPath.GetBuffer(), IconLocation.GetString());
|
BOOL bSuccess = PathAppendNoDirEscapeW(IconPath.GetBuffer(), IconLocation.GetString());
|
||||||
IconPath.ReleaseBuffer();
|
IconPath.ReleaseBuffer();
|
||||||
|
|
||||||
if (bSuccess)
|
if (!bSuccess)
|
||||||
|
{
|
||||||
|
IconPath.Empty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// inifile.ico
|
||||||
|
PathAppendW(IconPath.GetBuffer(), m_szPkgName);
|
||||||
|
IconPath.ReleaseBuffer();
|
||||||
|
IconPath += L".ico";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IconPath.IsEmpty())
|
||||||
|
{
|
||||||
|
if (PathFileExistsW(IconPath))
|
||||||
{
|
{
|
||||||
m_szIconLocation = IconPath;
|
m_szIconLocation = IconPath;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue