Author: gadamopoulos
Date: Sat Nov 5 19:55:29 2016
New Revision: 73147
URL:
http://svn.reactos.org/svn/reactos?rev=73147&view=rev
Log:
[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.
Modified:
trunk/reactos/dll/win32/shell32/folders/CAdminToolsFolder.cpp
trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp
trunk/reactos/dll/win32/shell32/folders/CFontsFolder.cpp
trunk/reactos/dll/win32/shell32/folders/CMyDocsFolder.cpp
trunk/reactos/dll/win32/shell32/folders/CNetFolder.cpp
trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.cpp
trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp
trunk/reactos/dll/win32/shell32/folders/CRegFolder.cpp
Modified: trunk/reactos/dll/win32/shell32/folders/CAdminToolsFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CAdminToolsFolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/CAdminToolsFolder.cpp [iso-8859-1] Sat Nov 5
19:55:29 2016
@@ -113,8 +113,8 @@
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 */
Modified: trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp [iso-8859-1] Sat Nov 5
19:55:29 2016
@@ -683,7 +683,7 @@
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 */
Modified: trunk/reactos/dll/win32/shell32/folders/CFontsFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CFontsFolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/CFontsFolder.cpp [iso-8859-1] Sat Nov 5
19:55:29 2016
@@ -114,8 +114,8 @@
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 */
Modified: trunk/reactos/dll/win32/shell32/folders/CMyDocsFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CMyDocsFolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/CMyDocsFolder.cpp [iso-8859-1] Sat Nov 5
19:55:29 2016
@@ -113,8 +113,8 @@
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 */
Modified: trunk/reactos/dll/win32/shell32/folders/CNetFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CNetFolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/CNetFolder.cpp [iso-8859-1] Sat Nov 5
19:55:29 2016
@@ -457,14 +457,11 @@
*/
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;
}
Modified: trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.cpp [iso-8859-1] Sat Nov 5
19:55:29 2016
@@ -367,13 +367,10 @@
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;
}
Modified: trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp [iso-8859-1] Sat Nov 5
19:55:29 2016
@@ -626,19 +626,6 @@
LPWSTR pFileName;
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)
Modified: trunk/reactos/dll/win32/shell32/folders/CRegFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CRegFolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/CRegFolder.cpp [iso-8859-1] Sat Nov 5
19:55:29 2016
@@ -361,19 +361,26 @@
if (!pidl->mkid.cb)
{
- 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]);
-
- strRet->uType = STRRET_WSTR;
- strRet->pOleStr = pszPath;
-
- return S_OK;
+ 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]);
+
+ strRet->uType = STRRET_WSTR;
+ strRet->pOleStr = pszPath;
+
+ return S_OK;
+ }
+ else
+ {
+ return HCR_GetClassName(m_guid, strRet);
+ }
}
HRESULT hr;