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

Alexandre Julliard julliard at wine.codeweavers.com
Mon Feb 12 09:23:44 CST 2007


Module: wine
Branch: master
Commit: 474bf4fc4b222dbeee89133bb2f1c48b06ef050e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=474bf4fc4b222dbeee89133bb2f1c48b06ef050e

Author: Mikołaj Zalewski <mikolaj at zalewski.pl>
Date:   Fri Feb  9 16:53:24 2007 +0100

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

---

 dlls/shell32/brsfolder.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/shell32/brsfolder.c b/dlls/shell32/brsfolder.c
index 666e34b..27c2097 100644
--- a/dlls/shell32/brsfolder.c
+++ b/dlls/shell32/brsfolder.c
@@ -524,7 +524,10 @@ static BOOL BrsFolder_OnCommand( browse_
     switch (id)
     {
     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 );
         if (lpBrowseInfo->pszDisplayName)
             SHGetPathFromIDListW( info->pidlRet, lpBrowseInfo->pszDisplayName );




More information about the wine-cvs mailing list