mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:52:57 +00:00
[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. svn path=/trunk/; revision=68728
This commit is contained in:
parent
8037625c04
commit
ef89f318da
4 changed files with 73 additions and 9 deletions
|
@ -114,7 +114,31 @@ HRESULT WINAPI CAdminToolsFolder::CreateViewObject(HWND hwndOwner, REFIID riid,
|
||||||
|
|
||||||
HRESULT WINAPI CAdminToolsFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
|
HRESULT WINAPI CAdminToolsFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *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);
|
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,
|
HRESULT WINAPI CAdminToolsFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl,
|
||||||
|
|
|
@ -111,7 +111,31 @@ HRESULT WINAPI CFontsFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOI
|
||||||
|
|
||||||
HRESULT WINAPI CFontsFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
|
HRESULT WINAPI CFontsFolder::GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *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);
|
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,
|
HRESULT WINAPI CFontsFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl,
|
||||||
|
@ -222,7 +246,7 @@ HRESULT WINAPI CFontsFolder::Initialize(LPCITEMIDLIST pidl)
|
||||||
{
|
{
|
||||||
TRACE ("(%p)->(%p)\n", this, pidl);
|
TRACE ("(%p)->(%p)\n", this, pidl);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
|
|
@ -279,12 +279,31 @@ HRESULT WINAPI CNetFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CH
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI CNetFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
|
HRESULT WINAPI CNetFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
|
||||||
{
|
{
|
||||||
FIXME("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
|
LPWSTR pszName;
|
||||||
pdump(pidl);
|
|
||||||
|
TRACE ("(%p)->(pidl=%p,0x%08lx,%p)\n", this, pidl, dwFlags, strRet);
|
||||||
|
pdump (pidl);
|
||||||
|
|
||||||
if (!strRet)
|
if (!strRet)
|
||||||
return E_INVALIDARG;
|
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;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -370,10 +370,7 @@ HRESULT WINAPI CPrinterFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUM
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI CPrinterFolder::BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
|
HRESULT WINAPI CPrinterFolder::BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
|
||||||
{
|
{
|
||||||
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", this,
|
return E_NOTIMPL;
|
||||||
pidl, pbcReserved, shdebugstr_guid (&riid), ppvOut);
|
|
||||||
|
|
||||||
return SHELL32_BindToChild(pidlRoot, NULL, pidl, riid, ppvOut);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue