mirror of
git://source.winehq.org/git/wine.git
synced 2024-08-31 23:15:02 +00:00
Make sure the bind context is forwarded in
ShellFolder_ParseDisplayName.
This commit is contained in:
parent
9c74339c32
commit
2407c13848
|
@ -32,8 +32,8 @@ typedef struct {
|
|||
#define GET_SHGDN_RELATION(dwFlags) ((DWORD)dwFlags & (DWORD)0x000000FF)
|
||||
|
||||
LPCWSTR GetNextElementW (LPCWSTR pszNext, LPWSTR pszOut, DWORD dwOut);
|
||||
HRESULT SHELL32_ParseNextElement (HWND hwndOwner, IShellFolder2 * psf, LPITEMIDLIST * pidlInOut, LPOLESTR szNext,
|
||||
DWORD * pEaten, DWORD * pdwAttributes);
|
||||
HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST * pidlInOut,
|
||||
LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes);
|
||||
HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes);
|
||||
HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlChild, REFCLSID clsid, REFIID iid,
|
||||
LPVOID * ppvOut);
|
||||
|
|
|
@ -189,7 +189,7 @@ static ULONG WINAPI ISF_Desktop_fnRelease (IShellFolder2 * iface)
|
|||
*/
|
||||
static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
|
||||
HWND hwndOwner,
|
||||
LPBC pbcReserved,
|
||||
LPBC pbc,
|
||||
LPOLESTR lpszDisplayName,
|
||||
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
|
||||
{
|
||||
|
@ -198,13 +198,19 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
|
|||
WCHAR szElement[MAX_PATH];
|
||||
LPCWSTR szNext = NULL;
|
||||
LPITEMIDLIST pidlTemp = NULL;
|
||||
HRESULT hr = E_OUTOFMEMORY;
|
||||
HRESULT hr = E_INVALIDARG;
|
||||
char szPath[MAX_PATH];
|
||||
DWORD len;
|
||||
CLSID clsid;
|
||||
|
||||
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;
|
||||
|
||||
if (pchEaten)
|
||||
*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 */
|
||||
pidlTemp = _ILCreateMyComputer ();
|
||||
szNext = lpszDisplayName;
|
||||
} else if (PathIsUNCW(lpszDisplayName)) {
|
||||
pidlTemp = _ILCreateNetwork();
|
||||
szNext = lpszDisplayName;
|
||||
} else {
|
||||
/* 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 */
|
||||
MultiByteToWideChar (CP_ACP, 0, This->sPathTarget, -1, szCompletePath, MAX_PATH);
|
||||
PathAddBackslashW (szCompletePath);
|
||||
lstrcatW (szCompletePath, lpszDisplayName);
|
||||
pidlTemp = SHSimpleIDListFromPathW (lpszDisplayName);
|
||||
/* build a complete path to create a simple pidl */
|
||||
lstrcpyA(szPath, This->sPathTarget);
|
||||
PathAddBackslashA(szPath);
|
||||
len = lstrlenA(szPath);
|
||||
WideCharToMultiByte(CP_ACP, 0, lpszDisplayName, -1, szPath + len, MAX_PATH - len, NULL, NULL);
|
||||
pidlTemp = _ILCreateFromPathA(szPath);
|
||||
szNext = lpszDisplayName;
|
||||
}
|
||||
|
||||
if (pidlTemp) {
|
||||
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 {
|
||||
hr = S_OK;
|
||||
if (pdwAttributes && *pdwAttributes) {
|
||||
|
|
|
@ -319,7 +319,7 @@ static ULONG WINAPI IShellFolder_fnRelease (IShellFolder2 * iface)
|
|||
static HRESULT WINAPI
|
||||
IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
|
||||
HWND hwndOwner,
|
||||
LPBC pbcReserved,
|
||||
LPBC pbc,
|
||||
LPOLESTR lpszDisplayName,
|
||||
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
|
||||
{
|
||||
|
@ -333,7 +333,7 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
|
|||
DWORD len;
|
||||
|
||||
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;
|
||||
|
@ -356,7 +356,7 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
|
|||
if (pidlTemp) {
|
||||
if (szNext && *szNext) {
|
||||
/* 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 {
|
||||
/* it's the last element */
|
||||
if (pdwAttributes && *pdwAttributes) {
|
||||
|
|
|
@ -189,7 +189,7 @@ static ULONG WINAPI ISF_MyComputer_fnRelease (IShellFolder2 * iface)
|
|||
static HRESULT WINAPI
|
||||
ISF_MyComputer_fnParseDisplayName (IShellFolder2 * iface,
|
||||
HWND hwndOwner,
|
||||
LPBC pbcReserved,
|
||||
LPBC pbc,
|
||||
LPOLESTR lpszDisplayName,
|
||||
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
|
||||
{
|
||||
|
@ -202,7 +202,7 @@ ISF_MyComputer_fnParseDisplayName (IShellFolder2 * iface,
|
|||
LPITEMIDLIST pidlTemp;
|
||||
|
||||
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;
|
||||
if (pchEaten)
|
||||
|
@ -215,7 +215,7 @@ ISF_MyComputer_fnParseDisplayName (IShellFolder2 * iface,
|
|||
pidlTemp = _ILCreateDrive (szTempA);
|
||||
|
||||
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 {
|
||||
if (pdwAttributes && *pdwAttributes) {
|
||||
SHELL32_GetItemAttributes (_IShellFolder_ (This), pidlTemp, pdwAttributes);
|
||||
|
|
|
@ -105,8 +105,7 @@ LPCWSTR GetNextElementW (LPCWSTR pszNext, LPWSTR pszOut, DWORD dwOut)
|
|||
return pszTail;
|
||||
}
|
||||
|
||||
HRESULT SHELL32_ParseNextElement (HWND hwndOwner,
|
||||
IShellFolder2 * psf,
|
||||
HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc,
|
||||
LPITEMIDLIST * pidlInOut, LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes)
|
||||
{
|
||||
HRESULT hr = E_OUTOFMEMORY;
|
||||
|
@ -114,13 +113,13 @@ HRESULT SHELL32_ParseNextElement (HWND hwndOwner,
|
|||
pidlTemp = NULL;
|
||||
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 */
|
||||
hr = IShellFolder_BindToObject (psf, *pidlInOut, NULL, &IID_IShellFolder, (LPVOID *) & psfChild);
|
||||
hr = IShellFolder_BindToObject (psf, *pidlInOut, pbc, &IID_IShellFolder, (LPVOID *) & psfChild);
|
||||
|
||||
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);
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue