Commit 51fd7507 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

shell: Fix incorrect usage of the return value of StrRetToStrNW.

parent 8b088357
......@@ -227,12 +227,7 @@ static BOOL GetName(LPSHELLFOLDER lpsf, LPCITEMIDLIST lpi, DWORD dwFlags, LPWSTR
TRACE("%p %p %lx %p\n", lpsf, lpi, dwFlags, lpFriendlyName);
if (SUCCEEDED(IShellFolder_GetDisplayNameOf(lpsf, lpi, dwFlags, &str)))
{
if (FAILED(StrRetToStrNW(lpFriendlyName, MAX_PATH, &str, lpi)))
{
bSuccess = FALSE;
}
}
bSuccess = StrRetToStrNW(lpFriendlyName, MAX_PATH, &str, lpi);
else
bSuccess = FALSE;
......
......@@ -133,7 +133,8 @@ BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR pa
ret = IShellFolder_GetDisplayNameOf(lsf, pidl, flag, &strret);
if (SUCCEEDED(ret))
{
ret = StrRetToStrNW(path, MAX_PATH, &strret, pidl);
if(!StrRetToStrNW(path, MAX_PATH, &strret, pidl))
ret = E_FAIL;
}
}
else
......@@ -144,7 +145,8 @@ BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR pa
ret = IShellFolder_GetDisplayNameOf(psfParent, pidllast, flag, &strret);
if (SUCCEEDED(ret))
{
ret = StrRetToStrNW(path, MAX_PATH, &strret, pidllast);
if(!StrRetToStrNW(path, MAX_PATH, &strret, pidllast))
ret = E_FAIL;
}
IShellFolder_Release(psfParent);
}
......
......@@ -350,7 +350,8 @@ HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf,
hr = IShellFolder_GetDisplayNameOf (psfChild, pidlNext, dwFlags, &strTemp);
if (SUCCEEDED (hr)) {
hr = StrRetToStrNW (szOut, dwOutLen, &strTemp, pidlNext);
if(!StrRetToStrNW (szOut, dwOutLen, &strTemp, pidlNext))
hr = E_FAIL;
}
IShellFolder_Release (psfChild);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment