IShellFolder_BindToObject should respect riid.

This commit is contained in:
Huw D M Davies 2002-01-14 18:35:44 +00:00 committed by Alexandre Julliard
parent a8322d0b02
commit da70148afb
1 changed files with 28 additions and 12 deletions

View File

@ -736,6 +736,7 @@ static HRESULT WINAPI IShellFolder_fnBindToObject( IShellFolder2 * iface, LPCITE
IShellFolder *pShellFolder, *pSubFolder;
IPersistFolder *pPersistFolder;
LPITEMIDLIST absPidl;
HRESULT hr;
TRACE("(%p)->(pidl=%p,%p,\n\tIID:\t%s,%p)\n",This,pidl,pbcReserved,debugstr_guid(riid),ppvOut);
@ -773,18 +774,28 @@ static HRESULT WINAPI IShellFolder_fnBindToObject( IShellFolder2 * iface, LPCITE
if (_ILIsPidlSimple(pidl))
{
*ppvOut = pShellFolder;
if(IsEqualIID(riid, &IID_IShellFolder))
{
*ppvOut = pShellFolder;
hr = S_OK;
}
else
{
hr = IShellFolder_QueryInterface(pShellFolder, riid, ppvOut);
IShellFolder_Release(pShellFolder);
}
}
else
{
IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, &IID_IShellFolder, (LPVOID)&pSubFolder);
hr = IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL,
riid, (LPVOID)&pSubFolder);
IShellFolder_Release(pShellFolder);
*ppvOut = pSubFolder;
}
TRACE("-- (%p) returning (%p)\n",This, *ppvOut);
TRACE("-- (%p) returning (%p) %08lx\n",This, *ppvOut, hr);
return S_OK;
return hr;
}
/**************************************************************************
@ -1764,7 +1775,8 @@ static HRESULT WINAPI ISF_Desktop_fnBindToObject( IShellFolder2 * iface, LPCITEM
_ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface)
GUID const * clsid;
IShellFolder *pShellFolder, *pSubFolder;
HRESULT hr;
TRACE("(%p)->(pidl=%p,%p,\n\tIID:\t%s,%p)\n",
This,pidl,pbcReserved,debugstr_guid(riid),ppvOut);
@ -1810,17 +1822,18 @@ static HRESULT WINAPI ISF_Desktop_fnBindToObject( IShellFolder2 * iface, LPCITEM
if (_ILIsPidlSimple(pidl)) /* no sub folders */
{
*ppvOut = pShellFolder;
hr = S_OK;
}
else /* go deeper */
{
IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, riid, (LPVOID)&pSubFolder);
hr = IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, riid, (LPVOID)&pSubFolder);
IShellFolder_Release(pShellFolder);
*ppvOut = pSubFolder;
}
TRACE("-- (%p) returning (%p)\n",This, *ppvOut);
TRACE("-- (%p) returning (%p) %08lx\n",This, *ppvOut, hr);
return S_OK;
return hr;
}
/**************************************************************************
@ -2206,7 +2219,8 @@ static HRESULT WINAPI ISF_MyComputer_fnBindToObject( IShellFolder2 * iface, LPCI
GUID const * clsid;
IShellFolder *pShellFolder, *pSubFolder;
LPITEMIDLIST pidltemp;
HRESULT hr;
TRACE("(%p)->(pidl=%p,%p,\n\tIID:\t%s,%p)\n",
This,pidl,pbcReserved,debugstr_guid(riid),ppvOut);
@ -2233,17 +2247,19 @@ static HRESULT WINAPI ISF_MyComputer_fnBindToObject( IShellFolder2 * iface, LPCI
if (_ILIsPidlSimple(pidl)) /* no sub folders */
{
*ppvOut = pShellFolder;
hr = S_OK;
}
else /* go deeper */
{
IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, &IID_IShellFolder, (LPVOID)&pSubFolder);
hr = IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL,
riid, (LPVOID)&pSubFolder);
IShellFolder_Release(pShellFolder);
*ppvOut = pSubFolder;
}
TRACE("-- (%p) returning (%p)\n",This, *ppvOut);
TRACE("-- (%p) returning (%p) %08lx\n",This, *ppvOut, hr);
return S_OK;
return hr;
}
/**************************************************************************