Author: gadamopoulos
Date: Fri Apr  3 11:44:30 2015
New Revision: 67017

URL: http://svn.reactos.org/svn/reactos?rev=67017&view=rev
Log:
[SHELL32]
- CFSFolder: Explicitly check for the supported pidl types. A CFSFolder can be 
created by a drive pidl. Handle this case and return the appropriate attributes 
in GetAttributesOf.
CORE-9458

Modified:
    trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp

Modified: trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp?rev=67017&r1=67016&r2=67017&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp       [iso-8859-1] 
(original)
+++ trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp       [iso-8859-1] 
Fri Apr  3 11:44:30 2015
@@ -369,6 +369,9 @@
         PCUITEMID_CHILD_ARRAY apidl, DWORD * rgfInOut)
 {
     HRESULT hr = S_OK;
+    static const DWORD dwDriveAttributes =
+        SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM | SFGAO_FOLDER | 
SFGAO_FILESYSANCESTOR |
+        SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANRENAME | 
SFGAO_CANLINK;
 
     TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", this, cidl, apidl,
           rgfInOut, rgfInOut ? *rgfInOut : 0);
@@ -389,7 +392,13 @@
         hr = SHBindToParent(pidlRoot, IID_PPV_ARG(IShellFolder, &psfParent), 
&rpidl);
         if(SUCCEEDED(hr))
         {
-            SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut);
+            if (_ILIsDrive(rpidl))
+                *rgfInOut &= dwDriveAttributes;
+            if (_ILIsFolder(rpidl) || _ILIsValue(rpidl))
+                SHELL32_GetItemAttributes(this, rpidl, rgfInOut);
+            else
+                ERR("Got an unknown type of pidl!!!\n");
+
             psfParent->Release();
         }
     }
@@ -398,7 +407,10 @@
         while (cidl > 0 && *apidl)
         {
             pdump(*apidl);
-            SHELL32_GetItemAttributes(this, *apidl, rgfInOut);
+            if(_ILIsFolder(*apidl) || _ILIsValue(*apidl))
+                SHELL32_GetItemAttributes(this, *apidl, rgfInOut);
+            else
+                ERR("Got an unknown type of pidl!!!\n");
             apidl++;
             cidl--;
         }


Reply via email to