mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 18:01:07 +00:00
[SHELL32]
- Only specific shell folders are supposed to return their display name. Consequently, only CRegFolder reads the registry now to get the display name of items. svn path=/trunk/; revision=73147
This commit is contained in:
parent
f2495ba422
commit
034a3f9f20
|
@ -113,8 +113,8 @@ HRESULT WINAPI CAdminToolsFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD d
|
|||
return m_pisfInner->GetDisplayNameOf(pidl, dwFlags, strRet);
|
||||
}
|
||||
|
||||
/* Return the display name from the registry */
|
||||
return HCR_GetClassName(CLSID_AdminFolderShortcut, strRet);
|
||||
ERR("Got empty pidl without SHGDN_FORPARSING\n");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
HRESULT WINAPI CAdminToolsFolder::SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, /* simple pidl */
|
||||
|
|
|
@ -683,7 +683,7 @@ HRESULT WINAPI CDesktopFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFl
|
|||
if ((GET_SHGDN_RELATION(dwFlags) == SHGDN_NORMAL) && (GET_SHGDN_FOR(dwFlags) & SHGDN_FORPARSING))
|
||||
return SHSetStrRet(strRet, sPathTarget);
|
||||
else
|
||||
return HCR_GetClassName(CLSID_ShellDesktop, strRet);
|
||||
return m_regFolder->GetDisplayNameOf(pidl, dwFlags, strRet);
|
||||
}
|
||||
|
||||
/* file system folder or file rooted at the desktop */
|
||||
|
|
|
@ -114,8 +114,8 @@ HRESULT WINAPI CFontsFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlag
|
|||
return m_pisfInner->GetDisplayNameOf(pidl, dwFlags, strRet);
|
||||
}
|
||||
|
||||
/* Return the display name from the registry */
|
||||
return HCR_GetClassName(CLSID_FontsFolderShortcut, strRet);
|
||||
ERR("Got empty pidl without SHGDN_FORPARSING\n");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
HRESULT WINAPI CFontsFolder::SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, /* simple pidl */
|
||||
|
|
|
@ -113,8 +113,8 @@ HRESULT WINAPI CMyDocsFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFla
|
|||
return m_pisfInner->GetDisplayNameOf(pidl, dwFlags, strRet);
|
||||
}
|
||||
|
||||
/* Return the display name from the registry */
|
||||
return HCR_GetClassName(CLSID_MyDocuments, strRet);
|
||||
ERR("Got empty pidl without SHGDN_FORPARSING\n");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
HRESULT WINAPI CMyDocsFolder::SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, /* simple pidl */
|
||||
|
|
|
@ -457,14 +457,11 @@ HRESULT WINAPI CNetFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CH
|
|||
*/
|
||||
HRESULT WINAPI CNetFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
|
||||
{
|
||||
if (!strRet)
|
||||
if (!strRet || !pidl || !pidl->mkid.cb)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if (!pidl->mkid.cb)
|
||||
return SHSetStrRet(strRet, IDS_NETWORKPLACE);
|
||||
#ifdef HACKY_UNC_PATHS
|
||||
else
|
||||
return SHSetStrRet(strRet, (LPCWSTR)pidl->mkid.abID);
|
||||
return SHSetStrRet(strRet, (LPCWSTR)pidl->mkid.abID);
|
||||
#endif
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
|
|
@ -367,13 +367,10 @@ HRESULT WINAPI CPrinterFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFl
|
|||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
if (!pidl->mkid.cb)
|
||||
return SHSetStrRet(strRet, IDS_PRINTERS);
|
||||
|
||||
p = _ILGetPrinterStruct(pidl);
|
||||
if (!p)
|
||||
{
|
||||
WARN("no printer struct\n");
|
||||
ERR("no printer struct\n");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
|
|
|
@ -627,19 +627,6 @@ HRESULT WINAPI CRecycleBin::GetDisplayNameOf(PCUITEMID_CHILD pidl, SHGDNF uFlags
|
|||
|
||||
TRACE("(%p, %p, %x, %p)\n", this, pidl, (unsigned int)uFlags, pName);
|
||||
|
||||
|
||||
if (_ILIsBitBucket (pidl))
|
||||
{
|
||||
WCHAR pszPath[100];
|
||||
|
||||
if (HCR_GetClassNameW(CLSID_RecycleBin, pszPath, MAX_PATH))
|
||||
{
|
||||
pName->uType = STRRET_WSTR;
|
||||
pName->pOleStr = StrDupW(pszPath);
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
|
||||
pFileDetails = _ILGetRecycleStruct(pidl);
|
||||
if (!pFileDetails)
|
||||
{
|
||||
|
|
|
@ -361,19 +361,26 @@ HRESULT WINAPI CRegFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags,
|
|||
|
||||
if (!pidl->mkid.cb)
|
||||
{
|
||||
LPWSTR pszPath = (LPWSTR)CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR));
|
||||
if (!pszPath)
|
||||
return E_OUTOFMEMORY;
|
||||
if ((GET_SHGDN_RELATION(dwFlags) == SHGDN_NORMAL) && (GET_SHGDN_FOR(dwFlags) & SHGDN_FORPARSING))
|
||||
{
|
||||
LPWSTR pszPath = (LPWSTR)CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR));
|
||||
if (!pszPath)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
/* parsing name like ::{...} */
|
||||
pszPath[0] = ':';
|
||||
pszPath[1] = ':';
|
||||
SHELL32_GUIDToStringW(m_guid, &pszPath[2]);
|
||||
/* parsing name like ::{...} */
|
||||
pszPath[0] = ':';
|
||||
pszPath[1] = ':';
|
||||
SHELL32_GUIDToStringW(m_guid, &pszPath[2]);
|
||||
|
||||
strRet->uType = STRRET_WSTR;
|
||||
strRet->pOleStr = pszPath;
|
||||
strRet->uType = STRRET_WSTR;
|
||||
strRet->pOleStr = pszPath;
|
||||
|
||||
return S_OK;
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return HCR_GetClassName(m_guid, strRet);
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT hr;
|
||||
|
|
Loading…
Reference in a new issue