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

This commit is contained in:
Huw Davies 2006-01-20 20:17:07 +01:00 committed by Alexandre Julliard
parent 8b0883576e
commit 51fd750707
3 changed files with 7 additions and 9 deletions

View File

@ -227,12 +227,7 @@ static BOOL GetName(LPSHELLFOLDER lpsf, LPCITEMIDLIST lpi, DWORD dwFlags, LPWSTR
TRACE("%p %p %lx %p\n", lpsf, lpi, dwFlags, lpFriendlyName); TRACE("%p %p %lx %p\n", lpsf, lpi, dwFlags, lpFriendlyName);
if (SUCCEEDED(IShellFolder_GetDisplayNameOf(lpsf, lpi, dwFlags, &str))) if (SUCCEEDED(IShellFolder_GetDisplayNameOf(lpsf, lpi, dwFlags, &str)))
{ bSuccess = StrRetToStrNW(lpFriendlyName, MAX_PATH, &str, lpi);
if (FAILED(StrRetToStrNW(lpFriendlyName, MAX_PATH, &str, lpi)))
{
bSuccess = FALSE;
}
}
else else
bSuccess = FALSE; bSuccess = FALSE;

View File

@ -133,7 +133,8 @@ BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR pa
ret = IShellFolder_GetDisplayNameOf(lsf, pidl, flag, &strret); ret = IShellFolder_GetDisplayNameOf(lsf, pidl, flag, &strret);
if (SUCCEEDED(ret)) if (SUCCEEDED(ret))
{ {
ret = StrRetToStrNW(path, MAX_PATH, &strret, pidl); if(!StrRetToStrNW(path, MAX_PATH, &strret, pidl))
ret = E_FAIL;
} }
} }
else else
@ -144,7 +145,8 @@ BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR pa
ret = IShellFolder_GetDisplayNameOf(psfParent, pidllast, flag, &strret); ret = IShellFolder_GetDisplayNameOf(psfParent, pidllast, flag, &strret);
if (SUCCEEDED(ret)) if (SUCCEEDED(ret))
{ {
ret = StrRetToStrNW(path, MAX_PATH, &strret, pidllast); if(!StrRetToStrNW(path, MAX_PATH, &strret, pidllast))
ret = E_FAIL;
} }
IShellFolder_Release(psfParent); IShellFolder_Release(psfParent);
} }

View File

@ -350,7 +350,8 @@ HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf,
hr = IShellFolder_GetDisplayNameOf (psfChild, pidlNext, dwFlags, &strTemp); hr = IShellFolder_GetDisplayNameOf (psfChild, pidlNext, dwFlags, &strTemp);
if (SUCCEEDED (hr)) { if (SUCCEEDED (hr)) {
hr = StrRetToStrNW (szOut, dwOutLen, &strTemp, pidlNext); if(!StrRetToStrNW (szOut, dwOutLen, &strTemp, pidlNext))
hr = E_FAIL;
} }
IShellFolder_Release (psfChild); IShellFolder_Release (psfChild);
} }