IShellFolder_BindToObject should respect riid.
This commit is contained in:
parent
a8322d0b02
commit
da70148afb
|
@ -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);
|
||||
|
||||
|
@ -772,19 +773,29 @@ static HRESULT WINAPI IShellFolder_fnBindToObject( IShellFolder2 * iface, LPCITE
|
|||
}
|
||||
|
||||
if (_ILIsPidlSimple(pidl))
|
||||
{
|
||||
if(IsEqualIID(riid, &IID_IShellFolder))
|
||||
{
|
||||
*ppvOut = pShellFolder;
|
||||
hr = S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, &IID_IShellFolder, (LPVOID)&pSubFolder);
|
||||
hr = IShellFolder_QueryInterface(pShellFolder, riid, ppvOut);
|
||||
IShellFolder_Release(pShellFolder);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
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,6 +1775,7 @@ 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,6 +2219,7 @@ 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;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
|
Loading…
Reference in New Issue