Piotr Caban : shell32: Improved equal ITEMIDLISTs handling in ILIsParent.

Alexandre Julliard julliard at winehq.org
Thu Jan 6 12:33:51 CST 2011


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Jan  6 00:01:28 2011 +0100

shell32: Improved equal ITEMIDLISTs handling in ILIsParent.

---

 dlls/shell32/pidl.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c
index 266c444..71b8f93 100644
--- a/dlls/shell32/pidl.c
+++ b/dlls/shell32/pidl.c
@@ -544,6 +544,8 @@ BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
  *  parent = a/b, child = a/b/c -> true, c is in folder a/b
  *  child = a/b/c/d -> false if bImmediate is true, d is not in folder a/b
  *  child = a/b/c/d -> true if bImmediate is false, d is in a subfolder of a/b
+ *  child = a/b -> false if bImmediate is true
+ *  child = a/b -> true if bImmediate is false
  */
 BOOL WINAPI ILIsParent(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL bImmediate)
 {
@@ -569,12 +571,12 @@ BOOL WINAPI ILIsParent(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL b
         pChild = ILGetNext(pChild);
     }
 
-    /* child shorter or has equal length to parent */
-    if (pParent->mkid.cb || !pChild->mkid.cb)
+    /* child has shorter name than parent */
+    if (pParent->mkid.cb)
         return FALSE;
 
     /* not immediate descent */
-    if ( ILGetNext(pChild)->mkid.cb && bImmediate)
+    if ((!pChild->mkid.cb || ILGetNext(pChild)->mkid.cb) && bImmediate)
         return FALSE;
 
     return TRUE;




More information about the wine-cvs mailing list