mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 01:42:30 +00:00
[SHELL32] Check the result from PathUnExpandEnvStringsW
This commit is contained in:
parent
608cb60e44
commit
19e9a44118
|
@ -1856,6 +1856,7 @@ HRESULT STDMETHODCALLTYPE CShellLink::SetIconLocation(LPCWSTR pszIconPath, INT i
|
||||||
{
|
{
|
||||||
HRESULT hr = E_FAIL;
|
HRESULT hr = E_FAIL;
|
||||||
WCHAR szUnExpIconPath[MAX_PATH];
|
WCHAR szUnExpIconPath[MAX_PATH];
|
||||||
|
BOOL bSuccess;
|
||||||
|
|
||||||
TRACE("(%p)->(path=%s iicon=%u)\n", this, debugstr_w(pszIconPath), iIcon);
|
TRACE("(%p)->(path=%s iicon=%u)\n", this, debugstr_w(pszIconPath), iIcon);
|
||||||
|
|
||||||
|
@ -1875,8 +1876,8 @@ HRESULT STDMETHODCALLTYPE CShellLink::SetIconLocation(LPCWSTR pszIconPath, INT i
|
||||||
*/
|
*/
|
||||||
// FIXME: http://stackoverflow.com/questions/2976489/ishelllinkseticonlocation-translates-my-icon-path-into-program-files-which-i
|
// FIXME: http://stackoverflow.com/questions/2976489/ishelllinkseticonlocation-translates-my-icon-path-into-program-files-which-i
|
||||||
// if (PathFullyUnExpandEnvStringsW(pszIconPath, szUnExpIconPath, _countof(szUnExpIconPath)))
|
// if (PathFullyUnExpandEnvStringsW(pszIconPath, szUnExpIconPath, _countof(szUnExpIconPath)))
|
||||||
PathUnExpandEnvStringsW(pszIconPath, szUnExpIconPath, _countof(szUnExpIconPath));
|
bSuccess = PathUnExpandEnvStringsW(pszIconPath, szUnExpIconPath, _countof(szUnExpIconPath));
|
||||||
if (wcscmp(pszIconPath, szUnExpIconPath) != 0)
|
if (bSuccess && wcscmp(pszIconPath, szUnExpIconPath) != 0)
|
||||||
{
|
{
|
||||||
/* Unexpansion succeeded, so we need an icon environment block */
|
/* Unexpansion succeeded, so we need an icon environment block */
|
||||||
EXP_SZ_LINK buffer;
|
EXP_SZ_LINK buffer;
|
||||||
|
|
Loading…
Reference in a new issue