[SHELL32]
authorThomas Faber <thomas.faber@reactos.org>
Wed, 30 Mar 2016 11:35:22 +0000 (11:35 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Wed, 30 Mar 2016 11:35:22 +0000 (11:35 +0000)
- Correctly handle desktop pidls in CDesktopFolder::CompareIDs. Based on a patch by Sylvain Deverre.
CORE-10747 CORE-10801 #resolve

svn path=/trunk/; revision=71081

reactos/dll/win32/shell32/folders/CDesktopFolder.cpp

index 119ec62..737c75f 100644 (file)
@@ -463,12 +463,19 @@ HRESULT WINAPI CDesktopFolder::BindToStorage(
  */
 HRESULT WINAPI CDesktopFolder::CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
 {
+    bool bIsDesktopFolder1, bIsDesktopFolder2;
+
     if (!pidl1 || !pidl2)
     {
         ERR("Got null pidl pointer (%Ix %p %p)!\n", lParam, pidl1, pidl2);
         return E_INVALIDARG;
     }
 
+    bIsDesktopFolder1 = _ILIsDesktop(pidl1);
+    bIsDesktopFolder2 = _ILIsDesktop(pidl2);
+    if (bIsDesktopFolder1 || bIsDesktopFolder2)
+        return MAKE_COMPARE_HRESULT(bIsDesktopFolder1 - bIsDesktopFolder2);
+
     if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2))
         return SHELL32_CompareGuidItems(this, lParam, pidl1, pidl2);