22 CComPtr<IDataObject> spDataObj;
32 hr = spDataObj->DUnadvise(0);
35 hr = spDataObj->EnumDAdvise(
NULL);
39 FORMATETC
in = {1, (DVTARGETDEVICE*)2, 3, 4, 5};
40 FORMATETC
out = {6, (DVTARGETDEVICE*)7, 8, 9, 10};
42 hr = spDataObj->GetCanonicalFormatEtc(&
in, &
out);
52 trace(
"out unmodified\n");
61 trace(
"in copied to out\n");
66#define ok_wstri(x, y) \
67 ok(wcsicmp(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x)
146 CComPtr<IDataObject> spDataObj;
153 CComPtr<IEnumFORMATETC> pEnumFmt;
154 hr = spDataObj->EnumFormatEtc(DATADIR_GET, &pEnumFmt);
171 char szGot[512], szExpected[512];
182 ok(
fmt.dwAspect == DVASPECT_CONTENT,
"Got 0x%lu, expected 0x%d for [%u].dwAspect\n",
fmt.dwAspect, DVASPECT_CONTENT,
Count);
183 ok(
fmt.lindex == -1,
"Got 0x%lx, expected 0x%x for [%u].lindex\n",
fmt.lindex, -1,
Count);
184 ok(
fmt.tymed == TYMED_HGLOBAL,
"Got 0x%lu, expected 0x%d for [%u].tymed\n",
fmt.tymed, TYMED_HGLOBAL,
Count);
222 STGMEDIUM medium = {0};
223 FORMATETC etc = { (CLIPFORMAT)
Expected[
Count],
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
224 char szExpected[512];
227 hr = spDataObj->GetData(&etc, &medium);
228 HRESULT hr2 = spDataObj->QueryGetData(&etc);
231 if (
Count < ExpectedCount)
234 ok(medium.tymed == TYMED_HGLOBAL,
"0x%lx (0x%x(%s))\n", medium.tymed,
Expected[
Count], szExpected);
235 if (
hr ==
S_OK && medium.tymed == TYMED_HGLOBAL)
239 TestFormats[
Count](
pData,
Size, ExpectRoot, ExpectItem1, ExpectItem2);
256 FORMATETC formatetc = {
Format,
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
259 hr = spDataObj->GetData(&formatetc, &medium);
269 CComPtr<IDataObject> spDataObj;
276 STGMEDIUM medium = {0};
277 medium.tymed = TYMED_HGLOBAL;
279 ok(medium.hGlobal !=
NULL,
"Download more ram\n");
290 FORMATETC etc2 = etc;
293 hr = spDataObj->SetData(&etc, &medium,
FALSE);
300 hr = spDataObj->SetData(&etc, &medium,
TRUE);
311 STGMEDIUM medium2 = {0};
314 etc2.dwAspect = DVASPECT_DOCPRINT;
315 hr = spDataObj->GetData(&etc2, &medium2);
316 HRESULT hr2 = spDataObj->QueryGetData(&etc2);
323 etc2.dwAspect = DVASPECT_CONTENT;
324 etc2.tymed = TYMED_NULL;
325 hr = spDataObj->GetData(&etc2, &medium2);
326 hr2 = spDataObj->QueryGetData(&etc2);
332 etc2.tymed = TYMED_HGLOBAL;
335 hr = spDataObj->GetData(&etc2, &medium2);
336 hr2 = spDataObj->QueryGetData(&etc2);
341 ok_hex(medium2.tymed, TYMED_HGLOBAL);
345 ok(medium2.pUnkForRelease == (
IUnknown*)spDataObj,
"Expected the data object (0x%p), got 0x%p\n",
346 (
IUnknown*)spDataObj, medium2.pUnkForRelease);
347 ok(medium.hGlobal == medium2.hGlobal,
"Pointers are not the same!, got 0x%p and 0x%p\n", medium.hGlobal, medium2.hGlobal);
352 ok(medium.hGlobal != medium2.hGlobal,
"Pointers are the same!\n");
408 skip(
"shell32!SHCreateDataObject not exported\n");
420 CComHeapPtr<ITEMIDLIST_ABSOLUTE> pidlWindows;
421 CComHeapPtr<ITEMIDLIST_ABSOLUTE> pidlSystem32;
422 CComHeapPtr<ITEMIDLIST_ABSOLUTE> pidlResources;
439 CComPtr<IShellFolder> shellFolder;
HRESULT WINAPI SHCreateDataObject(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IDataObject *pdtInner, REFIID riid, void **ppv)
static void TestSetAndGetExtraFormat(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUIDLIST_RELATIVE_ARRAY apidl)
HRESULT(WINAPI * tSHCreateDataObject)(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IDataObject *pdtInner, REFIID riid, void **ppv)
static tSHCreateDataObject pSHCreateDataObject
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)
#define GetProcAddress(x, y)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
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
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 PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
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)