Commit c12ccd6f authored by Mohamad Al-Jaf's avatar Mohamad Al-Jaf Committed by Alexandre Julliard

shell32: Implement SHBindToFolderIDListParent().

Called by IE11. Signed-off-by: 's avatarMohamad Al-Jaf <mohamadaljaf@gmail.com>
parent a500bb72
......@@ -1290,12 +1290,20 @@ BOOL WINAPI SHGetPathFromIDListEx(LPCITEMIDLIST pidl, WCHAR *path, DWORD path_si
*/
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
{
IShellFolder * psfDesktop;
HRESULT hr=E_FAIL;
return SHBindToFolderIDListParent(NULL, pidl, riid, ppv, ppidlLast);
}
/*************************************************************************
* SHBindToFolderIDListParent [SHELL32.@]
*/
HRESULT WINAPI SHBindToFolderIDListParent(IShellFolder *psf, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
{
IShellFolder *psfDesktop = NULL;
HRESULT hr;
TRACE_(shell)("pidl=%p\n", pidl);
TRACE_(shell)("%p,%p,%s\n", psf, pidl, debugstr_guid(riid));
pdump(pidl);
if (!pidl || !ppv)
return E_INVALIDARG;
......@@ -1303,29 +1311,34 @@ HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCI
if (ppidlLast)
*ppidlLast = NULL;
hr = SHGetDesktopFolder(&psfDesktop);
if (FAILED(hr))
return hr;
if (!psf)
{
hr = SHGetDesktopFolder(&psfDesktop);
if (FAILED(hr))
return hr;
psf = psfDesktop;
}
if (_ILIsPidlSimple(pidl))
{
/* we are on desktop level */
hr = IShellFolder_QueryInterface(psfDesktop, riid, ppv);
hr = IShellFolder_QueryInterface(psf, riid, ppv);
}
else
{
LPITEMIDLIST pidlParent = ILClone(pidl);
ILRemoveLastID(pidlParent);
hr = IShellFolder_BindToObject(psfDesktop, pidlParent, NULL, riid, ppv);
hr = IShellFolder_BindToObject(psf, pidlParent, NULL, riid, ppv);
SHFree (pidlParent);
}
IShellFolder_Release(psfDesktop);
if (psfDesktop)
IShellFolder_Release(psfDesktop);
if (SUCCEEDED(hr) && ppidlLast)
*ppidlLast = ILFindLastID(pidl);
TRACE_(shell)("-- psf=%p pidl=%p ret=0x%08lx\n", *ppv, (ppidlLast)?*ppidlLast:NULL, hr);
TRACE_(shell)("-- ppv=%p pidl=%p ret=0x%08lx\n", *ppv, (ppidlLast)?*ppidlLast:NULL, hr);
return hr;
}
......
......@@ -332,6 +332,7 @@
@ stdcall SHAddToRecentDocs (long ptr)
@ stdcall SHAppBarMessage(long ptr)
@ stdcall SHAssocEnumHandlers(wstr long ptr)
@ stdcall SHBindToFolderIDListParent(ptr ptr ptr ptr ptr)
@ stdcall SHBindToObject(ptr ptr ptr ptr ptr)
@ stdcall SHBindToParent(ptr ptr ptr ptr)
@ stdcall SHBrowseForFolder(ptr) SHBrowseForFolderA
......
......@@ -1748,6 +1748,9 @@ WINSHELLAPI HRESULT WINAPI SHGetFolderPathW(HWND hwnd, int nFolder, HANDLE hToke
*/
WINSHELLAPI HRESULT WINAPI SHGetDesktopFolder(IShellFolder * *);
WINSHELLAPI HRESULT WINAPI SHBindToFolderIDListParent(IShellFolder *psf, LPCITEMIDLIST pidl, REFIID riid,
LPVOID *ppv, LPCITEMIDLIST *ppidlLast);
/****************************************************************************
* SHBindToParent API
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment