24#define NONAMELESSUNION
36#define InitFormatEtc(fe, cf, med) \
39 (fe).dwAspect=DVASPECT_CONTENT;\
49 sprintf(
buf,
"cf %04x ptd %p aspect %x lindex %d tymed %x",
121 IEnumFORMATETC_AddRef(iface);
122 *ppvObj = &
This->IEnumFORMATETC_iface;
150 FORMATETC *rgelt,
ULONG *pceltFetched)
156 trace(
"next: count %d cur %d\n", celt,
This->cur);
173 *pceltFetched =
count;
179 ok(0,
"unexpected call\n");
193 ok(0,
"unexpected call\n");
215 ret->fmtetc_cnt = fmtetc_cnt;
217 memcpy(
ret->fmtetc, fmtetc, fmtetc_cnt*
sizeof(FORMATETC));
218 *lplpformatetc = &
ret->IEnumFORMATETC_iface;
227 IDataObject_AddRef(iface);
228 *ppvObj = &
This->IDataObject_iface;
251 for(
i = 0;
i <
This->fmtetc_cnt;
i++)
254 if(
This->stm) IStream_Release(
This->stm);
255 if(
This->stg) IStorage_Release(
This->stg);
277 ok(pmedium->tymed == 0,
"pmedium->tymed = %u\n", pmedium->tymed);
278 ok(
U(*pmedium).hGlobal ==
NULL,
"pmedium->hGlobal = %p\n",
U(*pmedium).hGlobal);
279 ok(pmedium->pUnkForRelease ==
NULL,
"pmedium->pUnkForRelease = %p\n", pmedium->pUnkForRelease);
281 if(pformatetc->lindex != -1)
284 for(
i = 0;
i <
This->fmtetc_cnt;
i++)
286 if(
This->fmtetc[
i].cfFormat == pformatetc->cfFormat)
288 if(
This->fmtetc[
i].tymed & pformatetc->tymed)
290 pmedium->pUnkForRelease = (
LPUNKNOWN)iface;
291 IUnknown_AddRef(pmedium->pUnkForRelease);
295 pmedium->tymed = TYMED_HGLOBAL;
296 U(*pmedium).hGlobal =
This->text;
298 else if(pformatetc->cfFormat ==
cf_stream)
300 pmedium->tymed = TYMED_ISTREAM;
301 IStream_AddRef(
This->stm);
302 U(*pmedium).pstm =
This->stm;
306 pmedium->tymed = TYMED_ISTORAGE;
307 IStorage_AddRef(
This->stg);
308 U(*pmedium).pstg =
This->stg;
312 pmedium->tymed = TYMED_MFPICT;
313 U(*pmedium).hMetaFilePict =
This->hmfp;
339 ok(0,
"unexpected call to DataObjectImpl_QueryGetData\n");
341 if(pformatetc->lindex != -1)
344 for(
i=0;
i<
This->fmtetc_cnt;
i++) {
345 if(
This->fmtetc[
i].cfFormat == pformatetc->cfFormat) {
347 if(
This->fmtetc[
i].tymed == pformatetc->tymed)
355 FORMATETC *pformatetcOut)
357 ok(0,
"unexpected call\n");
362 STGMEDIUM *pmedium,
BOOL fRelease)
364 ok(0,
"unexpected call\n");
375 if(dwDirection != DATADIR_GET) {
376 ok(0,
"unexpected direction %d\n", dwDirection);
385 ok(0,
"unexpected call\n");
391 ok(0,
"unexpected call\n");
397 ok(0,
"unexpected call\n");
466 ILockBytes_Release(lbs);
479 memset(&dm, 0,
sizeof(dm));
485 obj->fmtetc[3].ptd->tdDriverNameOffset =
FIELD_OFFSET(DVTARGETDEVICE, tdData);
486 obj->fmtetc[3].ptd->tdDeviceNameOffset = 0;
487 obj->fmtetc[3].ptd->tdPortNameOffset = 0;
488 obj->fmtetc[3].ptd->tdExtDevmodeOffset =
obj->fmtetc[3].ptd->tdDriverNameOffset +
sizeof(
device_name);
497 obj->fmtetc[7].dwAspect = DVASPECT_ICON;
512 if (pDObj && pDObj != (
IDataObject *)0xdeadbeef) IDataObject_Release(pDObj);
523 ok(
hr ==
E_INVALIDARG,
"OleGetClipboard(NULL) should return E_INVALIDARG instead of 0x%08x\n",
hr);
526 ok(
hr ==
S_OK,
"OleGetClipboard failed with error 0x%08x\n",
hr);
534 hr = IDataObject_QueryGetData(data_obj, &fmtetc);
535 ok(
hr ==
S_OK,
"IDataObject_QueryGetData failed with error 0x%08x\n",
hr);
538 fmtetc.dwAspect = 0xdeadbeef;
539 hr = IDataObject_QueryGetData(data_obj, &fmtetc);
540 ok(
hr ==
DV_E_FORMATETC,
"IDataObject_QueryGetData should have failed with DV_E_FORMATETC instead of 0x%08x\n",
hr);
543 fmtetc.dwAspect = DVASPECT_THUMBNAIL;
544 hr = IDataObject_QueryGetData(data_obj, &fmtetc);
545 ok(
hr ==
DV_E_FORMATETC,
"IDataObject_QueryGetData should have failed with DV_E_FORMATETC instead of 0x%08x\n",
hr);
549 hr = IDataObject_QueryGetData(data_obj, &fmtetc);
551 "IDataObject_QueryGetData should have failed with DV_E_FORMATETC instead of 0x%08x\n",
hr);
554 hr = IDataObject_QueryGetData(data_obj, &fmtetc);
555 ok(
hr ==
DV_E_CLIPFORMAT,
"IDataObject_QueryGetData should have failed with DV_E_CLIPFORMAT instead of 0x%08x\n",
hr);
558 hr = IDataObject_QueryGetData(data_obj, &fmtetc);
559 ok(
hr ==
S_OK,
"IDataObject_QueryGetData failed with error 0x%08x\n",
hr);
568 hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
569 ok(
hr ==
S_OK,
"IDataObject_GetData failed with error 0x%08x\n",
hr);
573 fmtetc.dwAspect = 0xdeadbeef;
574 hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
575 ok(
hr ==
S_OK,
"IDataObject_GetData failed with error 0x%08x\n",
hr);
579 fmtetc.dwAspect = DVASPECT_THUMBNAIL;
580 hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
581 ok(
hr ==
S_OK,
"IDataObject_GetData failed with error 0x%08x\n",
hr);
586 hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
596 hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
597 ok(
hr ==
DV_E_FORMATETC,
"IDataObject_GetData should have failed with DV_E_FORMATETC instead of 0x%08x\n",
hr);
601 hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
602 ok(
hr ==
DV_E_TYMED,
"IDataObject_GetData should have failed with DV_E_TYMED instead of 0x%08x\n",
hr);
607 IDataObject_Release(data_obj);
615 FORMATETC
fmt, src_fmt;
619 ok(
hr ==
S_OK,
"OleGetClipboard failed with error 0x%08x\n",
hr);
621 hr = IDataObject_EnumFormatEtc(
data, DATADIR_SET, &enum_fmt);
627 hr = IDataObject_EnumFormatEtc(
data, DATADIR_GET, &enum_fmt);
632 skip(
"EnumFormatEtc failed, skipping tests.\n");
636 if(
src) IDataObject_EnumFormatEtc(
src, DATADIR_GET, &src_enum);
638 while((
hr = IEnumFORMATETC_Next(enum_fmt, 1, &
fmt,
NULL)) ==
S_OK)
641 hr = IEnumFORMATETC_Next(src_enum, 1, &src_fmt,
NULL);
644 ok(
fmt.cfFormat == src_fmt.cfFormat,
"%d: %04x %04x\n",
count,
fmt.cfFormat, src_fmt.cfFormat);
645 ok(
fmt.dwAspect == src_fmt.dwAspect,
"%d: %08x %08x\n",
count,
fmt.dwAspect, src_fmt.dwAspect);
646 ok(
fmt.lindex == src_fmt.lindex,
"%d: %08x %08x\n",
count,
fmt.lindex, src_fmt.lindex);
647 ok(
fmt.tymed == src_fmt.tymed,
"%d: %08x %08x\n",
count,
fmt.tymed, src_fmt.tymed);
650 ok(src_fmt.ptd !=
NULL,
"%d: expected non-NULL\n",
count);
661 hr = IEnumFORMATETC_Next(src_enum, 1, &src_fmt,
NULL);
663 IEnumFORMATETC_Release(src_enum);
666 hr = IEnumFORMATETC_Reset(enum_fmt);
674 hr = IEnumFORMATETC_Next(enum_fmt, 1, &third_fmt,
NULL);
676 hr = IEnumFORMATETC_Next(enum_fmt, 1, &third_fmt,
NULL);
678 hr = IEnumFORMATETC_Next(enum_fmt, 1, &third_fmt,
NULL);
681 hr = IEnumFORMATETC_Reset(enum_fmt);
683 hr = IEnumFORMATETC_Skip(enum_fmt, 2);
686 hr = IEnumFORMATETC_Clone(enum_fmt, &clone);
688 hr = IEnumFORMATETC_Next(enum_fmt, 1, &
fmt,
NULL);
690 ok(
fmt.cfFormat == third_fmt.cfFormat,
"formats don't match\n");
691 hr = IEnumFORMATETC_Next(clone, 1, &
fmt,
NULL);
693 ok(
fmt.cfFormat == third_fmt.cfFormat,
"formats don't match\n");
694 IEnumFORMATETC_Release(clone);
697 IEnumFORMATETC_Release(enum_fmt);
698 IDataObject_Release(
data);
709 ok(!
h,
"got %p\n",
h);
711 ok(!
h,
"got %p\n",
h);
727 if(
cf == cf_dataobject)
734 found_dataobject =
TRUE;
737 ok(*
ptr == clip_owner,
"hwnd %p clip_owner %p\n", *
ptr, clip_owner);
742 else if(
cf == cf_ole_priv_data)
744 found_priv_data =
TRUE;
752 win_skip(
"Ole Private Data in win9x format\n");
762 BOOL first_use_of_cf;
772 struct formatetcetc
fmts[1];
773 } *priv = (
struct priv_data*)
ptr;
774 CLIPFORMAT cfs_seen[10];
776 hr = IDataObject_EnumFormatEtc(
data, DATADIR_GET, &enum_fmt);
778 fmt_ptr = priv->fmts;
780 while(IEnumFORMATETC_Next(enum_fmt, 1, &
fmt,
NULL) ==
S_OK)
785 ok(fmt_ptr->fmt.cfFormat ==
fmt.cfFormat,
786 "got %08x expected %08x\n", fmt_ptr->fmt.cfFormat,
fmt.cfFormat);
787 ok(fmt_ptr->fmt.dwAspect ==
fmt.dwAspect,
"got %08x expected %08x\n",
788 fmt_ptr->fmt.dwAspect,
fmt.dwAspect);
789 ok(fmt_ptr->fmt.lindex ==
fmt.lindex,
"got %08x expected %08x\n",
790 fmt_ptr->fmt.lindex,
fmt.lindex);
791 ok(fmt_ptr->fmt.tymed ==
fmt.tymed,
"got %08x expected %08x\n",
792 fmt_ptr->fmt.tymed,
fmt.tymed);
794 if(fmt_ptr->fmt.cfFormat == cfs_seen[
i])
800 ok(fmt_ptr->first_use_of_cf != seen_cf,
"got %08x expected %08x\n",
801 fmt_ptr->first_use_of_cf, !seen_cf);
802 ok(fmt_ptr->res[0] == 0,
"got %08x\n", fmt_ptr->res[0]);
803 ok(fmt_ptr->res[1] == 0,
"got %08x\n", fmt_ptr->res[1]);
808 ok(fmt_ptr->fmt.ptd !=
NULL,
"target device offset zero\n");
816 ok(priv->res1 == 0,
"got %08x\n", priv->res1);
817 ok(priv->res2 == 1,
"got %08x\n", priv->res2);
818 ok(priv->count ==
count,
"got %08x expected %08x\n", priv->count,
count);
819 ok(priv->res3[0] == 0,
"got %08x\n", priv->res3[0]);
822 if(
sizeof(fmt_ptr->fmt.ptd) == 8)
823 todo_wine ok(priv->res3[1] == 1,
"got %08x\n", priv->res3[1]);
825 ok(priv->res3[1] == 0,
"got %08x\n", priv->res3[1]);
828 IEnumFORMATETC_Release(enum_fmt);
866 ok(found_dataobject,
"didn't find cf_dataobject\n");
867 ok(found_priv_data,
"didn't find cf_ole_priv_data\n");
878 ok(
hr ==
S_OK,
"OleGetClipboard failed with error 0x%08x\n",
hr);
883 hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
884 ok(
hr ==
S_OK,
"IDataObject_GetData failed with error 0x%08x\n",
hr);
888 hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
893 hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
898 hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium);
899 ok(
hr ==
S_OK,
"IDataObject_GetData failed with error 0x%08x\n",
hr);
903 "DataObjectImpl_GetData called 5 times instead of %d times\n",
905 IDataObject_Release(data_obj);
923 ok(
hr ==
S_OK,
"Failed to create data1 object: 0x%08x\n",
hr);
927 ok(
hr ==
S_OK,
"Failed to create data2 object: 0x%08x\n",
hr);
931 ok(
hr ==
S_OK,
"Failed to create complex data object: 0x%08x\n",
hr);
944 ok(
hr ==
S_OK,
"OleInitialize failed with error 0x%08x\n",
hr);
947 ok(
hr ==
S_OK,
"failed to set clipboard to data1, hr = 0x%08x\n",
hr);
952 ok(
hr ==
S_OK,
"expected current clipboard to be data1, hr = 0x%08x\n",
hr);
954 ok(
hr ==
S_FALSE,
"did not expect current clipboard to be data2, hr = 0x%08x\n",
hr);
961 ok(
hr ==
S_OK,
"failed to set clipboard to data2, hr = 0x%08x\n",
hr);
963 ok(
hr ==
S_FALSE,
"did not expect current clipboard to be data1, hr = 0x%08x\n",
hr);
965 ok(
hr ==
S_OK,
"expected current clipboard to be data2, hr = 0x%08x\n",
hr);
973 ok(
ptr &&
ptr != hblob,
"got fixed block %p / %p\n",
ptr, hblob );
977 ok(
h == hblob,
"got %p\n",
h);
979 ok(
h == hblob,
"got %p / %p\n",
h, hblob);
986 ok(
hr ==
S_OK,
"failed to flush clipboard, hr = 0x%08x\n",
hr);
988 ok(
hr ==
S_FALSE,
"did not expect current clipboard to be data1, hr = 0x%08x\n",
hr);
990 ok(
hr ==
S_FALSE,
"did not expect current clipboard to be data2, hr = 0x%08x\n",
hr);
997 ok(
h == hblob,
"got %p\n",
h);
1012 trace(
"setting complex\n");
1014 ok(
hr ==
S_OK,
"failed to set clipboard to complex data, hr = 0x%08x\n",
hr);
1025 ok(
ref == 0,
"expected data1 ref=0, got %d\n",
ref);
1027 ok(
ref == 0,
"expected data2 ref=0, got %d\n",
ref);
1028 ref = IDataObject_Release(data_cmpl);
1029 ok(
ref == 0,
"expected data_cmpl ref=0, got %d\n",
ref);
1052 "OleIsCurrentClipboard returned %x\n",
hr );
1088 ok(
hr ==
S_OK,
"Failed to create data object: 0x%08x\n",
hr);
1090 memset(&cls, 0,
sizeof(cls));
1096 viewer =
CreateWindowA(
"clipboard_test",
NULL, 0, 0, 0, 0, 0,
NULL, 0,
NULL, 0);
1101 ok(
ret == 1,
"%u WM_DRAWCLIPBOARD received\n",
ret );
1104 ok(
hr ==
S_OK,
"OleInitialize failed with error 0x%08x\n",
hr);
1107 ok( !
ret,
"%u WM_DRAWCLIPBOARD received\n",
ret );
1116 ok(
hr ==
S_OK,
"failed to set clipboard to data, hr = 0x%08x\n",
hr);
1119 ok(
ret == 2,
"%u WM_DRAWCLIPBOARD received\n",
ret );
1123 ok(
hr ==
S_OK,
"failed to flush clipboard, hr = 0x%08x\n",
hr);
1124 ret = IDataObject_Release(
data);
1134 IDataObject_AddRef(
d);
1135 return IDataObject_Release(
d);
1142 ULONG refs, old_refs;
1167 ok(get1 == get2,
"data objects differ\n");
1168 refs = IDataObject_Release(get2);
1169 ok(refs == (get1 == get2 ? 1 : 0),
"got %d\n", refs);
1174 hr = IDataObject_GetData(get1, &
fmt, &med);
1182 ok(get1 != get2,
"data objects match\n");
1189 ok(get1 != get3,
"data objects match\n");
1190 ok(get2 != get3,
"data objects match\n");
1192 IDataObject_Release(get3);
1193 IDataObject_Release(get2);
1194 IDataObject_Release(get1);
1208 ok(refs == old_refs,
"%d %d\n", refs, old_refs);
1211 hr = IDataObject_GetData(get1, &
fmt, &med);
1216 ok(refs == old_refs + 1,
"%d %d\n", refs, old_refs);
1221 hr = IDataObject_GetData(get1, &
fmt, &med);
1227 ok(refs == 2,
"%d\n", refs);
1229 IDataObject_Release(get1);
1232 ok(refs == 1,
"%d\n", refs);
1246 ok(refs == old_refs,
"%d %d\n", refs, old_refs);
1254 hr = IDataObject_GetData(get1, &
fmt, &med);
1260 ok(refs == 1,
"%d\n", refs);
1262 ok(refs == old_refs + 1,
"%d %d\n", refs, old_refs);
1267 ok(refs == 2,
"%d\n", refs);
1269 IDataObject_Release(get1);
1271 IDataObject_Release(src2);
1276 ok(old_refs == 1,
"%d\n", old_refs);
1280 ok(refs > old_refs,
"%d %d\n", refs, old_refs);
1284 ok(refs == 2,
"%d\n", refs);
1286 IDataObject_Release(
src);
1300 IStorage_Release(stg);
1303 ILockBytes_Release(ilb);
1333 hr = IDataObject_GetData(
get, &
fmt, &med);
1335 ok(med.tymed == TYMED_HGLOBAL,
"got %x\n", med.tymed);
1339 hr = IDataObject_GetData(
get, &
fmt, &med);
1341 ok(med.tymed == TYMED_ISTREAM,
"got %x\n", med.tymed);
1345 hr = IDataObject_GetData(
get, &
fmt, &med);
1350 hr = IDataObject_GetData(
get, &
fmt, &med);
1352 ok(med.tymed == TYMED_HGLOBAL,
"got %x\n", med.tymed);
1358 hr = IDataObject_GetData(
get, &
fmt, &med);
1360 ok(med.tymed == TYMED_ISTREAM,
"got %x\n", med.tymed);
1364 hr = IDataObject_GetData(
get, &
fmt, &med);
1369 hr = IDataObject_GetData(
get, &
fmt, &med);
1371 ok(med.tymed == TYMED_HGLOBAL,
"got %x\n", med.tymed);
1375 hr = IDataObject_GetData(
get, &
fmt, &med);
1377 ok(med.tymed == TYMED_ISTREAM,
"got %x\n", med.tymed);
1383 hr = IDataObject_GetData(
get, &
fmt, &med);
1385 ok(med.tymed == TYMED_ISTORAGE,
"got %x\n", med.tymed);
1387 hr = IStorage_Stat(med.pstg, &
stat, STATFLAG_NONAME);
1394 hr = IDataObject_GetData(
get, &
fmt, &med);
1396 ok(med.tymed == TYMED_ISTREAM,
"got %x\n", med.tymed);
1400 hr = IDataObject_GetData(
get, &
fmt, &med);
1402 ok(med.tymed == TYMED_HGLOBAL,
"got %x\n", med.tymed);
1406 hr = IDataObject_GetData(
get, &
fmt, &med);
1408 ok(med.tymed == TYMED_HGLOBAL,
"got %x\n", med.tymed);
1412 hr = IDataObject_GetData(
get, &
fmt, &med);
1414 ok(med.tymed == TYMED_ISTORAGE,
"got %x\n", med.tymed);
1420 hr = IDataObject_GetData(
get, &
fmt, &med);
1427 memset(&dm, 0,
sizeof(dm));
1434 fmt.ptd->tdDeviceNameOffset = 0;
1435 fmt.ptd->tdPortNameOffset = 0;
1436 fmt.ptd->tdExtDevmodeOffset =
fmt.ptd->tdDriverNameOffset +
sizeof(
device_name);
1440 hr = IDataObject_GetData(
get, &
fmt, &med);
1442 ok(med.tymed == TYMED_ISTORAGE,
"got %x\n", med.tymed);
1450 hr = IDataObject_GetData(
get, &
fmt, &med);
1454 IDataObject_Release(
get);
1455 IDataObject_Release(
src);
1466 hr = IDataObject_GetData(
get, &
fmt, &med);
1468 ok(med.tymed == TYMED_ISTORAGE,
"got %x\n", med.tymed);
1470 IDataObject_Release(
get);
1479 hr = IDataObject_GetData(
get, &
fmt, &med);
1481 ok(med.tymed == TYMED_ISTORAGE,
"got %x\n", med.tymed);
1485 hr = IDataObject_GetData(
get, &
fmt, &med);
1487 ok(med.tymed == TYMED_HGLOBAL,
"got %x\n", med.tymed);
1490 IDataObject_Release(
get);
1491 IDataObject_Release(
src);
1507 const RECT rect = {0, 0, 100, 100};
1537 hr = IDataObject_EnumFormatEtc(
get, DATADIR_GET, &enum_fmt);
1540 hr = IEnumFORMATETC_Next(enum_fmt, 1, &
fmt,
NULL);
1542 IEnumFORMATETC_Release(enum_fmt);
1544 IDataObject_Release(
get);
1556 ok(
h == htext,
"got %p\n",
h);
1558 ok(
h == hblob,
"got %p\n",
h);
1562 ok(
h == hstorage,
"got %p\n",
h);
1568 hr = IDataObject_EnumFormatEtc(
get, DATADIR_GET, &enum_fmt);
1572 skip(
"EnumFormatEtc failed, skipping tests.\n");
1576 hr = IEnumFORMATETC_Next(enum_fmt, 1, &
fmt,
NULL);
1580 ok(
fmt.dwAspect == DVASPECT_CONTENT,
"aspect %x\n",
fmt.dwAspect);
1581 ok(
fmt.lindex == -1,
"lindex %d\n",
fmt.lindex);
1582 ok(
fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL),
"tymed %x\n",
fmt.tymed);
1584 hr = IEnumFORMATETC_Next(enum_fmt, 1, &
fmt,
NULL);
1588 ok(
fmt.dwAspect == DVASPECT_CONTENT,
"aspect %x\n",
fmt.dwAspect);
1589 ok(
fmt.lindex == -1,
"lindex %d\n",
fmt.lindex);
1590 ok(
fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL),
"tymed %x\n",
fmt.tymed);
1592 hr = IEnumFORMATETC_Next(enum_fmt, 1, &
fmt,
NULL);
1596 ok(
fmt.dwAspect == DVASPECT_CONTENT,
"aspect %x\n",
fmt.dwAspect);
1597 ok(
fmt.lindex == -1,
"lindex %d\n",
fmt.lindex);
1598 ok(
fmt.tymed == TYMED_ENHMF,
"tymed %x\n",
fmt.tymed);
1600 hr = IEnumFORMATETC_Next(enum_fmt, 1, &
fmt,
NULL);
1604 ok(
fmt.dwAspect == DVASPECT_CONTENT,
"aspect %x\n",
fmt.dwAspect);
1605 ok(
fmt.lindex == -1,
"lindex %d\n",
fmt.lindex);
1606 ok(
fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL),
"tymed %x\n",
fmt.tymed);
1608 hr = IEnumFORMATETC_Next(enum_fmt, 1, &
fmt,
NULL);
1613 ok(
fmt.dwAspect == DVASPECT_CONTENT,
"aspect %x\n",
fmt.dwAspect);
1614 ok(
fmt.lindex == -1,
"lindex %d\n",
fmt.lindex);
1615 todo_wine ok(
fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL),
"tymed %x\n",
fmt.tymed);
1617 hr = IEnumFORMATETC_Next(enum_fmt, 1, &
fmt,
NULL);
1622 ok(
fmt.dwAspect == DVASPECT_CONTENT,
"aspect %x\n",
fmt.dwAspect);
1623 ok(
fmt.lindex == -1,
"lindex %d\n",
fmt.lindex);
1624 ok(
fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL),
"tymed %x\n",
fmt.tymed);
1626 hr = IEnumFORMATETC_Next(enum_fmt, 1, &
fmt,
NULL);
1630 ok(
fmt.dwAspect == DVASPECT_CONTENT,
"aspect %x\n",
fmt.dwAspect);
1631 ok(
fmt.lindex == -1,
"lindex %d\n",
fmt.lindex);
1632 ok(
fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL),
"tymed %x\n",
fmt.tymed);
1634 hr = IEnumFORMATETC_Next(enum_fmt, 1, &
fmt,
NULL);
1638 ok(
fmt.dwAspect == DVASPECT_CONTENT,
"aspect %x\n",
fmt.dwAspect);
1639 ok(
fmt.lindex == -1,
"lindex %d\n",
fmt.lindex);
1640 ok(
fmt.tymed == TYMED_MFPICT,
"tymed %x\n",
fmt.tymed);
1642 hr = IEnumFORMATETC_Next(enum_fmt, 1, &
fmt,
NULL);
1644 IEnumFORMATETC_Release(enum_fmt);
1647 hr = IDataObject_GetData(
get, &
fmt, &med);
1654 hr = IDataObject_GetData(
get, &
fmt, &med);
1656 ok(med.tymed == TYMED_ISTORAGE,
"got %x\n", med.tymed);
1659 IDataObject_Release(
get);
1696 med.pUnkForRelease =
NULL;
1697 med.tymed = TYMED_HGLOBAL;
1699 hr = IDataObject_GetDataHere(
get, &
fmt, &med);
1701 ok(med.tymed == TYMED_HGLOBAL,
"got %x\n", med.tymed);
1708 med.pUnkForRelease =
NULL;
1709 med.tymed = TYMED_HGLOBAL;
1711 hr = IDataObject_GetDataHere(
get, &
fmt, &med);
1713 ok(med.tymed == TYMED_HGLOBAL,
"got %x\n", med.tymed);
1718 med.pUnkForRelease =
NULL;
1719 med.tymed = TYMED_HGLOBAL;
1721 hr = IDataObject_GetDataHere(
get, &
fmt, &med);
1723 ok(med.tymed == TYMED_HGLOBAL,
"got %x\n", med.tymed);
1728 med.pUnkForRelease =
NULL;
1729 med.tymed = TYMED_ISTREAM;
1731 hr = IDataObject_GetDataHere(
get, &
fmt, &med);
1733 ok(med.tymed == TYMED_ISTREAM,
"got %x\n", med.tymed);
1738 med.pUnkForRelease =
NULL;
1739 med.tymed = TYMED_ISTORAGE;
1741 hr = IDataObject_GetDataHere(
get, &
fmt, &med);
1743 ok(med.tymed == TYMED_ISTORAGE,
"got %x\n", med.tymed);
1750 med.pUnkForRelease =
NULL;
1751 med.tymed = TYMED_HGLOBAL;
1753 hr = IDataObject_GetDataHere(
get, &
fmt, &med);
1755 ok(med.tymed == TYMED_HGLOBAL,
"got %x\n", med.tymed);
1760 med.pUnkForRelease =
NULL;
1761 med.tymed = TYMED_ISTREAM;
1763 hr = IDataObject_GetDataHere(
get, &
fmt, &med);
1765 ok(med.tymed == TYMED_ISTREAM,
"got %x\n", med.tymed);
1770 med.pUnkForRelease =
NULL;
1771 med.tymed = TYMED_ISTORAGE;
1773 hr = IDataObject_GetDataHere(
get, &
fmt, &med);
1775 ok(med.tymed == TYMED_ISTORAGE,
"got %x\n", med.tymed);
1782 med.pUnkForRelease =
NULL;
1783 med.tymed = TYMED_HGLOBAL;
1785 hr = IDataObject_GetDataHere(
get, &
fmt, &med);
1787 ok(med.tymed == TYMED_HGLOBAL,
"got %x\n", med.tymed);
1792 med.pUnkForRelease =
NULL;
1793 med.tymed = TYMED_ISTREAM;
1795 hr = IDataObject_GetDataHere(
get, &
fmt, &med);
1797 ok(med.tymed == TYMED_ISTREAM,
"got %x\n", med.tymed);
1802 med.pUnkForRelease =
NULL;
1803 med.tymed = TYMED_ISTORAGE;
1805 hr = IDataObject_GetDataHere(
get, &
fmt, &med);
1807 ok(med.tymed == TYMED_ISTORAGE,
"got %x\n", med.tymed);
1813 IDataObject_Release(
get);
1814 IDataObject_Release(
src);
1824 IDataObject_Release(data_obj);
1838 ok(
hr ==
S_OK,
"OleGetClipboard returned %x\n",
hr);
1846 ok(
hr ==
S_OK,
"OleGetClipboard returned %x\n",
hr);
1847 IDataObject_Release(data_obj);
1864 todo_wine ok(pDObj ==
NULL,
"OleGetClipboard() got 0x%p instead of NULL\n",pDObj);
1865 if (pDObj) IDataObject_Release(pDObj);
#define CO_E_NOTINITIALIZED
static POBJECT_TYPE GetObjectType(IN PCWSTR TypeName)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
#define InterlockedIncrement
#define InterlockedDecrement
void get(int argc, const char *argv[])
#define HeapFree(x, y, z)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
HRESULT WINAPI OleIsCurrentClipboard(IDataObject *data)
HRESULT WINAPI OleSetClipboard(IDataObject *data)
static snapshot * impl_from_IDataObject(IDataObject *iface)
static const char * dump_fmtetc(FORMATETC *fmt)
static enum_fmtetc * impl_from_IEnumFORMATETC(IEnumFORMATETC *iface)
HRESULT WINAPI OleFlushClipboard(void)
HRESULT WINAPI OleGetClipboard(IDataObject **obj)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
HRESULT WINAPI StgCreateDocfileOnILockBytes(ILockBytes *plkbyt, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
struct EnumFormatImpl EnumFormatImpl
static ULONG WINAPI EnumFormatImpl_AddRef(IEnumFORMATETC *iface)
static HRESULT WINAPI DataObjectImpl_GetDataHere(IDataObject *iface, FORMATETC *pformatetc, STGMEDIUM *pmedium)
static ULONG WINAPI DataObjectImpl_AddRef(IDataObject *iface)
static HRESULT WINAPI EnumFormatImpl_Skip(IEnumFORMATETC *iface, ULONG celt)
static HRESULT EnumFormatImpl_Create(const FORMATETC *fmtetc, UINT size, LPENUMFORMATETC *lplpformatetc)
static ULONG WINAPI EnumFormatImpl_Release(IEnumFORMATETC *iface)
static const IDataObjectVtbl VT_DataObjectImpl
static HRESULT WINAPI DataObjectImpl_QueryGetData(IDataObject *iface, FORMATETC *pformatetc)
static HRESULT WINAPI EnumFormatImpl_Next(IEnumFORMATETC *iface, ULONG celt, FORMATETC *rgelt, ULONG *pceltFetched)
static HRESULT WINAPI DataObjectImpl_DAdvise(IDataObject *iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
static HRESULT WINAPI DataObjectImpl_QueryInterface(IDataObject *iface, REFIID riid, LPVOID *ppvObj)
static HRESULT WINAPI DataObjectImpl_DUnadvise(IDataObject *iface, DWORD dwConnection)
static HRESULT WINAPI DataObjectImpl_EnumFormatEtc(IDataObject *iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
static ULONG WINAPI DataObjectImpl_Release(IDataObject *iface)
static HRESULT WINAPI DataObjectImpl_GetData(IDataObject *iface, FORMATETC *pformatetc, STGMEDIUM *pmedium)
static HRESULT WINAPI DataObjectImpl_GetCanonicalFormatEtc(IDataObject *iface, FORMATETC *pformatetcIn, FORMATETC *pformatetcOut)
static HRESULT WINAPI EnumFormatImpl_Clone(IEnumFORMATETC *iface, IEnumFORMATETC **ppenum)
static HRESULT WINAPI DataObjectImpl_EnumDAdvise(IDataObject *iface, IEnumSTATDATA **ppenumAdvise)
static HRESULT WINAPI EnumFormatImpl_QueryInterface(IEnumFORMATETC *iface, REFIID riid, LPVOID *ppvObj)
static HRESULT WINAPI DataObjectImpl_SetData(IDataObject *iface, FORMATETC *pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
static HRESULT WINAPI EnumFormatImpl_Reset(IEnumFORMATETC *iface)
struct DataObjectImpl DataObjectImpl
static const IEnumFORMATETCVtbl VT_EnumFormatImpl
#define InitFormatEtc(fe, cf, med)
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalFree(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)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
int WINAPI lstrlenA(LPCSTR lpString)
HRESULT WINAPI GetHGlobalFromILockBytes(ILockBytes *iface, HGLOBAL *phglobal)
HRESULT WINAPI CreateILockBytesOnHGlobal(HGLOBAL global, BOOL delete_on_release, ILockBytes **ret)
#define memcpy(s1, s2, n)
#define sprintf(buf, format,...)
static LPDATAOBJECT clip_data
static HRESULT DataObjectImpl_CreateText(LPCSTR text, LPDATAOBJECT *lplpdataobj)
static UINT wm_drawclipboard
static HGLOBAL create_text(void)
static ULONG DataObjectImpl_GetData_calls
static const char * cmpl_stm_data
static void test_nonole_clipboard(void)
static HMETAFILE create_mf(void)
static void test_cf_dataobject(IDataObject *data)
static HGLOBAL create_storage(void)
static HENHMETAFILE create_emf(void)
static ULONG DataObjectImpl_EnumFormatEtc_calls
static void test_enum_fmtetc(IDataObject *src)
static void test_consumer_refs(void)
static const WCHAR device_name[]
static HRESULT DataObjectImpl_CreateFromHGlobal(HGLOBAL text, LPDATAOBJECT *dataobj)
static BOOL expect_DataObjectImpl_QueryGetData
static DWORD CALLBACK test_data_obj(void *arg)
static const char * cmpl_text_data
static HRESULT DataObjectImpl_CreateComplex(LPDATAOBJECT *lplpdataobj)
static void test_no_cf_dataobject(void)
static void test_getdatahere(void)
static void test_get_clipboard_locked(void)
static void test_complex_get_clipboard(void)
static void test_multithreaded_clipboard(void)
static void test_get_clipboard(void)
static ULONG count_refs(IDataObject *d)
static void test_set_clipboard_DRAWCLIPBOARD(void)
static void test_flushed_getdata(void)
static void test_set_clipboard(void)
static LRESULT CALLBACK clipboard_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
static DWORD CALLBACK set_clipboard_thread(void *arg)
static void test_get_clipboard_uninitialized(void)
static ULONG DataObjectImpl_GetDataHere_calls
static HMETAFILEPICT create_metafilepict(void)
#define STGM_SHARE_EXCLUSIVE
#define STGM_DELETEONRELEASE
interface IEnumFORMATETC * LPENUMFORMATETC
interface IDataObject * LPDATAOBJECT
const GUID IID_IEnumFORMATETC
const GUID IID_IDataObject
#define IsEqualGUID(rguid1, rguid2)
IDataObject IDataObject_iface
WCHAR dmDeviceName[CCHDEVICENAME]
IDataObject IDataObject_iface
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
#define FIELD_OFFSET(t, f)
#define CONTAINING_RECORD(address, type, field)
DWORD WINAPI GetLastError(void)
_In_ FONTOBJ _In_ ULONG _In_ HGLYPH hg
#define CLIPBRD_E_CANT_OPEN
BOOL WINAPI DeleteMetaFile(_In_ HMETAFILE)
HDC WINAPI CreateMetaFileA(_In_opt_ LPCSTR)
HMETAFILE WINAPI CloseMetaFile(_In_ HDC hdc)
BOOL WINAPI ExtTextOutA(_In_ HDC hdc, _In_ int x, _In_ int y, _In_ UINT options, _In_opt_ const RECT *lprect, _In_reads_opt_(c) LPCSTR lpString, _In_ UINT c, _In_reads_opt_(c) const INT *lpDx)
HDC WINAPI CreateEnhMetaFileA(_In_opt_ HDC, _In_opt_ LPCSTR, _In_opt_ LPCRECT, _In_opt_ LPCSTR)
HENHMETAFILE WINAPI CloseEnhMetaFile(_In_ HDC hdc)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
BOOL WINAPI CloseClipboard(void)
HWND WINAPI GetClipboardOwner(void)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
UINT WINAPI EnumClipboardFormats(_In_ UINT)
HANDLE WINAPI GetClipboardData(_In_ UINT)
HWND WINAPI SetClipboardViewer(_In_ HWND)
HWND WINAPI GetDesktopWindow(void)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
BOOL WINAPI ChangeClipboardChain(_In_ HWND, _In_ HWND)
BOOL WINAPI EmptyClipboard(void)
UINT WINAPI RegisterClipboardFormatA(_In_ LPCSTR)
BOOL WINAPI DestroyWindow(_In_ HWND)