Vincent Povirk : shell32: Fix getting parent shell folder when it' s the desktop folder.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Aug 17 09:01:11 CDT 2015


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

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Fri Aug 14 14:55:20 2015 -0500

shell32: Fix getting parent shell folder when it's the desktop folder.

BindToObject fails in this case.

---

 dlls/shell32/shellitem.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c
index 853325c..f64c2d0 100644
--- a/dlls/shell32/shellitem.c
+++ b/dlls/shell32/shellitem.c
@@ -143,8 +143,15 @@ static HRESULT ShellItem_get_parent_shellfolder(ShellItem *This, IShellFolder **
         ret = SHGetDesktopFolder(&desktop);
         if (SUCCEEDED(ret))
         {
-            ret = IShellFolder_BindToObject(desktop, parent_pidl, NULL, &IID_IShellFolder, (void**)ppsf);
-            IShellFolder_Release(desktop);
+            if (_ILIsDesktop(parent_pidl))
+            {
+                *ppsf = desktop;
+            }
+            else
+            {
+                ret = IShellFolder_BindToObject(desktop, parent_pidl, NULL, &IID_IShellFolder, (void**)ppsf);
+                IShellFolder_Release(desktop);
+            }
         }
         ILFree(parent_pidl);
     }




More information about the wine-cvs mailing list