From db8269be539eb41e1c314ee1f0d9c1fd234fffe3 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Mon, 17 Aug 2015 13:34:38 +0000 Subject: [PATCH] [SHELL32] - Fix a regression in SHELL32_GetFSItemAttributes found by our tests. svn path=/trunk/; revision=68738 --- reactos/dll/win32/shell32/shlfolder.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/reactos/dll/win32/shell32/shlfolder.cpp b/reactos/dll/win32/shell32/shlfolder.cpp index bf33bee577e..9947b224f40 100644 --- a/reactos/dll/win32/shell32/shlfolder.cpp +++ b/reactos/dll/win32/shell32/shlfolder.cpp @@ -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 | -- 2.17.1