- Improve error checking

- Remove extensions which should be hidden (*.lnk)
- CID 82

svn path=/trunk/; revision=37067
This commit is contained in:
Johannes Anderwald 2008-10-29 16:19:09 +00:00
parent 1e6b6718f3
commit 59b469b1fb

View file

@ -424,8 +424,8 @@ static HRESULT WINAPI ISF_AdminTools_fnGetDisplayNameOf (IShellFolder2 * iface,
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) &&
(GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING))
wcscpy(pszPath, This->szTarget);
else
HCR_GetClassNameW(&CLSID_AdminFolderShortcut, pszPath, MAX_PATH);
else if (!HCR_GetClassNameW(&CLSID_AdminFolderShortcut, pszPath, MAX_PATH))
hr = E_FAIL;
}
else if (_ILIsPidlSimple(pidl))
{
@ -436,12 +436,23 @@ static HRESULT WINAPI ISF_AdminTools_fnGetDisplayNameOf (IShellFolder2 * iface,
wcscpy(pszPath, This->szTarget);
pOffset = PathAddBackslashW(pszPath);
if (pOffset)
_ILSimpleGetTextW(pidl, pOffset, MAX_PATH + 1 - (pOffset - pszPath));
{
if (!_ILSimpleGetTextW(pidl, pOffset, MAX_PATH + 1 - (pOffset - pszPath)))
hr = E_FAIL;
}
else
hr = E_FAIL;
}
else
{
_ILSimpleGetTextW(pidl, pszPath, MAX_PATH + 1);
}
{
if (_ILSimpleGetTextW(pidl, pszPath, MAX_PATH + 1))
{
if (SHELL_FS_HideExtension(pszPath))
PathRemoveExtensionW(pszPath);
}
else
hr = E_FAIL;
}
}
else if (_ILIsSpecialFolder(pidl))
{
@ -449,10 +460,10 @@ static HRESULT WINAPI ISF_AdminTools_fnGetDisplayNameOf (IShellFolder2 * iface,
if (bSimplePidl)
{
_ILSimpleGetTextW(pidl, pszPath, MAX_PATH);
}
if ((dwFlags & SHGDN_FORPARSING) && !bSimplePidl)
if (!_ILSimpleGetTextW(pidl, pszPath, MAX_PATH))
hr = E_FAIL;
}
else if ((dwFlags & SHGDN_FORPARSING) && !bSimplePidl)
{
int len = 0;
@ -473,11 +484,11 @@ static HRESULT WINAPI ISF_AdminTools_fnGetDisplayNameOf (IShellFolder2 * iface,
{
strRet->uType = STRRET_WSTR;
strRet->u.pOleStr = pszPath;
TRACE ("-- (%p)->(%s,0x%08x)\n", This, debugstr_w(strRet->u.pOleStr), hr);
}
else
CoTaskMemFree(pszPath);
TRACE ("-- (%p)->(%s,0x%08x)\n", This, debugstr_w(strRet->u.pOleStr), hr);
return hr;
}