shell32: Allow specifying the child folder CLSID in SHELL32_BindToChild().

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-09-15 09:53:56 +02:00
parent 0a2831a71d
commit 336c37d5f7
7 changed files with 9 additions and 10 deletions

View File

@ -471,7 +471,7 @@ static HRESULT WINAPI ISF_ControlPanel_fnBindToObject(IShellFolder2 *iface, LPCI
TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbcReserved, shdebugstr_guid(riid), ppvOut); TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbcReserved, shdebugstr_guid(riid), ppvOut);
return SHELL32_BindToChild(This->pidlRoot, NULL, pidl, riid, ppvOut); return SHELL32_BindToChild(This->pidlRoot, &CLSID_ShellFSFolder, NULL, pidl, riid, ppvOut);
} }
/************************************************************************** /**************************************************************************

View File

@ -50,7 +50,7 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder2 *folder, LPCITEMIDLIST pidl, DW
HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPWSTR szOut, HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPWSTR szOut,
DWORD dwOutLen) DECLSPEC_HIDDEN; DWORD dwOutLen) DECLSPEC_HIDDEN;
HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot, HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot, const CLSID *clsidChild,
LPCWSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut) DECLSPEC_HIDDEN; LPCWSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut) DECLSPEC_HIDDEN;
HRESULT SHELL32_CompareIDs(IShellFolder2 *iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) DECLSPEC_HIDDEN; HRESULT SHELL32_CompareIDs(IShellFolder2 *iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) DECLSPEC_HIDDEN;

View File

@ -370,7 +370,7 @@ static HRESULT WINAPI ISF_Desktop_fnBindToObject (IShellFolder2 * iface,
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n",
This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut); This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
return SHELL32_BindToChild( This->pidlRoot, This->sPathTarget, pidl, riid, ppvOut ); return SHELL32_BindToChild( This->pidlRoot, &CLSID_ShellFSFolder, This->sPathTarget, pidl, riid, ppvOut );
} }
/************************************************************************** /**************************************************************************

View File

@ -425,8 +425,7 @@ IShellFolder_fnBindToObject (IShellFolder2 * iface, LPCITEMIDLIST pidl,
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbc, TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbc,
shdebugstr_guid (riid), ppvOut); shdebugstr_guid (riid), ppvOut);
return SHELL32_BindToChild (This->pidlRoot, This->sPathTarget, pidl, riid, return SHELL32_BindToChild (This->pidlRoot, This->pclsid, This->sPathTarget, pidl, riid, ppvOut);
ppvOut);
} }
/************************************************************************** /**************************************************************************

View File

@ -379,7 +379,7 @@ static HRESULT WINAPI ISF_MyComputer_fnBindToObject (IShellFolder2 *iface,
TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", This, TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", This,
pidl, pbcReserved, shdebugstr_guid (riid), ppvOut); pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
return SHELL32_BindToChild (This->pidlRoot, NULL, pidl, riid, ppvOut); return SHELL32_BindToChild (This->pidlRoot, &CLSID_ShellFSFolder, NULL, pidl, riid, ppvOut);
} }
/************************************************************************** /**************************************************************************

View File

@ -264,7 +264,7 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnBindToObject (IShellFolder2 * iface,
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This,
pidl, pbcReserved, shdebugstr_guid (riid), ppvOut); pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
return SHELL32_BindToChild (This->pidlRoot, NULL, pidl, riid, ppvOut); return SHELL32_BindToChild (This->pidlRoot, &CLSID_ShellFSFolder, NULL, pidl, riid, ppvOut);
} }
/************************************************************************** /**************************************************************************

View File

@ -260,7 +260,7 @@ static HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCWSTR pathRoot,
* This function makes special assumptions on the shell namespace, which * This function makes special assumptions on the shell namespace, which
* means you probably can't use it for your IShellFolder implementation. * means you probably can't use it for your IShellFolder implementation.
*/ */
HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot, HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot, const CLSID *clsidChild,
LPCWSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut) LPCWSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut)
{ {
GUID const *clsid; GUID const *clsid;
@ -285,7 +285,7 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
hr = HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); hr = HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
} else { } else {
/* file system folder */ /* file system folder */
CLSID clsidFolder = CLSID_ShellFSFolder; CLSID clsidFolder = *clsidChild;
static const WCHAR wszCLSID[] = {'C','L','S','I','D',0}; static const WCHAR wszCLSID[] = {'C','L','S','I','D',0};
WCHAR wszCLSIDValue[CHARS_IN_GUID], wszFolderPath[MAX_PATH], *pwszPathTail = wszFolderPath; WCHAR wszCLSIDValue[CHARS_IN_GUID], wszFolderPath[MAX_PATH], *pwszPathTail = wszFolderPath;