shell32: UNIX paths should be parsed by unixfs.

Some tests show that trying to create a PIDL from a path starting with
'/' fails in Windows, so this change shouldn't cause a conflict with
the shell namespace.
This commit is contained in:
Andrew Eikum 2010-06-28 12:06:27 -05:00 committed by Alexandre Julliard
parent da31fc06a4
commit a77fb7f550
1 changed files with 26 additions and 11 deletions

View File

@ -213,21 +213,36 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
if (*lpszDisplayName)
{
WCHAR szPath[MAX_PATH];
LPWSTR pathPtr;
/* build a complete path to create a simple pidl */
lstrcpynW(szPath, This->sPathTarget, MAX_PATH);
pathPtr = PathAddBackslashW(szPath);
if (pathPtr)
if (*lpszDisplayName == '/')
{
lstrcpynW(pathPtr, lpszDisplayName, MAX_PATH - (pathPtr - szPath));
hr = _ILCreateFromPathW(szPath, &pidlTemp);
/* UNIX paths should be parsed by unixfs */
IShellFolder *unixFS;
hr = UnixFolder_Constructor(NULL, &IID_IShellFolder, (LPVOID*)&unixFS);
if (SUCCEEDED(hr))
{
hr = IShellFolder_ParseDisplayName(unixFS, NULL, NULL,
lpszDisplayName, NULL, &pidlTemp, NULL);
IShellFolder_Release(unixFS);
}
}
else
{
/* should never reach here, but for completeness */
hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
/* build a complete path to create a simple pidl */
WCHAR szPath[MAX_PATH];
LPWSTR pathPtr;
lstrcpynW(szPath, This->sPathTarget, MAX_PATH);
pathPtr = PathAddBackslashW(szPath);
if (pathPtr)
{
lstrcpynW(pathPtr, lpszDisplayName, MAX_PATH - (pathPtr - szPath));
hr = _ILCreateFromPathW(szPath, &pidlTemp);
}
else
{
/* should never reach here, but for completeness */
hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
}
}
}
else