diff --git a/dll/win32/shell32/CShellLink.cpp b/dll/win32/shell32/CShellLink.cpp index 5afc4b715e..02b85033fa 100644 --- a/dll/win32/shell32/CShellLink.cpp +++ b/dll/win32/shell32/CShellLink.cpp @@ -1876,7 +1876,17 @@ HRESULT STDMETHODCALLTYPE CShellLink::SetIconLocation(LPCWSTR pszIconPath, INT i */ // FIXME: http://stackoverflow.com/questions/2976489/ishelllinkseticonlocation-translates-my-icon-path-into-program-files-which-i // if (PathFullyUnExpandEnvStringsW(pszIconPath, szUnExpIconPath, _countof(szUnExpIconPath))) + bSuccess = PathUnExpandEnvStringsW(pszIconPath, szUnExpIconPath, _countof(szUnExpIconPath)); + +DbgPrint("bSuccess for UnExpand is %d.\n", bSuccess); +DbgPrint("pszIconPath is '%S' and szUnExpIconPath is '%S'.\n", pszIconPath, szUnExpIconPath); + + bSuccess = ExpandEnvironmentStringsW(pszIconPath, szUnExpIconPath, _countof(szUnExpIconPath) + 1); + +DbgPrint("bSuccess for Expand is %d.\n", bSuccess); +DbgPrint("pszIconPath is '%S' and szUnExpIconPath is '%S'.\n", pszIconPath, szUnExpIconPath); + if (bSuccess && wcscmp(pszIconPath, szUnExpIconPath) != 0) { /* Unexpansion succeeded, so we need an icon environment block */