[SHELL32]
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 17 Aug 2015 13:34:38 +0000 (13:34 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 17 Aug 2015 13:34:38 +0000 (13:34 +0000)
- Fix a regression in SHELL32_GetFSItemAttributes found by our tests.

svn path=/trunk/; revision=68738

reactos/dll/win32/shell32/shlfolder.cpp

index bf33bee..9947b22 100644 (file)
@@ -572,6 +572,13 @@ HRESULT SHELL32_GetFSItemAttributes(IShellFolder * psf, LPCITEMIDLIST pidl, LPDW
 {
     DWORD dwAttributes;
 
+    if (!_ILIsFolder(pidl) && !_ILIsValue(pidl))
+    {
+        ERR("Got wrong type of pidl!\n");
+        *pdwAttributes &= SFGAO_CANLINK;
+        return S_OK;
+    }
+
     if (*pdwAttributes & ~dwSupportedAttr)
     {
         WARN ("attributes 0x%08x not implemented\n", (*pdwAttributes & ~dwSupportedAttr));
@@ -579,12 +586,6 @@ HRESULT SHELL32_GetFSItemAttributes(IShellFolder * psf, LPCITEMIDLIST pidl, LPDW
     }
 
     dwAttributes = _ILGetFileAttributes(pidl, NULL, 0);
-    if (!dwAttributes)
-    {
-        ERR("Got 0 attrs!\n");
-        *pdwAttributes &= SFGAO_CANLINK;
-        return S_OK;
-    }
 
     /* Set common attributes */
     *pdwAttributes |= SFGAO_FILESYSTEM | SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANDELETE |