shell32[1/3]: make sure BrowseForFolder doesn't return NULL for the Desktop folder as this means a cancel (try 2, should fix bug #5533)

Mikołaj Zalewski mikolaj at zalewski.pl
Fri Feb 9 09:53:24 CST 2007


-------------- next part --------------
From d32c180c6b02eb6b6a17c21b204765dbf7a76bdb Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Miko=C5=82aj_Zalewski?= <mikolaj at zalewski.pl>
Date: Fri, 9 Feb 2007 16:51:45 +0100
Subject: [PATCH] shell32: make sure BrowseForFolder doesn't return NULL for the Desktop folder as this means a cancel (try 2, should fix bug #5533)

---
 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_info *info, UINT id )
     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 );
-- 
1.4.4.2


More information about the wine-patches mailing list