Author: gadamopoulos
Date: Mon Aug 17 11:28:20 2015
New Revision: 68728
URL:
http://svn.reactos.org/svn/reactos?rev=68728&view=rev
Log:
[SHELL32]
- CAdminToolsFolder: return proper attributes when no items are specified. (This is fine
for reg folders but doesn't work for fs folders).
- CFontsFolder: fix GetAttributesOf as above. Fix Initialize method to return success. All
shell folders should support this method.
- CNetFolder: Return the name of the folder when asked.
- CPrinterFolder: It doesn't have subfolders so it doesn't make sense to implement
BindToObject.
Modified:
trunk/reactos/dll/win32/shell32/folders/CAdminToolsFolder.cpp
trunk/reactos/dll/win32/shell32/folders/CFontsFolder.cpp
trunk/reactos/dll/win32/shell32/folders/CNetFolder.cpp
trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.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] Mon Aug 17
11:28:20 2015
@@ -114,7 +114,31 @@
HRESULT WINAPI CAdminToolsFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl,
DWORD *rgfInOut)
{
- return m_pisfInner->GetAttributesOf(cidl, apidl, rgfInOut);
+ static const DWORD dwAdminToolsAttributes =
+ SFGAO_STORAGE | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSANCESTOR |
+ SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER;
+
+ if(cidl)
+ {
+ return m_pisfInner->GetAttributesOf(cidl, apidl, rgfInOut);
+ }
+ else
+ {
+ if (!rgfInOut)
+ return E_INVALIDARG;
+ if (cidl && !apidl)
+ return E_INVALIDARG;
+
+ if (*rgfInOut == 0)
+ *rgfInOut = ~0;
+
+ *rgfInOut &= dwAdminToolsAttributes;
+
+ /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
+ *rgfInOut &= ~SFGAO_VALIDATE;
+
+ return S_OK;
+ }
}
HRESULT WINAPI CAdminToolsFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl,
PCUITEMID_CHILD_ARRAY apidl,
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] Mon Aug 17
11:28:20 2015
@@ -111,7 +111,31 @@
HRESULT WINAPI CFontsFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl,
DWORD *rgfInOut)
{
- return m_pisfInner->GetAttributesOf(cidl, apidl, rgfInOut);
+ static const DWORD dwFontsAttributes =
+ SFGAO_STORAGE | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSANCESTOR |
+ SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER;
+
+ if(cidl)
+ {
+ return m_pisfInner->GetAttributesOf(cidl, apidl, rgfInOut);
+ }
+ else
+ {
+ if (!rgfInOut)
+ return E_INVALIDARG;
+ if (cidl && !apidl)
+ return E_INVALIDARG;
+
+ if (*rgfInOut == 0)
+ *rgfInOut = ~0;
+
+ *rgfInOut &= dwFontsAttributes;
+
+ /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
+ *rgfInOut &= ~SFGAO_VALIDATE;
+
+ return S_OK;
+ }
}
HRESULT WINAPI CFontsFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl,
PCUITEMID_CHILD_ARRAY apidl,
@@ -222,7 +246,7 @@
{
TRACE ("(%p)->(%p)\n", this, pidl);
- return E_NOTIMPL;
+ return S_OK;
}
/**************************************************************************
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] Mon Aug 17
11:28:20 2015
@@ -279,11 +279,30 @@
*/
HRESULT WINAPI CNetFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET
strRet)
{
- FIXME("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
- pdump(pidl);
+ LPWSTR pszName;
+
+ TRACE ("(%p)->(pidl=%p,0x%08lx,%p)\n", this, pidl, dwFlags, strRet);
+ pdump (pidl);
if (!strRet)
return E_INVALIDARG;
+
+ if (!pidl->mkid.cb)
+ {
+ pszName = (LPWSTR)CoTaskMemAlloc(MAX_PATH * sizeof(WCHAR));
+ if (!pszName)
+ return E_OUTOFMEMORY;
+
+ if (LoadStringW(shell32_hInstance, IDS_NETWORKPLACE, pszName, MAX_PATH))
+ {
+ pszName[MAX_PATH-1] = L'\0';
+ strRet->uType = STRRET_WSTR;
+ strRet->pOleStr = pszName;
+ return S_OK;
+ }
+ CoTaskMemFree(pszName);
+ return E_FAIL;
+ }
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] Mon Aug 17
11:28:20 2015
@@ -370,10 +370,7 @@
*/
HRESULT WINAPI CPrinterFolder::BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved,
REFIID riid, LPVOID * ppvOut)
{
- TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", this,
- pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut);
-
- return SHELL32_BindToChild(pidlRoot, NULL, pidl, riid, ppvOut);
+ return E_NOTIMPL;
}
/**************************************************************************