Commit a77fb7f5 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

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.
parent da31fc06
...@@ -213,21 +213,36 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface, ...@@ -213,21 +213,36 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
if (*lpszDisplayName) if (*lpszDisplayName)
{ {
WCHAR szPath[MAX_PATH]; if (*lpszDisplayName == '/')
LPWSTR pathPtr;
/* build a complete path to create a simple pidl */
lstrcpynW(szPath, This->sPathTarget, MAX_PATH);
pathPtr = PathAddBackslashW(szPath);
if (pathPtr)
{ {
lstrcpynW(pathPtr, lpszDisplayName, MAX_PATH - (pathPtr - szPath)); /* UNIX paths should be parsed by unixfs */
hr = _ILCreateFromPathW(szPath, &pidlTemp); 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 else
{ {
/* should never reach here, but for completeness */ /* build a complete path to create a simple pidl */
hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); 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 else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment