17 SFGAO_READONLY | SFGAO_STREAM | SFGAO_FOLDER;
43 CComPtr<IShellFolder> spDesktop, spResult;
59 STGMEDIUM medium = {};
75 winetest_ok(
data[0] == expect_mask,
"Unexpected mask, got 0x%lx, expected 0x%lx\n",
data[0], expect_mask);
76 winetest_ok(
data[1] == expect_attr,
"Unexpected attr, got 0x%lx, expected 0x%lx\n",
data[1], expect_attr);
77 winetest_ok(
data[2] == expect_items,
"Unexpected item count, got %lu, expected %u\n",
data[2], expect_items);
88#define ok_attributes (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : ok_attributes_
89#define ok_hr_ret(x, y) ok_hr(x, y); if (x != y) return
120 ok(spPath !=
nullptr,
"Unable to create pidl from %S\n",
Buffer);
121 if (spPath ==
nullptr)
127 CComPtr<IShellFolder> spFolder;
132 hr = spFolder->GetAttributesOf(1, &
child, &attributes);
142 CComPtr<IDataObject> spDataObject;
159 dwAttributeMask = SFGAO_HASPROPSHEET;
171 TmpFile TmpFile1, TmpFile2, TmpFile3;
173 CComHeapPtr<ITEMIDLIST> pidl_tmpfolder;
174 CComHeapPtr<ITEMIDLIST> pidl1, pidl2, pidl3;
188 TmpFile1.
Create(TempFolder);
189 TmpFile2.
Create(TempFolder);
190 TmpFile3.
Create(TempFolder);
198 CComPtr<IShellFolder> spFolder =
_BindToObject(pidl_tmpfolder);
199 ok(!!spFolder,
"Unable to bind to tmp folder\n");
217 hr = spFolder->GetAttributesOf(1,
items, &attributes_first);
220 hr = spFolder->GetAttributesOf(2,
items, &attributes2);
223 hr = spFolder->GetAttributesOf(3,
items, &attributes3);
226 hr = spFolder->GetAttributesOf(1,
items + 2, &attributes_last);
237 ok(attributes_first & SFGAO_STREAM,
"Expected SFGAO_STREAM on attributes_first (0x%lx)\n", attributes_first);
238 ok(!(attributes2 & SFGAO_STREAM),
"Expected no SFGAO_STREAM on attributes2 (0x%lx)\n", attributes2);
239 ok(!(attributes3 & SFGAO_STREAM),
"Expected no SFGAO_STREAM on attributes3 (0x%lx)\n", attributes3);
240 ok(attributes_last & SFGAO_STREAM,
"Expected SFGAO_STREAM on attributes_last (0x%lx)\n", attributes_last);
243 ok(!(attributes_first & SFGAO_READONLY),
"Expected no SFGAO_READONLY on attributes_first (0x%lx)\n", attributes_first);
244 ok(!(attributes2 & SFGAO_READONLY),
"Expected no SFGAO_READONLY on attributes2 (0x%lx)\n", attributes2);
245 ok(!(attributes3 & SFGAO_READONLY),
"Expected no SFGAO_READONLY on attributes3 (0x%lx)\n", attributes3);
246 ok(attributes_last & SFGAO_READONLY,
"Expected SFGAO_READONLY on attributes_last (0x%lx)\n", attributes_last);
251 CComPtr<IDataObject> spDataObject;
264 CComPtr<IDataObject> spDataObject;
277 CComPtr<IDataObject> spDataObject;
290 CComPtr<IDataObject> spDataObject;
#define ok_hr(status, expected)
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
static const DWORD dwDefaultAttributeMask
static void test_SpecialCases()
CComPtr< IShellFolder > _BindToObject(PCUIDLIST_ABSOLUTE pidl)
static void test_AttributesRegistration()
static void test_MultipleFiles()
static void ok_attributes_(IDataObject *pDataObject, HRESULT expect_hr, DWORD expect_mask, DWORD expect_attr, UINT expect_items)
static CLIPFORMAT g_DataObjectAttributes
#define ok_int(expression, result)
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
HRESULT GetData([in, unique] FORMATETC *pformatetcIn, [out] STGMEDIUM *pmedium)
#define expect_hr(expected, got)
#define FILE_ATTRIBUTE_READONLY
@ COINIT_APARTMENTTHREADED
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
HRESULT WINAPI SHParseDisplayName(LPCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl)
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)
HRESULT WINAPI CIDLData_CreateFromIDArray(PCIDLIST_ABSOLUTE pidlFolder, UINT cpidlFiles, PCUIDLIST_RELATIVE_ARRAY lppidlFiles, LPDATAOBJECT *ppdataObject)
#define FAILED_UNEXPECTEDLY(hr)
EXTERN_C HRESULT WINAPI SHGetAttributesFromDataObject(IDataObject *pDataObject, DWORD dwAttributeMask, DWORD *pdwAttributes, UINT *pcItems)
const ITEMIDLIST_ABSOLUTE UNALIGNED * PCUIDLIST_ABSOLUTE
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
void Create(LPCWSTR Folder)
UINT WINAPI RegisterClipboardFormatW(_In_ LPCWSTR)
#define IID_PPV_ARG(Itype, ppType)