Convert SHELL32_BindToChild to Unicode and fix up the callers.
This commit is contained in:
parent
2a02dd1f05
commit
055d96b721
@ -43,7 +43,7 @@ HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf, LPCITEMIDLIST pidl,
|
|||||||
DWORD dwOutLen);
|
DWORD dwOutLen);
|
||||||
|
|
||||||
HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
|
HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
|
||||||
LPCSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut);
|
LPCWSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut);
|
||||||
|
|
||||||
HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
|
HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
|
||||||
LPITEMIDLIST SHELL32_CreatePidlFromBindCtx(IBindCtx *pbc, LPCWSTR path);
|
LPITEMIDLIST SHELL32_CreatePidlFromBindCtx(IBindCtx *pbc, LPCWSTR path);
|
||||||
|
@ -341,14 +341,11 @@ static HRESULT WINAPI ISF_Desktop_fnBindToObject (IShellFolder2 * iface,
|
|||||||
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
|
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
|
||||||
{
|
{
|
||||||
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
IGenericSFImpl *This = (IGenericSFImpl *)iface;
|
||||||
char szPath[MAX_PATH];
|
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
WideCharToMultiByte( CP_ACP, 0, This->sPathTarget, -1,
|
return SHELL32_BindToChild( This->pidlRoot, This->sPathTarget, pidl, riid, ppvOut );
|
||||||
szPath, MAX_PATH, NULL, NULL );
|
|
||||||
return SHELL32_BindToChild( This->pidlRoot, szPath, pidl, riid, ppvOut );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -481,11 +481,13 @@ IShellFolder_fnBindToObject (IShellFolder2 * iface, LPCITEMIDLIST pidl,
|
|||||||
LPBC pbc, REFIID riid, LPVOID * ppvOut)
|
LPBC pbc, REFIID riid, LPVOID * ppvOut)
|
||||||
{
|
{
|
||||||
IGenericSFImpl *This = impl_from_IShellFolder2(iface);
|
IGenericSFImpl *This = impl_from_IShellFolder2(iface);
|
||||||
|
WCHAR szPath[MAX_PATH];
|
||||||
|
|
||||||
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,
|
MultiByteToWideChar(CP_ACP, 0, This->sPathTarget, -1, szPath, MAX_PATH);
|
||||||
|
return SHELL32_BindToChild (This->pidlRoot, szPath, pidl, riid,
|
||||||
ppvOut);
|
ppvOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,12 +192,12 @@ HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc,
|
|||||||
* pathRoot can be NULL for Folders beeing a drive.
|
* pathRoot can be NULL for Folders beeing a drive.
|
||||||
* In this case the absolute path is build from pidlChild (eg. C:)
|
* In this case the absolute path is build from pidlChild (eg. C:)
|
||||||
*/
|
*/
|
||||||
HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCSTR pathRoot,
|
static HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCWSTR pathRoot,
|
||||||
LPCITEMIDLIST pidlChild, REFCLSID clsid, REFIID riid, LPVOID * ppvOut)
|
LPCITEMIDLIST pidlChild, REFCLSID clsid, REFIID riid, LPVOID * ppvOut)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE ("%p %s %p\n", pidlRoot, pathRoot, pidlChild);
|
TRACE ("%p %s %p\n", pidlRoot, debugstr_w(pathRoot), pidlChild);
|
||||||
|
|
||||||
if (SUCCEEDED ((hr = SHCoCreateInstance (NULL, clsid, NULL, riid, ppvOut)))) {
|
if (SUCCEEDED ((hr = SHCoCreateInstance (NULL, clsid, NULL, riid, ppvOut)))) {
|
||||||
LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
|
LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
|
||||||
@ -208,31 +208,28 @@ HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCSTR pathRoot,
|
|||||||
SUCCEEDED (IUnknown_QueryInterface ((IUnknown *) * ppvOut, &IID_IPersistFolder3, (LPVOID *) & ppf)))
|
SUCCEEDED (IUnknown_QueryInterface ((IUnknown *) * ppvOut, &IID_IPersistFolder3, (LPVOID *) & ppf)))
|
||||||
{
|
{
|
||||||
PERSIST_FOLDER_TARGET_INFO ppfti;
|
PERSIST_FOLDER_TARGET_INFO ppfti;
|
||||||
char szDestPath[MAX_PATH];
|
|
||||||
|
|
||||||
ZeroMemory (&ppfti, sizeof (ppfti));
|
ZeroMemory (&ppfti, sizeof (ppfti));
|
||||||
|
|
||||||
/* build path */
|
|
||||||
if (pathRoot) {
|
|
||||||
lstrcpyA (szDestPath, pathRoot);
|
|
||||||
PathAddBackslashA(szDestPath); /* FIXME: why have drives a backslash here ? */
|
|
||||||
} else {
|
|
||||||
szDestPath[0] = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pidlChild) {
|
|
||||||
LPSTR pszChild = _ILGetTextPointer(pidlChild);
|
|
||||||
|
|
||||||
if (pszChild)
|
|
||||||
lstrcatA (szDestPath, pszChild);
|
|
||||||
else
|
|
||||||
hr = E_INVALIDARG;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* fill the PERSIST_FOLDER_TARGET_INFO */
|
/* fill the PERSIST_FOLDER_TARGET_INFO */
|
||||||
ppfti.dwAttributes = -1;
|
ppfti.dwAttributes = -1;
|
||||||
ppfti.csidl = -1;
|
ppfti.csidl = -1;
|
||||||
MultiByteToWideChar (CP_ACP, 0, szDestPath, -1, ppfti.szTargetParsingName, MAX_PATH);
|
|
||||||
|
/* build path */
|
||||||
|
if (pathRoot) {
|
||||||
|
lstrcpynW (ppfti.szTargetParsingName, pathRoot, MAX_PATH - 1);
|
||||||
|
PathAddBackslashW(ppfti.szTargetParsingName); /* FIXME: why have drives a backslash here ? */
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pidlChild) {
|
||||||
|
LPCSTR pszChild = _ILGetTextPointer(pidlChild);
|
||||||
|
int len = lstrlenW(ppfti.szTargetParsingName);
|
||||||
|
|
||||||
|
if (pszChild)
|
||||||
|
MultiByteToWideChar (CP_ACP, 0, pszChild, -1, ppfti.szTargetParsingName + len, MAX_PATH - len);
|
||||||
|
else
|
||||||
|
hr = E_INVALIDARG;
|
||||||
|
}
|
||||||
|
|
||||||
IPersistFolder3_InitializeEx (ppf, NULL, pidlAbsolute, &ppfti);
|
IPersistFolder3_InitializeEx (ppf, NULL, pidlAbsolute, &ppfti);
|
||||||
IPersistFolder3_Release (ppf);
|
IPersistFolder3_Release (ppf);
|
||||||
@ -265,7 +262,7 @@ HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCSTR pathRoot,
|
|||||||
* 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,
|
||||||
LPCSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut)
|
LPCWSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut)
|
||||||
{
|
{
|
||||||
GUID const *clsid;
|
GUID const *clsid;
|
||||||
IShellFolder *pSF;
|
IShellFolder *pSF;
|
||||||
@ -290,10 +287,10 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
|
|||||||
|
|
||||||
/* see if folder CLSID should be overridden by desktop.ini file */
|
/* see if folder CLSID should be overridden by desktop.ini file */
|
||||||
if (pathRoot) {
|
if (pathRoot) {
|
||||||
MultiByteToWideChar(CP_ACP, 0, pathRoot, -1, wszFolderPath, MAX_PATH);
|
lstrcpynW(wszFolderPath, pathRoot, MAX_PATH);
|
||||||
pwszPathTail = PathAddBackslashW(wszFolderPath);
|
pwszPathTail = PathAddBackslashW(wszFolderPath);
|
||||||
}
|
}
|
||||||
MultiByteToWideChar(CP_ACP, 0, _ILGetTextPointer(pidlChild), -1, pwszPathTail, MAX_PATH);
|
MultiByteToWideChar(CP_ACP, 0, _ILGetTextPointer(pidlChild), -1, pwszPathTail, MAX_PATH - (int)(pwszPathTail - wszFolderPath));
|
||||||
if (SHELL32_GetCustomFolderAttributeFromPath (wszFolderPath,
|
if (SHELL32_GetCustomFolderAttributeFromPath (wszFolderPath,
|
||||||
wszDotShellClassInfo, wszCLSID, wszCLSIDValue, CHARS_IN_GUID))
|
wszDotShellClassInfo, wszCLSID, wszCLSIDValue, CHARS_IN_GUID))
|
||||||
CLSIDFromString (wszCLSIDValue, &clsidFolder);
|
CLSIDFromString (wszCLSIDValue, &clsidFolder);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user