Alexandre Julliard : shell32: Allow specifying the child folder CLSID in SHELL32_BindToChild().
Alexandre Julliard
julliard at winehq.org
Wed Sep 15 16:21:29 CDT 2021
Module: wine
Branch: master
Commit: 336c37d5f7c9b4f5bbb3d1ca64a504cd2f364f6b
URL: https://source.winehq.org/git/wine.git/?a=commit;h=336c37d5f7c9b4f5bbb3d1ca64a504cd2f364f6b
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Sep 15 09:53:56 2021 +0200
shell32: Allow specifying the child folder CLSID in SHELL32_BindToChild().
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/shell32/cpanelfolder.c | 2 +-
dlls/shell32/shfldr.h | 2 +-
dlls/shell32/shfldr_desktop.c | 2 +-
dlls/shell32/shfldr_fs.c | 3 +--
dlls/shell32/shfldr_mycomp.c | 2 +-
dlls/shell32/shfldr_netplaces.c | 2 +-
dlls/shell32/shlfolder.c | 6 +++---
7 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/dlls/shell32/cpanelfolder.c b/dlls/shell32/cpanelfolder.c
index 6fc21f980d5..2cd97f2838f 100644
--- a/dlls/shell32/cpanelfolder.c
+++ b/dlls/shell32/cpanelfolder.c
@@ -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);
- return SHELL32_BindToChild(This->pidlRoot, NULL, pidl, riid, ppvOut);
+ return SHELL32_BindToChild(This->pidlRoot, &CLSID_ShellFSFolder, NULL, pidl, riid, ppvOut);
}
/**************************************************************************
diff --git a/dlls/shell32/shfldr.h b/dlls/shell32/shfldr.h
index 1c10cc2c81d..e6456e1392f 100644
--- a/dlls/shell32/shfldr.h
+++ b/dlls/shell32/shfldr.h
@@ -50,7 +50,7 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder2 *folder, LPCITEMIDLIST pidl, DW
HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPWSTR szOut,
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;
HRESULT SHELL32_CompareIDs(IShellFolder2 *iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) DECLSPEC_HIDDEN;
diff --git a/dlls/shell32/shfldr_desktop.c b/dlls/shell32/shfldr_desktop.c
index 1f1a1c95b7b..33140784f22 100644
--- a/dlls/shell32/shfldr_desktop.c
+++ b/dlls/shell32/shfldr_desktop.c
@@ -370,7 +370,7 @@ static HRESULT WINAPI ISF_Desktop_fnBindToObject (IShellFolder2 * iface,
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n",
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 );
}
/**************************************************************************
diff --git a/dlls/shell32/shfldr_fs.c b/dlls/shell32/shfldr_fs.c
index 902910e55bb..812a022c806 100644
--- a/dlls/shell32/shfldr_fs.c
+++ b/dlls/shell32/shfldr_fs.c
@@ -425,8 +425,7 @@ IShellFolder_fnBindToObject (IShellFolder2 * iface, LPCITEMIDLIST pidl,
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbc,
shdebugstr_guid (riid), ppvOut);
- return SHELL32_BindToChild (This->pidlRoot, This->sPathTarget, pidl, riid,
- ppvOut);
+ return SHELL32_BindToChild (This->pidlRoot, This->pclsid, This->sPathTarget, pidl, riid, ppvOut);
}
/**************************************************************************
diff --git a/dlls/shell32/shfldr_mycomp.c b/dlls/shell32/shfldr_mycomp.c
index 91f81a22741..56d08cc87e9 100644
--- a/dlls/shell32/shfldr_mycomp.c
+++ b/dlls/shell32/shfldr_mycomp.c
@@ -379,7 +379,7 @@ static HRESULT WINAPI ISF_MyComputer_fnBindToObject (IShellFolder2 *iface,
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);
}
/**************************************************************************
diff --git a/dlls/shell32/shfldr_netplaces.c b/dlls/shell32/shfldr_netplaces.c
index e74336544f3..be99b7f5875 100644
--- a/dlls/shell32/shfldr_netplaces.c
+++ b/dlls/shell32/shfldr_netplaces.c
@@ -264,7 +264,7 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnBindToObject (IShellFolder2 * iface,
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);
}
/**************************************************************************
diff --git a/dlls/shell32/shlfolder.c b/dlls/shell32/shlfolder.c
index f288b7f7ab1..e84733d2676 100644
--- a/dlls/shell32/shlfolder.c
+++ b/dlls/shell32/shlfolder.c
@@ -260,7 +260,7 @@ static HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCWSTR pathRoot,
* This function makes special assumptions on the shell namespace, which
* 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)
{
GUID const *clsid;
@@ -285,10 +285,10 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
hr = HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
} else {
/* file system folder */
- CLSID clsidFolder = CLSID_ShellFSFolder;
+ CLSID clsidFolder = *clsidChild;
static const WCHAR wszCLSID[] = {'C','L','S','I','D',0};
WCHAR wszCLSIDValue[CHARS_IN_GUID], wszFolderPath[MAX_PATH], *pwszPathTail = wszFolderPath;
-
+
/* see if folder CLSID should be overridden by desktop.ini file */
if (pathRoot) {
lstrcpynW(wszFolderPath, pathRoot, MAX_PATH);
More information about the wine-cvs
mailing list