Return a cloned PIDL by SHBrowseForFolder to avoid heap corruption.

This commit is contained in:
Michael Jung 2005-05-06 19:33:06 +00:00 committed by Alexandre Julliard
parent 94e5f01275
commit 15934680f7
1 changed files with 1 additions and 2 deletions

View File

@ -521,6 +521,7 @@ 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. */
pdump( info->pidlRet ); pdump( info->pidlRet );
if (lpBrowseInfo->pszDisplayName) if (lpBrowseInfo->pszDisplayName)
SHGetPathFromIDListW( info->pidlRet, lpBrowseInfo->pszDisplayName ); SHGetPathFromIDListW( info->pidlRet, lpBrowseInfo->pszDisplayName );
@ -664,8 +665,6 @@ LPITEMIDLIST WINAPI SHBrowseForFolderW (LPBROWSEINFOW lpbi)
browse_info info; browse_info info;
DWORD r; DWORD r;
ERR("%p\n", lpbi);
info.hWnd = 0; info.hWnd = 0;
info.pidlRet = NULL; info.pidlRet = NULL;
info.lpBrowseInfo = lpbi; info.lpBrowseInfo = lpbi;