shell: Fix incorrect usage of the return value of StrRetToStrNW
Huw D M Davies
h.davies1 at physics.ox.ac.uk
Fri Jan 20 11:23:11 CST 2006
Huw Davies <huw at codeweavers.com>
shell: Fix incorrect usage of the return value of StrRetToStrNW
--
Huw Davies
huw at codeweavers.com
diff --git a/dlls/shell32/brsfolder.c b/dlls/shell32/brsfolder.c
index f4c0876..aba8e23 100644
--- a/dlls/shell32/brsfolder.c
+++ b/dlls/shell32/brsfolder.c
@@ -227,12 +227,7 @@ static BOOL GetName(LPSHELLFOLDER lpsf,
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 fb85949..c4e54e0 100644
--- a/dlls/shell32/pidl.c
+++ b/dlls/shell32/pidl.c
@@ -133,7 +133,8 @@ BOOL WINAPI ILGetDisplayNameExW(LPSHELLF
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(LPSHELLF
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 09e46f1..29fd408 100644
--- a/dlls/shell32/shlfolder.c
+++ b/dlls/shell32/shlfolder.c
@@ -350,7 +350,8 @@ HRESULT SHELL32_GetDisplayNameOfChild (I
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);
}
More information about the wine-patches
mailing list