David Hedberg : shell32: Remove reliance on the ability to bind to files in UnixFolder CompareIDs.

Alexandre Julliard julliard at winehq.org
Mon Nov 8 11:46:20 CST 2010


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

Author: David Hedberg <dhedberg at codeweavers.com>
Date:   Mon Nov  8 00:22:10 2010 +0100

shell32: Remove reliance on the ability to bind to files in UnixFolder CompareIDs.

---

 dlls/shell32/shfldr_unixfs.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c
index 35eb8e3..7772c98 100644
--- a/dlls/shell32/shfldr_unixfs.c
+++ b/dlls/shell32/shfldr_unixfs.c
@@ -1023,9 +1023,17 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_CompareIDs(IShellFolder2* iface,
     firstpidl = ILCloneFirst(pidl1);
     pidl1 = ILGetNext(pidl1);
     pidl2 = ILGetNext(pidl2);
-    
-    hr = IShellFolder2_BindToObject(iface, firstpidl, NULL, &IID_IShellFolder, (LPVOID*)&psf);
-    if (SUCCEEDED(hr)) {
+
+    isEmpty1 = _ILIsEmpty(pidl1);
+    isEmpty2 = _ILIsEmpty(pidl2);
+
+    if (isEmpty1 && isEmpty2)
+        return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 0);
+    else if (isEmpty1)
+        return MAKE_HRESULT(SEVERITY_SUCCESS, 0, (WORD)-1);
+    else if (isEmpty2)
+        return MAKE_HRESULT(SEVERITY_SUCCESS, 0, (WORD)1);
+    else if (SUCCEEDED(IShellFolder2_BindToObject(iface, firstpidl, NULL, &IID_IShellFolder, (void**)&psf))) {
         hr = IShellFolder_CompareIDs(psf, lParam, pidl1, pidl2);
         IShellFolder2_Release(psf);
     }




More information about the wine-cvs mailing list