Make sure the bind context is forwarded in

ShellFolder_ParseDisplayName.
This commit is contained in:
Rolf Kalbermatter 2003-09-15 22:16:41 +00:00 committed by Alexandre Julliard
parent 9c74339c32
commit 2407c13848
5 changed files with 32 additions and 24 deletions

View file

@ -32,8 +32,8 @@ typedef struct {
#define GET_SHGDN_RELATION(dwFlags) ((DWORD)dwFlags & (DWORD)0x000000FF) #define GET_SHGDN_RELATION(dwFlags) ((DWORD)dwFlags & (DWORD)0x000000FF)
LPCWSTR GetNextElementW (LPCWSTR pszNext, LPWSTR pszOut, DWORD dwOut); LPCWSTR GetNextElementW (LPCWSTR pszNext, LPWSTR pszOut, DWORD dwOut);
HRESULT SHELL32_ParseNextElement (HWND hwndOwner, IShellFolder2 * psf, LPITEMIDLIST * pidlInOut, LPOLESTR szNext, HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST * pidlInOut,
DWORD * pEaten, DWORD * pdwAttributes); LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes);
HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes); HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes);
HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlChild, REFCLSID clsid, REFIID iid, HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlChild, REFCLSID clsid, REFIID iid,
LPVOID * ppvOut); LPVOID * ppvOut);

View file

