diff --git a/dll/win32/shell32/droptargets/CFSDropTarget.cpp b/dll/win32/shell32/droptargets/CFSDropTarget.cpp index f480ffa9808..d63b15164fc 100644 --- a/dll/win32/shell32/droptargets/CFSDropTarget.cpp +++ b/dll/win32/shell32/droptargets/CFSDropTarget.cpp @@ -47,6 +47,23 @@ HRESULT CFSDropTarget::_CopyItems(IShellFolder * pSFFrom, UINT cidl, /* Build a double null terminated list of C strings from source paths */ for (UINT i = 0; i < cidl; i++) { + SFGAOF rfg = SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM; + ret = pSFFrom->GetAttributesOf(i, apidl, &rfg); + if (FAILED(ret)) + goto cleanup; + + if (!(rfg & (SFGAO_FILESYSANCESTOR|SFGAO_FILESYSTEM))) + { + ERR("Skipping item due to SFGAO_FILESYSANCESTOR|SFGAO_FILESYSTEM attributes\n"); + continue; + } + + if (_ILGetFileAttributes(apidl[i], NULL, 0) & FILE_ATTRIBUTE_SYSTEM) + { + ERR("Skipping item due to FILE_ATTRIBUTE_SYSTEM attribute\n"); + continue; + } + ret = pSFFrom->GetDisplayNameOf(apidl[i], SHGDN_FORPARSING, &strretFrom); if (FAILED(ret)) goto cleanup;