Resolve SHGetPathFromIDListW -> SHGetPathFromIDListA call.
Remove Fixme comment in SHGetPathFromIDList as StrRetToStrN should take care of this. Get rid of some unsigned/signed comparison warnings with default warnings in MSVC.
This commit is contained in:
parent
1b7b31631d
commit
a1b709d32e
|
@ -912,11 +912,8 @@ HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int n
|
||||||
* NULL returns FALSE
|
* NULL returns FALSE
|
||||||
* desktop pidl gives path to desktopdirectory back
|
* desktop pidl gives path to desktopdirectory back
|
||||||
* special pidls returning FALSE
|
* special pidls returning FALSE
|
||||||
*
|
|
||||||
* FIXME
|
|
||||||
* fnGetDisplayNameOf can return different types of OLEString
|
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI SHGetPathFromIDListA (LPCITEMIDLIST pidl, LPSTR pszPath)
|
BOOL WINAPI SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
STRRET str;
|
STRRET str;
|
||||||
|
@ -942,17 +939,28 @@ BOOL WINAPI SHGetPathFromIDListA (LPCITEMIDLIST pidl, LPSTR pszPath)
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* SHGetPathFromIDListW [SHELL32.@]
|
* SHGetPathFromIDListW [SHELL32.@]
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI SHGetPathFromIDListW (LPCITEMIDLIST pidl,LPWSTR pszPath)
|
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
|
||||||
{ char sTemp[MAX_PATH];
|
{
|
||||||
|
HRESULT hr;
|
||||||
|
STRRET str;
|
||||||
|
LPSHELLFOLDER shellfolder;
|
||||||
|
|
||||||
TRACE_(shell)("(pidl=%p)\n", pidl);
|
TRACE_(shell)("(pidl=%p,%p)\n", pidl, debugstr_w(pszPath));
|
||||||
|
pdump(pidl);
|
||||||
|
|
||||||
SHGetPathFromIDListA (pidl, sTemp);
|
if (!pidl) return FALSE;
|
||||||
MultiByteToWideChar( CP_ACP, 0, sTemp, -1, pszPath, MAX_PATH );
|
|
||||||
|
|
||||||
TRACE_(shell)("-- (%s)\n",debugstr_w(pszPath));
|
hr = SHGetDesktopFolder(&shellfolder);
|
||||||
|
if (SUCCEEDED(hr)) {
|
||||||
|
hr = IShellFolder_GetDisplayNameOf(shellfolder, pidl, SHGDN_FORPARSING, &str);
|
||||||
|
if (SUCCEEDED(hr)) {
|
||||||
|
StrRetToStrNW(pszPath, MAX_PATH, &str, pidl);
|
||||||
|
}
|
||||||
|
IShellFolder_Release(shellfolder);
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
TRACE_(shell)("-- %s, 0x%08lx\n",debugstr_w(pszPath), hr);
|
||||||
|
return SUCCEEDED(hr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
@ -1745,11 +1753,11 @@ DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
|
||||||
*/
|
*/
|
||||||
void _ILFreeaPidl(LPITEMIDLIST * apidl, UINT cidl)
|
void _ILFreeaPidl(LPITEMIDLIST * apidl, UINT cidl)
|
||||||
{
|
{
|
||||||
int i;
|
UINT i;
|
||||||
|
|
||||||
if(apidl)
|
if (apidl)
|
||||||
{
|
{
|
||||||
for(i = 0; i < cidl; i++) SHFree(apidl[i]);
|
for (i = 0; i < cidl; i++) SHFree(apidl[i]);
|
||||||
SHFree(apidl);
|
SHFree(apidl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1761,11 +1769,11 @@ void _ILFreeaPidl(LPITEMIDLIST * apidl, UINT cidl)
|
||||||
*/
|
*/
|
||||||
LPITEMIDLIST * _ILCopyaPidl(LPITEMIDLIST * apidlsrc, UINT cidl)
|
LPITEMIDLIST * _ILCopyaPidl(LPITEMIDLIST * apidlsrc, UINT cidl)
|
||||||
{
|
{
|
||||||
int i;
|
UINT i;
|
||||||
LPITEMIDLIST * apidldest = (LPITEMIDLIST*)SHAlloc(cidl * sizeof(LPITEMIDLIST));
|
LPITEMIDLIST * apidldest = (LPITEMIDLIST*)SHAlloc(cidl * sizeof(LPITEMIDLIST));
|
||||||
if(!apidlsrc) return NULL;
|
if(!apidlsrc) return NULL;
|
||||||
|
|
||||||
for(i = 0; i < cidl; i++)
|
for (i = 0; i < cidl; i++)
|
||||||
apidldest[i] = ILClone(apidlsrc[i]);
|
apidldest[i] = ILClone(apidlsrc[i]);
|
||||||
|
|
||||||
return apidldest;
|
return apidldest;
|
||||||
|
@ -1778,7 +1786,7 @@ LPITEMIDLIST * _ILCopyaPidl(LPITEMIDLIST * apidlsrc, UINT cidl)
|
||||||
*/
|
*/
|
||||||
LPITEMIDLIST * _ILCopyCidaToaPidl(LPITEMIDLIST* pidl, LPIDA cida)
|
LPITEMIDLIST * _ILCopyCidaToaPidl(LPITEMIDLIST* pidl, LPIDA cida)
|
||||||
{
|
{
|
||||||
int i;
|
UINT i;
|
||||||
LPITEMIDLIST * dst = (LPITEMIDLIST*)SHAlloc(cida->cidl * sizeof(LPITEMIDLIST));
|
LPITEMIDLIST * dst = (LPITEMIDLIST*)SHAlloc(cida->cidl * sizeof(LPITEMIDLIST));
|
||||||
|
|
||||||
if(!dst) return NULL;
|
if(!dst) return NULL;
|
||||||
|
@ -1786,7 +1794,7 @@ LPITEMIDLIST * _ILCopyCidaToaPidl(LPITEMIDLIST* pidl, LPIDA cida)
|
||||||
if (pidl)
|
if (pidl)
|
||||||
*pidl = ILClone((LPITEMIDLIST)(&((LPBYTE)cida)[cida->aoffset[0]]));
|
*pidl = ILClone((LPITEMIDLIST)(&((LPBYTE)cida)[cida->aoffset[0]]));
|
||||||
|
|
||||||
for(i = 0; i < cida->cidl; i++)
|
for (i = 0; i < cida->cidl; i++)
|
||||||
dst[i] = ILClone((LPITEMIDLIST)(&((LPBYTE)cida)[cida->aoffset[i + 1]]));
|
dst[i] = ILClone((LPITEMIDLIST)(&((LPBYTE)cida)[cida->aoffset[i + 1]]));
|
||||||
|
|
||||||
return dst;
|
return dst;
|
||||||
|
|
Loading…
Reference in New Issue