@ -189,7 +189,7 @@ static ULONG WINAPI ISF_Desktop_fnRelease (IShellFolder2 * iface)
*/ */
static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface, static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
HWND hwndOwner, HWND hwndOwner,
LPBC pbcReserved, LPBC pbc,
LPOLESTR lpszDisplayName, LPOLESTR lpszDisplayName,
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes) DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
{ {
@ -198,13 +198,19 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
WCHAR szElement[MAX_PATH]; WCHAR szElement[MAX_PATH];
LPCWSTR szNext = NULL; LPCWSTR szNext = NULL;
LPITEMIDLIST pidlTemp = NULL; LPITEMIDLIST pidlTemp = NULL;
HRESULT hr = E_OUTOFMEMORY; HRESULT hr = E_INVALIDARG;
char szPath[MAX_PATH];
DWORD len;
CLSID clsid; CLSID clsid;
TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
This, hwndOwner, pbcReserved, lpszDisplayName, debugstr_w (lpszDisplayName), pchEaten, ppidl, pdwAttributes); This, hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName), pchEaten, ppidl, pdwAttributes);
if (!lpszDisplayName || !ppidl)
return E_INVALIDARG;
*ppidl = 0; *ppidl = 0;
if (pchEaten) if (pchEaten)
*pchEaten = 0; /* strange but like the original */ *pchEaten = 0; /* strange but like the original */
@ -217,21 +223,24 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
/* it's a filesystem path with a drive. Let MyComputer parse it */ /* it's a filesystem path with a drive. Let MyComputer parse it */
pidlTemp = _ILCreateMyComputer (); pidlTemp = _ILCreateMyComputer ();
szNext = lpszDisplayName; szNext = lpszDisplayName;
} else if (PathIsUNCW(lpszDisplayName)) {
pidlTemp = _ILCreateNetwork();
szNext = lpszDisplayName;
} else { } else {
/* it's a filesystem path on the desktop. Let a FSFolder parse it */ /* it's a filesystem path on the desktop. Let a FSFolder parse it */
WCHAR szCompletePath[MAX_PATH];
/* build a complete path to create a simpel pidl */ /* build a complete path to create a simple pidl */
MultiByteToWideChar (CP_ACP, 0, This->sPathTarget, -1, szCompletePath, MAX_PATH); lstrcpyA(szPath, This->sPathTarget);
PathAddBackslashW (szCompletePath); PathAddBackslashA(szPath);
lstrcatW (szCompletePath, lpszDisplayName); len = lstrlenA(szPath);
pidlTemp = SHSimpleIDListFromPathW (lpszDisplayName); WideCharToMultiByte(CP_ACP, 0, lpszDisplayName, -1, szPath + len, MAX_PATH - len, NULL, NULL);
pidlTemp = _ILCreateFromPathA(szPath);
szNext = lpszDisplayName; szNext = lpszDisplayName;
} }
if (pidlTemp) { if (pidlTemp) {
if (szNext && *szNext) { if (szNext && *szNext) {
hr = SHELL32_ParseNextElement (hwndOwner, iface, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes); hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
} else { } else {
hr = S_OK; hr = S_OK;
if (pdwAttributes && *pdwAttributes) { if (pdwAttributes && *pdwAttributes) {

View file

@ -319,7 +319,7 @@ static ULONG WINAPI IShellFolder_fnRelease (IShellFolder2 * iface)
static HRESULT WINAPI static HRESULT WINAPI
IShellFolder_fnParseDisplayName (IShellFolder2 * iface, IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
HWND hwndOwner, HWND hwndOwner,
LPBC pbcReserved, LPBC pbc,
LPOLESTR lpszDisplayName, LPOLESTR lpszDisplayName,
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes) DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
{ {
@ -333,7 +333,7 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
DWORD len; DWORD len;
TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
This, hwndOwner, pbcReserved, lpszDisplayName, debugstr_w (lpszDisplayName), pchEaten, ppidl, pdwAttributes); This, hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName), pchEaten, ppidl, pdwAttributes);
if (!lpszDisplayName || !ppidl) if (!lpszDisplayName || !ppidl)
return E_INVALIDARG; return E_INVALIDARG;
@ -356,7 +356,7 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
if (pidlTemp) { if (pidlTemp) {
if (szNext && *szNext) { if (szNext && *szNext) {
/* try to analyse the next element */ /* try to analyse the next element */
hr = SHELL32_ParseNextElement (hwndOwner, iface, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes); hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
} else { } else {
/* it's the last element */ /* it's the last element */
if (pdwAttributes && *pdwAttributes) { if (pdwAttributes && *pdwAttributes) {

View file

@ -189,7 +189,7 @@ static ULONG WINAPI ISF_MyComputer_fnRelease (IShellFolder2 * iface)
static HRESULT WINAPI static HRESULT WINAPI
ISF_MyComputer_fnParseDisplayName (IShellFolder2 * iface, ISF_MyComputer_fnParseDisplayName (IShellFolder2 * iface,
HWND hwndOwner, HWND hwndOwner,
LPBC pbcReserved, LPBC pbc,
LPOLESTR lpszDisplayName, LPOLESTR lpszDisplayName,
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes) DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
{ {
@ -202,7 +202,7 @@ ISF_MyComputer_fnParseDisplayName (IShellFolder2 * iface,
LPITEMIDLIST pidlTemp; LPITEMIDLIST pidlTemp;
TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
This, hwndOwner, pbcReserved, lpszDisplayName, debugstr_w (lpszDisplayName), pchEaten, ppidl, pdwAttributes); This, hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName), pchEaten, ppidl, pdwAttributes);
*ppidl = 0; *ppidl = 0;
if (pchEaten) if (pchEaten)
@ -215,7 +215,7 @@ ISF_MyComputer_fnParseDisplayName (IShellFolder2 * iface,
pidlTemp = _ILCreateDrive (szTempA); pidlTemp = _ILCreateDrive (szTempA);
if (szNext && *szNext) { if (szNext && *szNext) {
hr = SHELL32_ParseNextElement (hwndOwner, iface, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes); hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
} else { } else {
if (pdwAttributes && *pdwAttributes) { if (pdwAttributes && *pdwAttributes) {
SHELL32_GetItemAttributes (_IShellFolder_ (This), pidlTemp, pdwAttributes); SHELL32_GetItemAttributes (_IShellFolder_ (This), pidlTemp, pdwAttributes);

View file

@ -105,8 +105,7 @@ LPCWSTR GetNextElementW (LPCWSTR pszNext, LPWSTR pszOut, DWORD dwOut)
return pszTail; return pszTail;
} }
HRESULT SHELL32_ParseNextElement (HWND hwndOwner, HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc,
IShellFolder2 * psf,
LPITEMIDLIST * pidlInOut, LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes) LPITEMIDLIST * pidlInOut, LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes)
{ {
HRESULT hr = E_OUTOFMEMORY; HRESULT hr = E_OUTOFMEMORY;
@ -114,13 +113,13 @@ HRESULT SHELL32_ParseNextElement (HWND hwndOwner,
pidlTemp = NULL; pidlTemp = NULL;
IShellFolder *psfChild; IShellFolder *psfChild;
TRACE ("(%p, %p, %s)\n", psf, pidlInOut ? *pidlInOut : NULL, debugstr_w (szNext)); TRACE ("(%p, %p, %p, %s)\n", psf, pbc, pidlInOut ? *pidlInOut : NULL, debugstr_w (szNext));
/* get the shellfolder for the child pidl and let it analyse further */ /* get the shellfolder for the child pidl and let it analyse further */
hr = IShellFolder_BindToObject (psf, *pidlInOut, NULL, &IID_IShellFolder, (LPVOID *) & psfChild); hr = IShellFolder_BindToObject (psf, *pidlInOut, pbc, &IID_IShellFolder, (LPVOID *) & psfChild);
if (SUCCEEDED (hr)) { if (SUCCEEDED (hr)) {
hr = IShellFolder_ParseDisplayName (psfChild, hwndOwner, NULL, szNext, pEaten, &pidlOut, pdwAttributes); hr = IShellFolder_ParseDisplayName (psfChild, hwndOwner, pbc, szNext, pEaten, &pidlOut, pdwAttributes);
IShellFolder_Release (psfChild); IShellFolder_Release (psfChild);
pidlTemp = ILCombine (*pidlInOut, pidlOut); pidlTemp = ILCombine (*pidlInOut, pidlOut);
@ -390,7 +389,7 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO
} }
/*********************************************************************** /***********************************************************************
* SHELL32_GetItemAttributes * SHELL32_CompareIDs
*/ */
HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
{ {