shell32: Make sure BrowseForFolder doesn't return NULL for the Desktop folder as this means a cancel.

This commit is contained in:
Mikołaj Zalewski 2007-02-09 16:53:24 +01:00 committed by Alexandre Julliard
parent fa97fbdcad
commit 474bf4fc4b
1 changed files with 4 additions and 1 deletions

View File

@ -524,7 +524,10 @@ static BOOL BrsFolder_OnCommand( browse_info *info, UINT id )
switch (id) switch (id)
{ {
case IDOK: case IDOK:
info->pidlRet = ILClone(info->pidlRet); /* The original pidl will be free'd. */ /* The original pidl is owned by the treeview and will be free'd. */
info->pidlRet = ILClone(info->pidlRet);
if (info->pidlRet == NULL) /* A null pidl would mean a cancel */
info->pidlRet = _ILCreateDesktop();
pdump( info->pidlRet ); pdump( info->pidlRet );
if (lpBrowseInfo->pszDisplayName) if (lpBrowseInfo->pszDisplayName)
SHGetPathFromIDListW( info->pidlRet, lpBrowseInfo->pszDisplayName ); SHGetPathFromIDListW( info->pidlRet, lpBrowseInfo->pszDisplayName );