https://git.reactos.org/?p=reactos.git;a=commitdiff;h=19e9a441183d907540bb22...
commit 19e9a441183d907540bb22f8711db281334467b9 Author: Mark Jansen mark.jansen@reactos.org AuthorDate: Sun Aug 26 22:38:27 2018 +0200 Commit: Mark Jansen mark.jansen@reactos.org CommitDate: Mon Aug 27 11:58:29 2018 +0200
[SHELL32] Check the result from PathUnExpandEnvStringsW --- dll/win32/shell32/CShellLink.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dll/win32/shell32/CShellLink.cpp b/dll/win32/shell32/CShellLink.cpp index 2b6b20020d..5afc4b715e 100644 --- a/dll/win32/shell32/CShellLink.cpp +++ b/dll/win32/shell32/CShellLink.cpp @@ -1856,6 +1856,7 @@ HRESULT STDMETHODCALLTYPE CShellLink::SetIconLocation(LPCWSTR pszIconPath, INT i { HRESULT hr = E_FAIL; WCHAR szUnExpIconPath[MAX_PATH]; + BOOL bSuccess;
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-transla... // if (PathFullyUnExpandEnvStringsW(pszIconPath, szUnExpIconPath, _countof(szUnExpIconPath))) - PathUnExpandEnvStringsW(pszIconPath, szUnExpIconPath, _countof(szUnExpIconPath)); - if (wcscmp(pszIconPath, szUnExpIconPath) != 0) + bSuccess = PathUnExpandEnvStringsW(pszIconPath, szUnExpIconPath, _countof(szUnExpIconPath)); + if (bSuccess && wcscmp(pszIconPath, szUnExpIconPath) != 0) { /* Unexpansion succeeded, so we need an icon environment block */ EXP_SZ_LINK buffer;