diff --git a/reactos/dll/win32/shell32/shfldr_admintools.c b/reactos/dll/win32/shell32/shfldr_admintools.c index 8ceb80b5cf1..10fdf94c58f 100644 --- a/reactos/dll/win32/shell32/shfldr_admintools.c +++ b/reactos/dll/win32/shell32/shfldr_admintools.c @@ -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; }