Called by IE11.
Signed-off-by: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com>
---
This is the code I submitted on May 3.
---
dlls/shell32/pidl.c | 49 +++++++++++++++++++++++++++++++++++++++
dlls/shell32/shell32.spec | 1 +
include/shlobj.h | 2 ++
3 files changed, 52 insertions(+)
diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c
index f9c91a79132..e659427f9cd 100644
--- a/dlls/shell32/pidl.c
+++ b/dlls/shell32/pidl.c
@@ -1285,6 +1285,55 @@ BOOL WINAPI SHGetPathFromIDListEx(LPCITEMIDLIST pidl, WCHAR *path, DWORD path_si
return SUCCEEDED(hr);
}
+/*************************************************************************
+ * SHBindToFolderIDListParent [SHELL32.@]
+ */
+HRESULT WINAPI SHBindToFolderIDListParent(IShellFolder *psf, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
+{
+ IShellFolder *psfDesktop = NULL;
+ HRESULT hr;
+
+ TRACE_(shell)("%p,%p,%s\n", psf, pidl, debugstr_guid(riid));
+ pdump(pidl);
+
+ if (!pidl || !ppv)
+ return E_INVALIDARG;
+
+ *ppv = NULL;
+ if (ppidlLast)
+ *ppidlLast = NULL;
+
+ if (!psf)
+ {
+ hr = SHGetDesktopFolder(&psfDesktop);
+ if (FAILED(hr))
+ return hr;
+ psf = psfDesktop;
+ }
+
+ if (_ILIsPidlSimple(pidl))
+ {
+ /* we are on desktop level */
+ hr = IShellFolder_QueryInterface(psf, riid, ppv);
+ }
+ else
+ {
+ LPITEMIDLIST pidlParent = ILClone(pidl);
+ ILRemoveLastID(pidlParent);
+ hr = IShellFolder_BindToObject(psf, pidlParent, NULL, riid, ppv);
+ SHFree (pidlParent);
+ }
+
+ if (psfDesktop)
+ IShellFolder_Release(psfDesktop);
+
+ if (SUCCEEDED(hr) && ppidlLast)
+ *ppidlLast = ILFindLastID(pidl);
+
+ TRACE_(shell)("-- ppv=%p pidl=%p ret=0x%08lx\n", *ppv, (ppidlLast)?*ppidlLast:NULL, hr);
+ return hr;
+}
+
/*************************************************************************
* SHBindToParent [shell version 5.0]
*/
diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec
index f8bf8f246e8..5b812774e1f 100644
--- a/dlls/shell32/shell32.spec
+++ b/dlls/shell32/shell32.spec
@@ -334,6 +334,7 @@
@ stdcall SHAssocEnumHandlers(wstr long ptr)
@ stdcall SHBindToObject(ptr ptr ptr ptr ptr)
@ stdcall SHBindToParent(ptr ptr ptr ptr)
+@ stdcall SHBindToFolderIDListParent(ptr ptr ptr ptr ptr)
@ stdcall SHBrowseForFolder(ptr) SHBrowseForFolderA
@ stdcall SHBrowseForFolderA(ptr)
@ stdcall SHBrowseForFolderW(ptr)
diff --git a/include/shlobj.h b/include/shlobj.h
index d30944662f7..93f0201a991 100644
--- a/include/shlobj.h
+++ b/include/shlobj.h
@@ -1639,6 +1639,8 @@ HRESULT WINAPI SHGetFolderPathW(HWND hwnd, int nFolder, HANDLE hToken, DWORD dwF
*/
HRESULT WINAPI SHGetDesktopFolder(IShellFolder * *);
+HRESULT WINAPI SHBindToFolderIDListParent(IShellFolder *psf, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast);
+
/****************************************************************************
* SHBindToParent API
*/
--
2.36.1