comdlg32: Fix path validation of UNC paths in the file dialog.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-09-13 17:47:48 +02:00
parent 757325bf77
commit c8e2802391
1 changed files with 10 additions and 5 deletions

View File

@ -2454,11 +2454,16 @@ int FILEDLG95_ValidatePathAction(LPWSTR lpstrPathAndFile, IShellFolder **ppsf,
LPWSTR p;
lstrcpyW(lpwstrTemp, lpszTemp);
p = PathFindNextComponentW(lpwstrTemp);
if (!p) break; /* end of path */
*p = 0;
if (lpszTemp == lpstrPathAndFile && (p = PathSkipRootW(lpwstrTemp)))
{
*p = 0;
}
else
{
p = PathFindNextComponentW(lpwstrTemp);
if (!p) break; /* end of path */
*p = 0;
}
lpszTemp = lpszTemp + lstrlenW(lpwstrTemp);
/* There are no wildcards when OFN_NOVALIDATE is set */