mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[SHELL32] SHBrowseForFolder: Fix pszDisplayName (#6549)
pszDisplayName is for display name, not for full path. JIRA issue: CORE-5866 - If lpBrowseInfo->pszDisplayName is valid, use SHGetFileInfoW to get display name. - Don't use SHGetPathFromIDListW to get display name. It's wrong.
This commit is contained in:
parent
d634ef54e4
commit
776c3a3495
1 changed files with 12 additions and 0 deletions
|
@ -1052,7 +1052,19 @@ static BOOL BrsFolder_OnCommand( browse_info *info, UINT id )
|
|||
info->pidlRet = _ILCreateDesktop();
|
||||
pdump( info->pidlRet );
|
||||
if (lpBrowseInfo->pszDisplayName)
|
||||
#ifdef __REACTOS__
|
||||
{
|
||||
SHFILEINFOW fileInfo = { NULL };
|
||||
lpBrowseInfo->pszDisplayName[0] = UNICODE_NULL;
|
||||
if (SHGetFileInfoW((LPCWSTR)info->pidlRet, 0, &fileInfo, sizeof(fileInfo),
|
||||
SHGFI_PIDL | SHGFI_DISPLAYNAME))
|
||||
{
|
||||
lstrcpynW(lpBrowseInfo->pszDisplayName, fileInfo.szDisplayName, MAX_PATH);
|
||||
}
|
||||
}
|
||||
#else
|
||||
SHGetPathFromIDListW( info->pidlRet, lpBrowseInfo->pszDisplayName );
|
||||
#endif
|
||||
EndDialog( info->hWnd, 1 );
|
||||
return TRUE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue