From 51fd75070798484ca37b9e623dc9108cefaa7c94 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Fri, 20 Jan 2006 20:17:07 +0100 Subject: [PATCH] shell: Fix incorrect usage of the return value of StrRetToStrNW. --- dlls/shell32/brsfolder.c | 7 +------ dlls/shell32/pidl.c | 6 ++++-- dlls/shell32/shlfolder.c | 3 ++- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/dlls/shell32/brsfolder.c b/dlls/shell32/brsfolder.c index f4c0876d994..aba8e23d0bf 100644 --- a/dlls/shell32/brsfolder.c +++ b/dlls/shell32/brsfolder.c @@ -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; diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c index fb859495cb0..c4e54e06418 100644 --- a/dlls/shell32/pidl.c +++ b/dlls/shell32/pidl.c @@ -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); } diff --git a/dlls/shell32/shlfolder.c b/dlls/shell32/shlfolder.c index 09e46f1aa17..29fd4080664 100644 --- a/dlls/shell32/shlfolder.c +++ b/dlls/shell32/shlfolder.c @@ -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); }