19 CComPtr<IDataObject> spDataObj;
29 hr = spDataObj->DUnadvise(0);
32 hr = spDataObj->EnumDAdvise(
NULL);
36 FORMATETC
in = {1, (DVTARGETDEVICE*)2, 3, 4, 5};
37 FORMATETC
out = {6, (DVTARGETDEVICE*)7, 8, 9, 10};
39 hr = spDataObj->GetCanonicalFormatEtc(&
in, &
out);
49 trace(
"out unmodified\n");
58 trace(
"in copied to out\n");
63#define ok_wstri(x, y) \
64 ok(wcsicmp(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x)
143 CComPtr<IDataObject> spDataObj;
150 CComPtr<IEnumFORMATETC> pEnumFmt;
151 hr = spDataObj->EnumFormatEtc(DATADIR_GET, &pEnumFmt);
168 char szGot[512], szExpected[512];
179 ok(
fmt.dwAspect == DVASPECT_CONTENT,
"Got 0x%lu, expected 0x%d for [%u].dwAspect\n",
fmt.dwAspect, DVASPECT_CONTENT,
Count);
180 ok(
fmt.lindex == -1,
"Got 0x%lx, expected 0x%x for [%u].lindex\n",
fmt.lindex, -1,
Count);
181 ok(
fmt.tymed == TYMED_HGLOBAL,
"Got 0x%lu, expected 0x%d for [%u].tymed\n",
fmt.tymed, TYMED_HGLOBAL,
Count);
219 STGMEDIUM medium = {0};
220 FORMATETC etc = { (CLIPFORMAT)
Expected[
Count],
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
221 char szExpected[512];
224 hr = spDataObj->GetData(&etc, &medium);
225 HRESULT hr2 = spDataObj->QueryGetData(&etc);
228 if (
Count < ExpectedCount)
231 ok(medium.tymed == TYMED_HGLOBAL,
"0x%lx (0x%x(%s))\n", medium.tymed,
Expected[
Count], szExpected);
232 if (
hr ==
S_OK && medium.tymed == TYMED_HGLOBAL)
236 TestFormats[
Count](
pData,
Size, ExpectRoot, ExpectItem1, ExpectItem2);
254 FORMATETC formatetc = {
Format,
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
257 hr = spDataObj->GetData(&formatetc, &medium);
267 CComPtr<IDataObject> spDataObj;
274 STGMEDIUM medium = {0};
275 medium.tymed = TYMED_HGLOBAL;
277 ok(medium.hGlobal !=
NULL,
"Download more ram\n");
288 FORMATETC etc2 = etc;
291 hr = spDataObj->SetData(&etc, &medium,
FALSE);
298 hr = spDataObj->SetData(&etc, &medium,
TRUE);
309 STGMEDIUM medium2 = {0};
312 etc2.dwAspect = DVASPECT_DOCPRINT;
313 hr = spDataObj->GetData(&etc2, &medium2);
314 HRESULT hr2 = spDataObj->QueryGetData(&etc2);
321 etc2.dwAspect = DVASPECT_CONTENT;
322 etc2.tymed = TYMED_NULL;
323 hr = spDataObj->GetData(&etc2, &medium2);
324 hr2 = spDataObj->QueryGetData(&etc2);
330 etc2.tymed = TYMED_HGLOBAL;
333 hr = spDataObj->GetData(&etc2, &medium2);
334 hr2 = spDataObj->QueryGetData(&etc2);
339 ok_hex(medium2.tymed, TYMED_HGLOBAL);
343 ok(medium2.pUnkForRelease == (
IUnknown*)spDataObj,
"Expected the data object (0x%p), got 0x%p\n",
344 (
IUnknown*)spDataObj, medium2.pUnkForRelease);
345 ok(medium.hGlobal == medium2.hGlobal,
"Pointers are not the same!, got 0x%p and 0x%p\n", medium.hGlobal, medium2.hGlobal);
350 ok(medium.hGlobal != medium2.hGlobal,
"Pointers are the same!\n");
411 CComHeapPtr<ITEMIDLIST_ABSOLUTE> pidlWindows;
412 CComHeapPtr<ITEMIDLIST_ABSOLUTE> pidlSystem32;
413 CComHeapPtr<ITEMIDLIST_ABSOLUTE> pidlResources;
430 CComPtr<IShellFolder> shellFolder;
static void TestSetAndGetExtraFormat(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUIDLIST_RELATIVE_ARRAY apidl)
static void TestFilenameW(PVOID pData, SIZE_T Size, LPCWSTR ExpectRoot, LPCWSTR ExpectPath1, LPCWSTR ExpectPath2)
static void TestAdviseAndCanonical(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUIDLIST_RELATIVE_ARRAY apidl)
static DWORD g_WinVersion
static void TestFilenameA(PVOID pData, SIZE_T Size, LPCWSTR ExpectRoot, LPCWSTR ExpectPath1, LPCWSTR ExpectPath2)
static void TestHDROP(PVOID pData, SIZE_T Size, LPCWSTR ExpectRoot, LPCWSTR ExpectPath1, LPCWSTR ExpectPath2)
static void TestHIDA(PVOID pData, SIZE_T Size, LPCWSTR ExpectRoot, LPCWSTR ExpectPath1, LPCWSTR ExpectPath2)
static void TestDefaultFormat(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUIDLIST_RELATIVE_ARRAY apidl)
#define ok_hex(expression, result)
#define ok_size_t(expression, result)
#define ok_int(expression, result)
#define ok_ptr(expression, result)
NTSTATUS NTAPI RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
HRESULT WINAPI SHGetFolderLocation(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPITEMIDLIST *ppidl)
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
HRESULT WINAPI SHStrDupA(LPCSTR lpszStr, LPWSTR *lppszDest)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
UINT NTAPI GlobalFlags(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
@ COINIT_APARTMENTTHREADED
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
#define _WIN32_WINNT_WIN8
#define _WIN32_WINNT_VISTA
HRESULT WINAPI CIDLData_CreateFromIDArray(PCIDLIST_ABSOLUTE pidlFolder, UINT cpidlFiles, PCUIDLIST_RELATIVE_ARRAY lppidlFiles, LPDATAOBJECT *ppdataObject)
static PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const *pida, SIZE_T i)
static PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const *pida)
#define CFSTR_INDRAGLOOPA
static const WCHAR CFSTR_PREFERREDDROPEFFECTW[]
#define CFSTR_SHELLIDLISTA
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
const PCUIDLIST_RELATIVE * PCUIDLIST_RELATIVE_ARRAY
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
ULONG dwOSVersionInfoSize
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
DWORD WINAPI GetLastError(void)
#define GMEM_INVALID_HANDLE
#define OLE_E_ADVISENOTSUPPORTED
#define DATA_S_SAMEFORMATETC
int WINAPI GetClipboardFormatNameA(_In_ UINT format, _Out_writes_(cchMaxCount) LPSTR lpszFormatName, _In_ int cchMaxCount)
UINT WINAPI RegisterClipboardFormatW(_In_ LPCWSTR)
UINT WINAPI RegisterClipboardFormatA(_In_ LPCSTR)
#define IID_PPV_ARG(Itype, ppType)