24#define WIN32_LEAN_AND_MEAN
36#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr)
38#define DEFINE_EXPECT(func) \
39 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
41#define SET_EXPECT(func) \
42 expect_ ## func = TRUE
44#define CHECK_EXPECT2(func) \
46 ok(expect_ ##func, "unexpected call " #func "\n"); \
47 called_ ## func = TRUE; \
50#define CHECK_EXPECT(func) \
52 CHECK_EXPECT2(func); \
53 expect_ ## func = FALSE; \
56#define CHECK_CALLED(func) \
58 ok(called_ ## func, "expected " #func "\n"); \
59 expect_ ## func = called_ ## func = FALSE; \
83 {0xbc, 0x13, 0x51, 0x6e, 0x92, 0x39, 0xac, 0xd0}
91 {0xbc, 0x13, 0x51, 0x6e, 0x92, 0x39, 0xac, 0xe0}
99 {0xbc, 0x13, 0x51, 0x6e, 0x92, 0x39, 0xac, 0xe1}
102#define TEST_OPTIONAL 0x1
157 trace(
"%s\n", method_name);
172 "Expected %s to be called instead of %s\n",
190#define CHECK_EXPECTED_METHOD(method_name) check_expected_method_fmt(method_name, NULL)
191#define CHECK_EXPECTED_METHOD_FMT(method_name, fmt) check_expected_method_fmt(method_name, fmt)
193#define CHECK_NO_EXTRA_METHODS() \
195 while (expected_method_list->flags & TEST_OPTIONAL) \
196 expected_method_list++; \
197 ok(!expected_method_list->method, "Method sequence starting from %s not called\n", expected_method_list->method); \
203 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
204 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00,
205 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
206 0xc8, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00,
207 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
208 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
215 med->tymed = TYMED_HGLOBAL;
220 med->pUnkForRelease =
NULL;
225 med->tymed = TYMED_GDI;
227 med->pUnkForRelease =
NULL;
235 med->tymed = TYMED_ENHMF;
237 med->pUnkForRelease =
NULL;
247 med->tymed = TYMED_MFPICT;
255 med->pUnkForRelease =
NULL;
268 med->tymed = TYMED_HGLOBAL;
270 med->pUnkForRelease =
NULL;
295 trace(
"OleObject_QueryInterface: returning E_NOINTERFACE\n");
334 LPCOLESTR szContainerApp,
335 LPCOLESTR szContainerObj
355 DWORD dwWhichMoniker,
367 DWORD dwWhichMoniker,
524 ok(aspect == DVASPECT_CONTENT,
"got aspect %d\n", aspect);
580 trace(
"OleObjectPersistStg_QueryInterface\n");
697 FORMATETC *pformatetc,
704 ok(pformatetc !=
NULL,
"pformatetc should not be NULL\n");
707 "cfFormat: %x\n", pformatetc->cfFormat);
709 "ptd: %p\n", pformatetc->ptd);
711 "dwAspect: %x\n", pformatetc->dwAspect);
713 "lindex: %x\n", pformatetc->lindex);
715 "tymed: %x\n", pformatetc->tymed);
718 ok(pformatetc ==
NULL,
"pformatetc should be NULL\n");
757 FORMATETC *pformatetc,
786 IClassFactory_AddRef(iface);
866 BOOL fLastUnlockCloses)
894static const CLSID CLSID_Equation3 = {0x0002CE02, 0x0000, 0x0000, {0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46} };
919 void *paspect, DVTARGETDEVICE *
ptd,
HDC hdcTargetDev,
HDC hdcDraw,
930 ok(0,
"unexpected call GetColorSet\n");
935 void *aspect,
DWORD *freeze)
937 ok(0,
"unexpected call Freeze\n");
943 ok(0,
"unexpected call Unfreeze\n");
949 ok(0,
"unexpected call SetAdvise\n");
956 ok(0,
"unexpected call GetAdvise\n");
981 {
"OleObject_QueryInterface", 0 },
982 {
"OleObject_AddRef", 0 },
983 {
"OleObject_QueryInterface", 0 },
987 {
"OleObjectPersistStg_AddRef", 0 },
988 {
"OleObjectPersistStg_InitNew", 0 },
989 {
"OleObjectPersistStg_Release", 0 },
990 {
"OleObject_Release", 0 },
996 {
"OleObject_QueryInterface", 0 },
997 {
"OleObject_AddRef", 0 },
998 {
"OleObject_QueryInterface", 0 },
1002 {
"OleObjectPersistStg_AddRef", 0 },
1003 {
"OleObjectPersistStg_InitNew", 0 },
1004 {
"OleObjectPersistStg_Release", 0 },
1005 {
"OleObject_QueryInterface", 0 },
1006 {
"OleObjectRunnable_AddRef", 0 },
1007 {
"OleObjectRunnable_Run", 0 },
1008 {
"OleObjectRunnable_Release", 0 },
1009 {
"OleObject_QueryInterface", 0 },
1010 {
"OleObjectCache_AddRef", 0 },
1011 {
"OleObjectCache_Cache", 0 },
1012 {
"OleObjectCache_Release", 0 },
1013 {
"OleObject_Release", 0 },
1017 static const struct expected_method methods_olerender_draw_with_site[] =
1019 {
"OleObject_QueryInterface", 0 },
1020 {
"OleObject_AddRef", 0 },
1021 {
"OleObject_QueryInterface", 0 },
1022 {
"OleObject_AddRef", 0 },
1023 {
"OleObject_GetMiscStatus", 0 },
1024 {
"OleObject_QueryInterface", 0 },
1025 {
"OleObjectPersistStg_AddRef", 0 },
1026 {
"OleObjectPersistStg_InitNew", 0 },
1027 {
"OleObjectPersistStg_Release", 0 },
1028 {
"OleObject_SetClientSite", 0 },
1029 {
"OleObject_Release", 0 },
1030 {
"OleObject_QueryInterface", 0 },
1031 {
"OleObjectRunnable_AddRef", 0 },
1032 {
"OleObjectRunnable_Run", 0 },
1033 {
"OleObjectRunnable_Release", 0 },
1034 {
"OleObject_QueryInterface", 0 },
1035 {
"OleObjectCache_AddRef", 0 },
1036 {
"OleObjectCache_Cache", 0 },
1037 {
"OleObjectCache_Release", 0 },
1038 {
"OleObject_Release", 0 },
1043 {
"OleObject_QueryInterface", 0 },
1044 {
"OleObject_AddRef", 0 },
1045 {
"OleObject_QueryInterface", 0 },
1046 {
"OleObject_AddRef", 0 },
1047 {
"OleObject_GetMiscStatus", 0 },
1048 {
"OleObject_QueryInterface", 0 },
1049 {
"OleObjectPersistStg_AddRef", 0 },
1050 {
"OleObjectPersistStg_InitNew", 0 },
1051 {
"OleObjectPersistStg_Release", 0 },
1052 {
"OleObject_SetClientSite", 0 },
1053 {
"OleObject_Release", 0 },
1054 {
"OleObject_QueryInterface", 0 },
1055 {
"OleObjectRunnable_AddRef", 0 },
1056 {
"OleObjectRunnable_Run", 0 },
1057 {
"OleObjectRunnable_Release", 0 },
1058 {
"OleObject_QueryInterface", 0 },
1059 {
"OleObjectCache_AddRef", 0 },
1060 {
"OleObjectCache_Cache", 0 },
1061 {
"OleObjectCache_Release", 0 },
1062 {
"OleObject_Release", 0 },
1067 {
"OleObject_QueryInterface", 0 },
1068 {
"OleObject_AddRef", 0 },
1069 {
"OleObject_QueryInterface", 0 },
1073 {
"OleObjectPersistStg_AddRef", 0 },
1074 {
"OleObjectPersistStg_InitNew", 0 },
1075 {
"OleObjectPersistStg_Release", 0 },
1076 {
"OleObject_Release", 0 },
1080 static const struct expected_method methods_olerender_draw_no_runnable[] =
1082 {
"OleObject_QueryInterface", 0 },
1083 {
"OleObject_AddRef", 0 },
1084 {
"OleObject_QueryInterface", 0 },
1088 {
"OleObjectPersistStg_AddRef", 0 },
1089 {
"OleObjectPersistStg_InitNew", 0 },
1090 {
"OleObjectPersistStg_Release", 0 },
1091 {
"OleObject_QueryInterface", 0 },
1092 {
"OleObject_QueryInterface", 0 },
1093 {
"OleObjectCache_AddRef", 0 },
1094 {
"OleObjectCache_Cache", 0 },
1095 {
"OleObjectCache_Release", 0 },
1096 {
"OleObject_Release", 0 },
1100 static const struct expected_method methods_olerender_draw_no_cache[] =
1102 {
"OleObject_QueryInterface", 0 },
1103 {
"OleObject_AddRef", 0 },
1104 {
"OleObject_QueryInterface", 0 },
1108 {
"OleObjectPersistStg_AddRef", 0 },
1109 {
"OleObjectPersistStg_InitNew", 0 },
1110 {
"OleObjectPersistStg_Release", 0 },
1111 {
"OleObject_QueryInterface", 0 },
1112 {
"OleObjectRunnable_AddRef", 0 },
1113 {
"OleObjectRunnable_Run", 0 },
1114 {
"OleObjectRunnable_Release", 0 },
1115 {
"OleObject_QueryInterface", 0 },
1116 {
"OleObject_Release", 0 },
1122 formatetc.cfFormat = 0;
1123 formatetc.ptd =
NULL;
1124 formatetc.dwAspect = DVASPECT_CONTENT;
1125 formatetc.lindex = -1;
1126 formatetc.tymed = TYMED_NULL;
1130 trace(
"OleCreate with OLERENDER_NONE:\n");
1137 trace(
"OleCreate with OLERENDER_DRAW:\n");
1144 trace(
"OleCreate with OLERENDER_DRAW, with site:\n");
1153 trace(
"OleCreate with OLERENDER_DRAW, with site:\n");
1161 formatetc.ptd =
NULL;
1162 formatetc.dwAspect = DVASPECT_CONTENT;
1163 formatetc.lindex = -1;
1164 formatetc.tymed = TYMED_HGLOBAL;
1166 trace(
"OleCreate with OLERENDER_FORMAT:\n");
1170 "OleCreate failed with error 0x%08x\n",
hr);
1178 trace(
"OleCreate with OLERENDER_ASIS:\n");
1184 formatetc.cfFormat = 0;
1185 formatetc.tymed = TYMED_NULL;
1188 trace(
"OleCreate with OLERENDER_DRAW (no IRunnableObject):\n");
1197 trace(
"OleCreate with OLERENDER_DRAW (no IOleCache):\n");
1214 {
"OleObject_QueryInterface", 0 },
1215 {
"OleObject_AddRef", 0 },
1216 {
"OleObject_QueryInterface", 0 },
1217 {
"OleObject_AddRef", 0 },
1218 {
"OleObject_GetMiscStatus", 0 },
1219 {
"OleObject_QueryInterface", 0 },
1220 {
"OleObjectPersistStg_AddRef", 0 },
1221 {
"OleObjectPersistStg_Load", 0 },
1222 {
"OleObjectPersistStg_Release", 0 },
1223 {
"OleObject_SetClientSite", 0 },
1224 {
"OleObject_Release", 0 },
1225 {
"OleObject_QueryInterface", 0 },
1226 {
"OleObject_GetMiscStatus", 0 },
1227 {
"OleObject_Release", 0 },
1234 trace(
"OleLoad:\n");
1238 "OleLoad failed with error 0x%08x\n",
hr);
1253 trace(
"OleLoad:\n");
1257 "OleLoad failed with error 0x%08x\n",
hr);
1271 static const WCHAR olrepres[] = { 2,
'O',
'l',
'e',
'P',
'r',
'e',
's',
'0',
'0',
'0',0 };
1282 for (
i = 0;
i < 7;
i++)
1285 ok(
hr ==
S_OK,
"StgCreateDocfile error %#x\n",
hr);
1291 ok(
hr ==
S_OK,
"CreateStream error %#x\n",
hr);
1319 data_size =
sizeof(
buf);
1325 header.dvAspect = DVASPECT_CONTENT;
1329 header.dwObjectExtentX = 1;
1330 header.dwObjectExtentY = 1;
1331 header.dwSize = data_size;
1344 IStorage_Release(stg);
1361 IUnknown_Release(
obj);
1362 IStorage_Release(stg);
1384 IAdviseSink_AddRef(iface);
1404 FORMATETC *pFormatetc,
1482 return a->cfFormat ==
b->cfFormat &&
a->dwAspect ==
b->dwAspect &&
1483 a->lindex ==
b->lindex &&
a->tymed ==
b->tymed;
1498 switch (
fmt->cfFormat)
1513 trace(
"unhandled fmt %d\n",
fmt->cfFormat );
1523 LPFORMATETC pformatetc,
1544 LPFORMATETC pformatectIn,
1545 LPFORMATETC pformatetcOut)
1553 LPFORMATETC pformatetc,
1572 FORMATETC* pformatetc,
1575 DWORD* pdwConnection)
1577 STGMEDIUM stgmedium;
1582 if(advf & ADVF_PRIMEFIRST)
1584 ok(pformatetc->cfFormat ==
cf_test_2,
"got %04x\n", pformatetc->cfFormat);
1585 stgmedium.tymed = TYMED_HGLOBAL;
1587 stgmedium.pUnkForRelease =
NULL;
1588 IAdviseSink_OnDataChange(pAdvSink, pformatetc, &stgmedium);
1665 hr = IOleCache2_EnumCache(
cache, &enum_stat );
1668 while (IEnumSTATDATA_Next(enum_stat, 1, &
stat,
NULL) ==
S_OK)
1670 ok(
stat.formatetc.cfFormat ==
expect->formatetc.cfFormat,
"got %d expect %d\n",
1671 stat.formatetc.cfFormat,
expect->formatetc.cfFormat );
1672 ok( !
stat.formatetc.ptd == !
expect->formatetc.ptd,
"got %p expect %p\n",
1674 ok(
stat.formatetc.dwAspect ==
expect->formatetc.dwAspect,
"got %d expect %d\n",
1675 stat.formatetc.dwAspect,
expect->formatetc.dwAspect );
1676 ok(
stat.formatetc.lindex ==
expect->formatetc.lindex,
"got %d expect %d\n",
1677 stat.formatetc.lindex,
expect->formatetc.lindex );
1678 ok(
stat.formatetc.tymed ==
expect->formatetc.tymed,
"got %d expect %d\n",
1679 stat.formatetc.tymed,
expect->formatetc.tymed );
1681 ok(
stat.pAdvSink == 0,
"got %p\n",
stat.pAdvSink );
1682 ok(
stat.dwConnection ==
expect->dwConnection,
"got %d expect %d\n",
stat.dwConnection,
expect->dwConnection );
1687 ok(
num == 0,
"incorrect number. num %d\n",
num );
1689 IEnumSTATDATA_Release( enum_stat );
1704 STGMEDIUM stgmedium;
1712 static const WCHAR wszShell32[] = {
'\\',
's',
'h',
'e',
'l',
'l',
'3',
'2',
'.',
'd',
'l',
'l',0};
1716 {
"AdviseSink_OnViewChange", 0 },
1717 {
"AdviseSink_OnViewChange", 0 },
1718 {
"draw_continue", 1 },
1719 {
"draw_continue_false", 1 },
1720 {
"DataObject_DAdvise", 0 },
1721 {
"DataObject_DAdvise", 0 },
1722 {
"DataObject_DUnadvise", 0 },
1723 {
"DataObject_DUnadvise", 0 },
1728 {
"AdviseSink_OnViewChange", 0 },
1729 {
"draw_continue", 1 },
1730 {
"draw_continue", 1 },
1731 {
"draw_continue", 1 },
1732 {
"DataObject_GetData", 0, {
CF_DIB,
NULL, DVASPECT_THUMBNAIL, -1, TYMED_HGLOBAL} },
1733 {
"DataObject_GetData", 0, {
CF_BITMAP,
NULL, DVASPECT_THUMBNAIL, -1, TYMED_GDI} },
1739 {
"DataObject_DAdvise", 0 },
1740 {
"DataObject_DAdvise", 0 },
1741 {
"DataObject_DAdvise", 0 },
1742 {
"DataObject_DAdvise", 0 },
1743 {
"DataObject_DUnadvise", 0 },
1744 {
"DataObject_DUnadvise", 0 },
1745 {
"DataObject_DUnadvise", 0 },
1746 {
"DataObject_DUnadvise", 0 },
1755 fmtetc.dwAspect = DVASPECT_ICON;
1758 fmtetc.tymed = TYMED_MFPICT;
1776 ok(unk != (
IUnknown*)olecache,
"got %p, expected %p\n", olecache, unk);
1777 ok(unk != (
IUnknown*)pOleCache,
"got %p, expected %p\n", pOleCache, unk);
1778 IOleCache2_Release(pOleCache);
1779 IOleCache_Release(olecache);
1780 IUnknown_Release(unk);
1790 ok(unk == (
IUnknown*)olecache,
"got %p, expected %p\n", olecache, unk);
1791 ok(unk == (
IUnknown*)pOleCache,
"got %p, expected %p\n", pOleCache, unk);
1792 ok(unk == unk2,
"got %p, expected %p\n", unk2, unk);
1793 IUnknown_Release(unk2);
1794 IOleCache2_Release(pOleCache);
1795 IOleCache_Release(olecache);
1796 IUnknown_Release(unk);
1810 hr = IViewObject_SetAdvise(pViewObject, DVASPECT_ICON, ADVF_PRIMEFIRST, &
AdviseSink);
1813 hr = IPersistStorage_InitNew(pPS, pStorage);
1816 hr = IPersistStorage_IsDirty(pPS);
1819 hr = IPersistStorage_GetClassID(pPS, &
clsid);
1823 hr = IOleCache2_Uncache(pOleCache, 0xdeadbeef);
1824 ok(
hr ==
OLE_E_NOCONNECTION,
"IOleCache_Uncache with invalid value should return OLE_E_NOCONNECTION instead of 0x%x\n",
hr);
1829 hr = IOleCache2_Cache(pOleCache,
NULL, 0, &dwConnection);
1830 ok(
hr ==
E_INVALIDARG,
"IOleCache_Cache with NULL fmtetc should have returned E_INVALIDARG instead of 0x%08x\n",
hr);
1832 hr = IOleCache2_Cache(pOleCache,
NULL, 0,
NULL);
1833 ok(
hr ==
E_INVALIDARG,
"IOleCache_Cache with NULL pdwConnection should have returned E_INVALIDARG instead of 0x%08x\n",
hr);
1837 skip(
"tests with NULL parameters will crash on NT4 and below\n");
1840 for (fmtetc.cfFormat =
CF_TEXT; fmtetc.cfFormat <
CF_MAX; fmtetc.cfFormat++)
1843 fmtetc.dwAspect = DVASPECT_THUMBNAIL;
1844 for (
i = 0;
i < 7;
i++)
1846 fmtetc.tymed = 1 <<
i;
1847 hr = IOleCache2_Cache(pOleCache, &fmtetc, 0, &dwConnection);
1848 if ((fmtetc.cfFormat ==
CF_METAFILEPICT && fmtetc.tymed == TYMED_MFPICT) ||
1849 (fmtetc.cfFormat ==
CF_BITMAP && fmtetc.tymed == TYMED_GDI) ||
1850 (fmtetc.cfFormat ==
CF_DIB && fmtetc.tymed == TYMED_HGLOBAL) ||
1851 (fmtetc.cfFormat ==
CF_ENHMETAFILE && fmtetc.tymed == TYMED_ENHMF))
1852 ok(
hr ==
S_OK,
"IOleCache_Cache cfFormat = %d, tymed = %d should have returned S_OK instead of 0x%08x\n",
1853 fmtetc.cfFormat, fmtetc.tymed,
hr);
1854 else if (fmtetc.tymed == TYMED_HGLOBAL)
1857 "IOleCache_Cache cfFormat = %d, tymed = %d should have returned CACHE_S_FORMATETC_NOTSUPPORTED instead of 0x%08x\n",
1858 fmtetc.cfFormat, fmtetc.tymed,
hr);
1860 ok(
hr ==
DV_E_TYMED,
"IOleCache_Cache cfFormat = %d, tymed = %d should have returned DV_E_TYMED instead of 0x%08x\n",
1861 fmtetc.cfFormat, fmtetc.tymed,
hr);
1864 hr = IOleCache2_Uncache(pOleCache, dwConnection);
1871 fmtetc.dwAspect = DVASPECT_THUMBNAIL;
1872 fmtetc.tymed = TYMED_GDI;
1873 hr = IOleCache2_Cache(pOleCache, &fmtetc, 0, &dwConnection);
1876 fmtetc.cfFormat = 0;
1877 fmtetc.dwAspect = DVASPECT_ICON;
1878 fmtetc.tymed = TYMED_MFPICT;
1879 hr = IOleCache2_Cache(pOleCache, &fmtetc, 0, &dwConnection);
1883 memcpy(wszPath+
lstrlenW(wszPath), wszShell32,
sizeof(wszShell32));
1886 stgmedium.tymed = TYMED_MFPICT;
1889 stgmedium.pUnkForRelease =
NULL;
1891 fmtetc.dwAspect = DVASPECT_CONTENT;
1892 hr = IOleCache2_SetData(pOleCache, &fmtetc, &stgmedium,
FALSE);
1893 ok(
hr ==
OLE_E_BLANK,
"IOleCache_SetData for aspect not in cache should have return OLE_E_BLANK instead of 0x%08x\n",
hr);
1895 fmtetc.dwAspect = DVASPECT_ICON;
1896 hr = IOleCache2_SetData(pOleCache, &fmtetc, &stgmedium,
FALSE);
1900 hr = IViewObject_Freeze(pViewObject, DVASPECT_ICON, -1,
NULL, &dwFreeze);
1903 hr = IViewObject_Freeze(pViewObject, DVASPECT_CONTENT, -1,
NULL, &dwFreeze);
1904 ok(
hr ==
OLE_E_BLANK,
"IViewObject_Freeze with uncached aspect should have returned OLE_E_BLANK instead of 0x%08x\n",
hr);
1909 rcBounds.
right = 100;
1913 hr = IViewObject_Draw(pViewObject, DVASPECT_ICON, -1,
NULL,
NULL,
NULL,
hdcMem, &rcBounds,
NULL,
draw_continue, 0xdeadbeef);
1916 hr = IViewObject_Draw(pViewObject, DVASPECT_CONTENT, -1,
NULL,
NULL,
NULL,
hdcMem, &rcBounds,
NULL,
draw_continue, 0xdeadbeef);
1917 ok(
hr ==
OLE_E_BLANK,
"IViewObject_Draw with uncached aspect should have returned OLE_E_BLANK instead of 0x%08x\n",
hr);
1920 hr = IViewObject_Draw(pViewObject, DVASPECT_ICON, -1,
NULL,
NULL,
NULL,
hdcMem, &rcBounds,
NULL,
NULL, 0xdeadbeef);
1924 hr = IViewObject_Draw(pViewObject, DVASPECT_ICON, -1,
NULL,
NULL,
NULL,
hdcMem, &rcBounds,
NULL,
draw_continue_false, 0xdeadbeef);
1927 "IViewObject_Draw with draw_continue_false returns 0x%08x\n",
hr);
1931 hr = IOleCacheControl_OnRun(pOleCacheControl, &
DataObject);
1934 hr = IPersistStorage_Save(pPS, pStorage,
TRUE);
1937 hr = IPersistStorage_SaveCompleted(pPS,
NULL);
1940 hr = IPersistStorage_IsDirty(pPS);
1941 ok(
hr ==
S_FALSE,
"IPersistStorage_IsDirty should have returned S_FALSE instead of 0x%x\n",
hr);
1943 IPersistStorage_Release(pPS);
1944 IViewObject_Release(pViewObject);
1945 IOleCache2_Release(pOleCache);
1946 IOleCacheControl_Release(pOleCacheControl);
1951 trace(
"Testing loaded data with CreateDataCache:\n");
1962 hr = IViewObject_SetAdvise(pViewObject, DVASPECT_ICON, ADVF_PRIMEFIRST, &
AdviseSink);
1965 hr = IPersistStorage_Load(pPS, pStorage);
1968 hr = IPersistStorage_IsDirty(pPS);
1969 ok(
hr ==
S_FALSE,
"IPersistStorage_IsDirty should have returned S_FALSE instead of 0x%x\n",
hr);
1971 fmtetc.cfFormat = 0;
1972 fmtetc.dwAspect = DVASPECT_ICON;
1975 fmtetc.tymed = TYMED_MFPICT;
1976 hr = IOleCache2_Cache(pOleCache, &fmtetc, 0, &dwConnection);
1977 ok(
hr ==
CACHE_S_SAMECACHE,
"IOleCache_Cache with already loaded data format type should return CACHE_S_SAMECACHE instead of 0x%x\n",
hr);
1981 rcBounds.
right = 100;
1985 hr = IViewObject_Draw(pViewObject, DVASPECT_ICON, -1,
NULL,
NULL,
NULL,
hdcMem, &rcBounds,
NULL,
draw_continue, 0xdeadbeef);
1988 hr = IViewObject_Draw(pViewObject, DVASPECT_CONTENT, -1,
NULL,
NULL,
NULL,
hdcMem, &rcBounds,
NULL,
draw_continue, 0xdeadbeef);
1989 ok(
hr ==
OLE_E_BLANK,
"IViewObject_Draw with uncached aspect should have returned OLE_E_BLANK instead of 0x%08x\n",
hr);
1992 hr = IOleCache2_DiscardCache(pOleCache, DISCARDCACHE_NOSAVE);
1994 hr = IViewObject_Draw(pViewObject, DVASPECT_ICON, -1,
NULL,
NULL,
NULL,
hdcMem, &rcBounds,
NULL,
draw_continue, 0xdeadbeef);
1998 hr = IPersistStorage_HandsOffStorage(pPS);
2000 hr = IViewObject_Draw(pViewObject, DVASPECT_ICON, -1,
NULL,
NULL,
NULL,
hdcMem, &rcBounds,
NULL,
draw_continue, 0xdeadbeef);
2002 hr = IOleCache2_DiscardCache(pOleCache, DISCARDCACHE_NOSAVE);
2004 hr = IViewObject_Draw(pViewObject, DVASPECT_ICON, -1,
NULL,
NULL,
NULL,
hdcMem, &rcBounds,
NULL,
draw_continue, 0xdeadbeef);
2005 ok(
hr ==
OLE_E_BLANK,
"IViewObject_Draw with uncached aspect should have returned OLE_E_BLANK instead of 0x%08x\n",
hr);
2012 IPersistStorage_Release(pPS);
2013 IViewObject_Release(pViewObject);
2014 IOleCache2_Release(pOleCache);
2029 fmtetc.dwAspect = DVASPECT_CONTENT;
2030 fmtetc.tymed = TYMED_MFPICT;
2032 hr = IOleCache2_Cache(pOleCache, &fmtetc, 0, &dwConnection);
2035 hr = IDataObject_GetData(pCacheDataObject, &fmtetc, &stgmedium);
2039 fmtetc.dwAspect = DVASPECT_CONTENT;
2040 fmtetc.tymed = TYMED_HGLOBAL;
2042 hr = IOleCache2_Cache(pOleCache, &fmtetc, 0, &dwConnection);
2045 hr = IDataObject_GetData(pCacheDataObject, &fmtetc, &stgmedium);
2049 hr = IOleCache2_Cache(pOleCache, &fmtetc, ADVF_PRIMEFIRST, &dwConnection);
2052 hr = IDataObject_GetData(pCacheDataObject, &fmtetc, &stgmedium);
2055 hr = IOleCacheControl_OnRun(pOleCacheControl, &
DataObject);
2059 hr = IOleCache2_Cache(pOleCache, &fmtetc, 0, &dwConnection);
2063 hr = IDataObject_GetData(pCacheDataObject, &fmtetc, &stgmedium);
2067 hr = IDataObject_GetData(pCacheDataObject, &fmtetc, &stgmedium);
2072 hr = IDataObject_GetData(pCacheDataObject, &fmtetc, &stgmedium);
2075 IOleCacheControl_Release(pOleCacheControl);
2076 IDataObject_Release(pCacheDataObject);
2077 IOleCache2_Release(pOleCache);
2081 IStorage_Release(pStorage);
2089 0x42, 0x4d, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00,
2090 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00,
2091 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00,
2092 0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00,
2093 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x00,
2094 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x00, 0x00,
2095 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
2096 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
2119 IStream_Release( stm );
2132 FORMATETC
fmt = {
CF_DIB,
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
2138 STATDATA enum_expect[] =
2140 {{
CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0,
NULL, 1 },
2141 {{
CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0,
NULL, 1 },
2157 hr = IPersistStorage_Load( persist, stg );
2159 IStorage_Release( stg );
2161 hr = IPersistStorage_GetClassID( persist, &cls );
2165 hr = IDataObject_GetData(
data, &
fmt, &med );
2167 ok( med.tymed == TYMED_HGLOBAL,
"got %x\n", med.tymed );
2180 ok( !
memcmp(
ptr, &expect_info,
sizeof(expect_info) ),
"mismatch\n" );
2188 hr = IViewObject2_GetExtent(
view, DVASPECT_CONTENT, -1,
NULL, &sz );
2192 ok( sz.
cx == 1000,
"got %d\n", sz.
cx );
2193 ok( sz.
cy == 250,
"got %d\n", sz.
cy );
2200 ok( sz.
cx ==
x,
"got %d %d\n", sz.
cx,
x );
2201 ok( sz.
cy ==
y,
"got %d %d\n", sz.
cy,
y );
2206 IOleCache2_Release(
cache );
2207 IViewObject2_Release(
view );
2208 IDataObject_Release(
data );
2209 IPersistStorage_Release( persist );
2210 IUnknown_Release( unk );
2218 ok( bm.bmWidth ==
cx,
"got %d expect %d\n", bm.bmWidth,
cx );
2219 ok( bm.bmHeight ==
cy,
"got %d expect %d\n", bm.bmHeight,
cy );
2227 ok(
info->bmiHeader.biWidth ==
cx,
"got %d expect %d\n",
info->bmiHeader.biWidth,
cx );
2228 ok(
info->bmiHeader.biHeight ==
cy,
"got %d expect %d\n",
info->bmiHeader.biHeight,
cy );
2242 {{
CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0,
NULL, 0 },
2243 {{
CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0,
NULL, 0 },
2247 STATDATA view_caching[] =
2249 {{ 0, 0, DVASPECT_CONTENT, -1, TYMED_ENHMF }, 0,
NULL, 0 },
2250 {{ 0, 0, DVASPECT_THUMBNAIL, -1, TYMED_HGLOBAL }, 0,
NULL, 0 },
2251 {{ 0, 0, DVASPECT_DOCPRINT, -1, TYMED_HGLOBAL }, 0,
NULL, 0 },
2261 fmt.dwAspect = DVASPECT_CONTENT;
2263 fmt.tymed = TYMED_HGLOBAL;
2265 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2267 ok( conn == 2,
"got %d\n", conn );
2268 expect[0].dwConnection = conn;
2269 expect[1].dwConnection = conn;
2275 fmt.tymed = TYMED_GDI;
2277 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2282 fmt.tymed = TYMED_MFPICT;
2284 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2286 ok( conn == 3,
"got %d\n", conn );
2287 expect[2].dwConnection = conn;
2293 fmt.tymed = TYMED_ENHMF;
2295 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2297 ok( conn == 4,
"got %d\n", conn );
2298 expect[3].dwConnection = conn;
2316 fmt.tymed = TYMED_GDI;
2318 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2321 expect[0].dwConnection = conn;
2322 expect[1].dwConnection = conn;
2335 hr = IDataObject_GetData(
data, &
fmt, &med );
2337 ok( med.tymed == TYMED_GDI,
"got %d\n", med.tymed );
2342 fmt.tymed = TYMED_HGLOBAL;
2343 hr = IDataObject_GetData(
data, &
fmt, &med );
2345 ok( med.tymed == TYMED_HGLOBAL,
"got %d\n", med.tymed );
2351 fmt.tymed = TYMED_HGLOBAL;
2358 fmt.tymed = TYMED_GDI;
2359 hr = IDataObject_GetData(
data, &
fmt, &med );
2361 ok( med.tymed == TYMED_GDI,
"got %d\n", med.tymed );
2366 fmt.tymed = TYMED_HGLOBAL;
2367 hr = IDataObject_GetData(
data, &
fmt, &med );
2369 ok( med.tymed == TYMED_HGLOBAL,
"got %d\n", med.tymed );
2374 hr = IOleCache2_Uncache(
cache, conn );
2379 fmt.tymed = TYMED_ENHMF;
2380 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2382 view_caching[0].dwConnection = conn;
2384 fmt.tymed = TYMED_HGLOBAL;
2385 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2388 fmt.dwAspect = DVASPECT_THUMBNAIL;
2389 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2391 view_caching[1].dwConnection = conn;
2393 fmt.dwAspect = DVASPECT_DOCPRINT;
2394 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2396 view_caching[2].dwConnection = conn;
2399 fmt.dwAspect = DVASPECT_ICON;
2400 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2402 view_caching[3].dwConnection = conn;
2407 hr = IOleCache2_Uncache(
cache, view_caching[3].dwConnection );
2409 hr = IOleCache2_Uncache(
cache, view_caching[2].dwConnection );
2411 hr = IOleCache2_Uncache(
cache, view_caching[1].dwConnection );
2413 hr = IOleCache2_Uncache(
cache, view_caching[0].dwConnection );
2417 fmt.dwAspect = DVASPECT_ICON;
2419 fmt.tymed = TYMED_HGLOBAL;
2420 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2423 fmt.tymed = TYMED_GDI;
2424 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2427 fmt.tymed = TYMED_ENHMF;
2428 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2431 fmt.tymed = TYMED_MFPICT;
2432 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2436 hr = IOleCache2_Uncache(
cache, conn );
2441 fmt.dwAspect = DVASPECT_CONTENT;
2443 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2446 IDataObject_Release(
data );
2447 IOleCache2_Release(
cache );
2453 fmt.dwAspect = DVASPECT_CONTENT;
2454 fmt.tymed = TYMED_HGLOBAL;
2455 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2459 fmt.dwAspect = DVASPECT_THUMBNAIL;
2460 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2463 fmt.dwAspect = DVASPECT_DOCPRINT;
2464 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2469 fmt.dwAspect = DVASPECT_CONTENT;
2470 fmt.tymed = TYMED_MFPICT;
2471 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2476 fmt.dwAspect = DVASPECT_ICON;
2477 fmt.tymed = TYMED_MFPICT;
2478 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn );
2481 IOleCache2_Release(
cache );
2492 static const STATDATA enum_expect[] =
2494 {{
CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0,
NULL, 1 },
2495 {{
CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0,
NULL, 1 },
2502 int enum_start, enum_num;
2520 hr = IPersistStorage_GetClassID( persist, &
clsid );
2525 IPersistStorage_Release( persist );
2526 IOleCache2_Release(
cache );
2535 IStorage *stg_dib, *stg_mf, *stg_wine;
2537 static const STATDATA initnew_expect[] =
2539 {{
CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0,
NULL, 1 },
2540 {{
CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0,
NULL, 1 },
2542 static const STATDATA initnew2_expect[] =
2545 {{
CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0,
NULL, 2 },
2546 {{
CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0,
NULL, 2 },
2548 static const STATDATA initnew3_expect[] =
2550 {{
CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0,
NULL, 1 },
2551 {{
CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0,
NULL, 1 },
2552 {{
CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0,
NULL, 2 },
2553 {{
CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0,
NULL, 2 },
2556 static const STATDATA initnew4_expect[] =
2558 {{
CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0,
NULL, 2 },
2559 {{
CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0,
NULL, 2 },
2561 {{
CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0,
NULL, 4 },
2562 {{
CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0,
NULL, 4 },
2584 hr = IPersistStorage_InitNew( persist, stg_dib );
2587 hr = IPersistStorage_GetClassID( persist, &
clsid );
2593 hr = IPersistStorage_InitNew( persist, stg_mf );
2596 hr = IPersistStorage_HandsOffStorage( persist );
2599 hr = IPersistStorage_GetClassID( persist, &
clsid );
2603 hr = IPersistStorage_InitNew( persist, stg_mf );
2606 hr = IPersistStorage_GetClassID( persist, &
clsid );
2612 hr = IPersistStorage_HandsOffStorage( persist );
2615 hr = IPersistStorage_InitNew( persist, stg_dib );
2618 hr = IPersistStorage_GetClassID( persist, &
clsid );
2624 hr = IPersistStorage_HandsOffStorage( persist );
2627 hr = IPersistStorage_InitNew( persist, stg_wine );
2630 hr = IPersistStorage_GetClassID( persist, &
clsid );
2636 IStorage_Release( stg_wine );
2637 IStorage_Release( stg_mf );
2638 IStorage_Release( stg_dib );
2640 IPersistStorage_Release( persist );
2641 IOleCache2_Release(
cache );
2653 {
"DataObject_GetData", 0, {
CF_DIB,
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL } },
2654 {
"DataObject_GetData", 0, {
CF_BITMAP,
NULL, DVASPECT_CONTENT, -1, TYMED_GDI } },
2660 {
"DataObject_GetData", 0, {
CF_DIB,
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL } },
2661 {
"DataObject_GetData", 0, {
CF_ENHMETAFILE,
NULL, DVASPECT_CONTENT, -1, TYMED_ENHMF } },
2662 {
"DataObject_GetData", 0, {
CF_METAFILEPICT,
NULL, DVASPECT_CONTENT, -1, TYMED_MFPICT } },
2667 {
"DataObject_GetData", 0, {
CF_DIB,
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL } },
2668 {
"DataObject_GetData", 0, {
CF_METAFILEPICT,
NULL, DVASPECT_CONTENT, -1, TYMED_MFPICT } },
2673 {
"DataObject_QueryGetData", 0, {
CF_METAFILEPICT,
NULL, DVASPECT_CONTENT, -1, TYMED_MFPICT } },
2674 {
"DataObject_QueryGetData", 0, {
CF_ENHMETAFILE,
NULL, DVASPECT_CONTENT, -1, TYMED_ENHMF } },
2675 {
"DataObject_QueryGetData", 0, {
CF_DIB,
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL } },
2676 {
"DataObject_QueryGetData", 0, {
CF_BITMAP,
NULL, DVASPECT_CONTENT, -1, TYMED_GDI } },
2681 {
"DataObject_QueryGetData", 0, {
CF_METAFILEPICT,
NULL, DVASPECT_CONTENT, -1, TYMED_MFPICT } },
2682 {
"DataObject_QueryGetData", 0, {
CF_ENHMETAFILE,
NULL, DVASPECT_CONTENT, -1, TYMED_ENHMF } },
2683 {
"DataObject_QueryGetData", 0, {
CF_DIB,
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL } },
2684 {
"DataObject_GetData", 0, {
CF_DIB,
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL } },
2689 {
"DataObject_GetData", 0, {
CF_DIB,
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL } },
2690 {
"DataObject_GetData", 0, {
CF_ENHMETAFILE,
NULL, DVASPECT_CONTENT, -1, TYMED_ENHMF } },
2691 {
"DataObject_GetData", 0, {
CF_METAFILEPICT,
NULL, DVASPECT_CONTENT, -1, TYMED_MFPICT } },
2692 {
"DataObject_GetData", 0, {
CF_METAFILEPICT,
NULL, DVASPECT_CONTENT, -1, TYMED_MFPICT } },
2697 {
"DataObject_GetData", 0, {
CF_METAFILEPICT,
NULL, DVASPECT_CONTENT, -1, TYMED_MFPICT } },
2702 {
"DataObject_GetData", 0, {
CF_DIB,
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL } },
2703 {
"DataObject_GetData", 0, {
CF_METAFILEPICT,
NULL, DVASPECT_CONTENT, -1, TYMED_MFPICT } },
2708 {
"DataObject_GetData", 0, {
CF_DIB,
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL } },
2713 {
"DataObject_GetData", 0, {
CF_DIB,
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL } },
2714 {
"DataObject_GetData", 0, {
CF_METAFILEPICT,
NULL, DVASPECT_CONTENT, -1, TYMED_MFPICT } },
2722 static STATDATA view_cache[] =
2724 {{ 0, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0,
NULL, 0 }
2726 static STATDATA view_cache_after_dib[] =
2728 {{
CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0,
NULL, 0 },
2729 {{
CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0,
NULL, 0 }
2732 static FORMATETC dib_fmt[] =
2734 {
CF_DIB,
NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL },
2751 fmt.dwAspect = DVASPECT_CONTENT;
2753 fmt.tymed = TYMED_HGLOBAL;
2755 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn[0] );
2775 fmt.dwAspect = DVASPECT_CONTENT;
2777 fmt.tymed = TYMED_ENHMF;
2779 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn[1] );
2792 hr = IOleCache2_Uncache(
cache, conn[1] );
2797 fmt.dwAspect = DVASPECT_CONTENT;
2799 fmt.tymed = TYMED_MFPICT;
2801 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn[1] );
2810 hr = IOleCache2_Uncache(
cache, conn[1] );
2812 hr = IOleCache2_Uncache(
cache, conn[0] );
2818 fmt.dwAspect = DVASPECT_CONTENT;
2820 fmt.tymed = TYMED_HGLOBAL;
2822 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn[0] );
2824 view_cache[0].dwConnection = conn[0];
2842 view_cache_after_dib[0].dwConnection = view_cache_after_dib[1].dwConnection = view_cache[0].dwConnection;
2845 hr = IOleCache2_Uncache(
cache, conn[0] );
2852 fmt.dwAspect = DVASPECT_CONTENT;
2854 fmt.tymed = TYMED_HGLOBAL;
2856 hr = IOleCache2_Cache(
cache, &
fmt, 0, &conn[0] );
2861 fmt.dwAspect = DVASPECT_CONTENT;
2863 fmt.tymed = TYMED_ENHMF;
2865 hr = IOleCache2_Cache(
cache, &
fmt, ADVF_NODATA, &conn[1] );
2870 fmt.dwAspect = DVASPECT_CONTENT;
2872 fmt.tymed = TYMED_MFPICT;
2874 hr = IOleCache2_Cache(
cache, &
fmt, ADVFCACHE_ONSAVE, &conn[2] );
2898 hr = IOleCache2_DiscardCache(
cache, DISCARDCACHE_NOSAVE );
2908 hr = IOleCache2_DiscardCache(
cache, DISCARDCACHE_NOSAVE );
2920 hr = IOleCache2_UpdateCache(
cache, &
DataObject, UPDFCACHE_ONLYIFBLANK | UPDFCACHE_NORMALCACHE,
NULL );
2925 hr = IOleCache2_DiscardCache(
cache, DISCARDCACHE_NOSAVE );
2930 hr = IOleCache2_UpdateCache(
cache, &
DataObject, UPDFCACHE_ONLYIFBLANK | UPDFCACHE_NORMALCACHE,
NULL );
2942 IOleCache2_Release(
cache );
2963 static const WCHAR wszUnknown[] = {
'U',
'n',
'k',
'n',
'o',
'w',
'n',0};
2964 static const WCHAR wszHostName[] = {
'W',
'i',
'n',
'e',
' ',
'T',
'e',
's',
't',
' ',
'P',
'r',
'o',
'g',
'r',
'a',
'm',0};
2965 static const WCHAR wszDelim[] = {
'!',0};
2969 {
"OleObject_QueryInterface", 0 },
2970 {
"OleObject_AddRef", 0 },
2971 {
"OleObject_QueryInterface", 0 },
2972 {
"OleObject_QueryInterface",
TEST_TODO },
2973 {
"OleObject_QueryInterface", 0 },
2974 {
"OleObject_QueryInterface", 0 },
2988 ok(
hr ==
E_NOINTERFACE,
"IOleObject_QueryInterface(&IID_IOleInPlaceObject) should return E_NOINTERFACE instead of 0x%08x\n",
hr);
2993 hr = IOleObject_Close(
pObject, OLECLOSE_NOSAVE);
2998 hr = IOleObject_EnumVerbs(
pObject, &pEnumVerbs);
3001 hr = IOleObject_GetClientSite(
pObject, &pClientSite);
3004 hr = IOleObject_SetClientSite(
pObject, pClientSite);
3007 hr = IOleObject_GetClipboardData(
pObject, 0, &pDataObject);
3009 "IOleObject_GetClipboardData should have returned OLE_E_NOTRUNNING instead of 0x%08x\n",
3012 hr = IOleObject_GetExtent(
pObject, DVASPECT_CONTENT, &sizel);
3013 ok(
hr ==
OLE_E_BLANK,
"IOleObject_GetExtent should have returned OLE_E_BLANK instead of 0x%08x\n",
3017 ok(
hr ==
REGDB_E_CLASSNOTREG,
"IOleObject_GetMiscStatus should have returned REGDB_E_CLASSNOTREG instead of 0x%08x\n",
hr);
3023 hr = IOleObject_GetUserType(
pObject, USERCLASSTYPE_FULL, &pszUserType);
3026 ok(!
lstrcmpW(pszUserType, wszUnknown),
"Retrieved user type was wrong\n");
3030 ok(
hr ==
OLE_E_NOTRUNNING,
"IOleObject_InitFromData should have returned OLE_E_NOTRUNNING instead of 0x%08x\n",
hr);
3033 ok(
hr ==
OLE_E_NOTRUNNING,
"IOleObject_IsUpToDate should have returned OLE_E_NOTRUNNING instead of 0x%08x\n",
hr);
3039 ok(
hr ==
OLE_E_NOTRUNNING,
"IOleObject_SetColorScheme should have returned OLE_E_NOTRUNNING instead of 0x%08x\n",
hr);
3041 sizel.
cx = sizel.
cy = 0;
3042 hr = IOleObject_SetExtent(
pObject, DVASPECT_CONTENT, &sizel);
3043 ok(
hr ==
OLE_E_NOTRUNNING,
"IOleObject_SetExtent should have returned OLE_E_NOTRUNNING instead of 0x%08x\n",
hr);
3050 hr = IOleObject_SetMoniker(
pObject, OLEWHICHMK_CONTAINER, pMoniker);
3052 IMoniker_Release(pMoniker);
3054 hr = IOleObject_GetMoniker(
pObject, OLEGETMONIKER_ONLYIFTHERE, OLEWHICHMK_CONTAINER, &pMoniker);
3055 ok(
hr ==
E_FAIL,
"IOleObject_GetMoniker should have returned E_FAIL instead of 0x%08x\n",
hr);
3066 fmtetc.dwAspect = DVASPECT_CONTENT;
3068 fmtetc.tymed = TYMED_NULL;
3069 hr = IDataObject_DAdvise(pDataObject, &fmtetc, 0, &
AdviseSink, &dwAdvConn);
3074 fmtetc.dwAspect = DVASPECT_CONTENT;
3076 fmtetc.tymed = TYMED_ENHMF;
3077 hr = IDataObject_DAdvise(pDataObject, &fmtetc, 0, &
AdviseSink, &dwAdvConn);
3082 fmtetc.dwAspect = DVASPECT_CONTENT;
3084 fmtetc.tymed = TYMED_ENHMF;
3085 hr = IDataObject_QueryGetData(pDataObject, &fmtetc);
3086 ok(
hr ==
OLE_E_NOTRUNNING,
"IDataObject_QueryGetData should have returned OLE_E_NOTRUNNING instead of 0x%08x\n",
hr);
3090 fmtetc.dwAspect = DVASPECT_CONTENT;
3092 fmtetc.tymed = TYMED_NULL;
3093 hr = IDataObject_QueryGetData(pDataObject, &fmtetc);
3094 ok(
hr ==
OLE_E_NOTRUNNING,
"IDataObject_QueryGetData should have returned OLE_E_NOTRUNNING instead of 0x%08x\n",
hr);
3099 hr = IRunnableObject_SetContainedObject(pRunnableObject,
TRUE);
3102 hr = IRunnableObject_Run(pRunnableObject,
NULL);
3105 hr = IOleObject_Close(
pObject, OLECLOSE_NOSAVE);
3108 IRunnableObject_Release(pRunnableObject);
3139 ok(
hr == 0x87654321,
"Got 0x%08x\n",
hr);
3155 {
"OleObject_QueryInterface", 0 },
3156 {
"OleObjectRunnable_AddRef", 0 },
3157 {
"OleObjectRunnable_IsRunning", 0 },
3158 {
"OleObjectRunnable_Release", 0 },
3164 {
"OleObject_QueryInterface", 0 },
3177 ok(
ret ==
TRUE,
"Object should be running\n");
3183 ok(
ret ==
FALSE,
"Object should not be running\n");
3189 ok(
ret ==
TRUE,
"Object without IRunnableObject should be running\n");
3227 ok(0,
"unexpected\n");
3239 ok(0,
"unexpected\n");
3244 BOOL last_unlock_closes)
3246 ok(0,
"unexpected\n");
3252 ok(0,
"unexpected\n");
3276 ok(
hr ==
S_OK,
"OleRun failed 0x%08x\n",
hr);
3279 ok(
hr == 0xdeadc0de,
"got 0x%08x\n",
hr);
3287 ok(
hr ==
S_OK,
"OleLockRunning failed 0x%08x\n",
hr);
3305static const WCHAR olepres0W[] = {2,
'O',
'l',
'e',
'P',
'r',
'e',
's',
'0',
'0',
'0',0};
3314 ok(0,
"unexpected call to QueryInterface\n");
3320 ok(0,
"unexpected call to AddRef\n");
3326 ok(0,
"unexpected call to Release\n");
3362 ok(!reserved1,
"reserved1 = %x\n", reserved1);
3364 ok(!!ppstm,
"ppstm = NULL\n");
3366 IStream_AddRef(*ppstm);
3367 hr = IStream_Seek(*ppstm,
pos, STREAM_SEEK_SET,
NULL);
3368 ok(
hr ==
S_OK,
"IStream_Seek returned %x\n",
hr);
3369 hr = IStream_SetSize(*ppstm,
size);
3370 ok(
hr ==
S_OK,
"IStream_SetSize returned %x\n",
hr);
3376 static const WCHAR ole1W[] = {1,
'O',
'l',
'e',0};
3381 ok(!reserved1,
"reserved1 = %p\n", reserved1);
3383 ok(!!ppstm,
"ppstm = NULL\n");
3392 ok(
hr ==
S_OK,
"IStream_Seek returned %x\n",
hr);
3394 }
else if(!
lstrcmpW(pwcsName, ole1W)) {
3410 ok(
hr ==
S_OK,
"IStream_Seek returned %x\n",
hr);
3420 ok(
hr ==
S_OK,
"IStream_Seek returned %x\n",
hr);
3424 ok(0,
"unexpected call to OpenStream: %s\n",
wine_dbgstr_w(pwcsName));
3430 ok(0,
"unexpected call to CreateStorage\n");
3436 ok(0,
"unexpected call to OpenStorage\n");
3442 ok(0,
"unexpected call to CopyTo\n");
3448 ok(0,
"unexpected call to MoveElementTo\n");
3454 ok(0,
"unexpected call to Commit\n");
3460 ok(0,
"unexpected call to Revert\n");
3466 ok(0,
"unexpected call to EnumElements\n");
3478 "unexpected call to DestroyElement(%s)\n",
wine_dbgstr_w(pwcsName));
3490 ok(0,
"unexpected call to RenameElement\n");
3496 ok(0,
"unexpected call to SetElementTimes\n");
3510 ok(0,
"unexpected call to SetStateBits\n");
3517 ok(pstatstg !=
NULL,
"pstatstg = NULL\n");
3518 ok(grfStatFlag == STATFLAG_NONAME,
"grfStatFlag = %x\n", grfStatFlag);
3520 memset(pstatstg, 0,
sizeof(STATSTG));
3521 pstatstg->type = STGTY_STORAGE;
3552 static const WCHAR clsidW[] = {
'C',
'L',
'S',
'I',
'D',
'\\',0};
3557 DWORD ansi_user_type_len;
3558 DWORD ansi_clipboard_format_len;
3560 DWORD unicode_marker;
3561 DWORD unicode_user_type_len;
3562 DWORD unicode_clipboard_format_len;
3568 DWORD link_update_option;
3570 DWORD reserved_moniker_stream_size;
3571 DWORD relative_source_moniker_stream_size;
3572 DWORD absolute_source_moniker_stream_size;
3573 DWORD clsid_indicator;
3575 DWORD reserved_display_name;
3577 DWORD local_update_time;
3578 DWORD local_check_update_time;
3579 DWORD remote_update_time;
3590 ok(
hr ==
S_OK,
"CreateStreamOnHGlobal returned %x\n",
hr);
3592 ok(
hr ==
S_OK,
"IStream_Write returned %x\n",
hr);
3595 ok(
hr ==
S_OK,
"CreateStreamOnHGlobal returned %x\n",
hr);
3597 ok(
hr ==
S_OK,
"IStream_Write returned %x\n",
hr);
3620 win_skip(
"not enough permissions to create CLSID key (%u)\n",
ret);
3645 ok(
hr ==
S_OK,
"OleDoAutoConvert returned %x\n",
hr);
3654 ok(
hr ==
S_OK,
"IStream_Seek returned %x\n",
hr);
3656 ok(
hr ==
S_OK,
"IStream_Read returned %x\n",
hr);
3657 ok(comp_obj_data.reserved1 == 0xfffe0001,
"reserved1 = %x\n", comp_obj_data.reserved1);
3658 ok(comp_obj_data.version == 0xa03,
"version = %x\n", comp_obj_data.version);
3659 ok(comp_obj_data.reserved2[0] == -1,
"reserved2[0] = %x\n", comp_obj_data.reserved2[0]);
3661 ok(!comp_obj_data.ansi_user_type_len,
"ansi_user_type_len = %d\n", comp_obj_data.ansi_user_type_len);
3662 ok(!comp_obj_data.ansi_clipboard_format_len,
"ansi_clipboard_format_len = %d\n", comp_obj_data.ansi_clipboard_format_len);
3663 ok(!comp_obj_data.reserved3,
"reserved3 = %x\n", comp_obj_data.reserved3);
3664 ok(comp_obj_data.unicode_marker == 0x71b239f4,
"unicode_marker = %x\n", comp_obj_data.unicode_marker);
3665 ok(!comp_obj_data.unicode_user_type_len,
"unicode_user_type_len = %d\n", comp_obj_data.unicode_user_type_len);
3666 ok(!comp_obj_data.unicode_clipboard_format_len,
"unicode_clipboard_format_len = %d\n", comp_obj_data.unicode_clipboard_format_len);
3667 ok(!comp_obj_data.reserved4,
"reserved4 %d\n", comp_obj_data.reserved4);
3670 ok(
hr ==
S_OK,
"IStream_Seek returned %x\n",
hr);
3672 ok(
hr ==
S_OK,
"IStream_Read returned %x\n",
hr);
3673 ok(ole_data.version == 0,
"version = %x\n", ole_data.version);
3674 ok(ole_data.flags == 4,
"flags = %x\n", ole_data.flags);
3675 for(
i=2;
i<
sizeof(ole_data)/
sizeof(
DWORD);
i++)
3676 ok(((
DWORD*)&ole_data)[
i] == 0,
"ole_data[%d] = %x\n",
i, ((
DWORD*)&ole_data)[
i]);
3680 ok(
hr ==
S_OK,
"SetConvertStg returned %x\n",
hr);
3687 ok(
hr ==
S_OK,
"WriteFmtUserTypeStg returned %x\n",
hr);
3692 ok(
hr ==
S_OK,
"IStream_Seek returned %x\n",
hr);
3694 ok(
hr ==
S_OK,
"IStream_Read returned %x\n",
hr);
3695 ok(comp_obj_data.reserved1 == 0xfffe0001,
"reserved1 = %x\n", comp_obj_data.reserved1);
3696 ok(comp_obj_data.version == 0xa03,
"version = %x\n", comp_obj_data.version);
3697 ok(comp_obj_data.reserved2[0] == -1,
"reserved2[0] = %x\n", comp_obj_data.reserved2[0]);
3699 ok(!comp_obj_data.ansi_user_type_len,
"ansi_user_type_len = %d\n", comp_obj_data.ansi_user_type_len);
3700 ok(!comp_obj_data.ansi_clipboard_format_len,
"ansi_clipboard_format_len = %d\n", comp_obj_data.ansi_clipboard_format_len);
3701 ok(!comp_obj_data.reserved3,
"reserved3 = %x\n", comp_obj_data.reserved3);
3702 ok(comp_obj_data.unicode_marker == 0x71b239f4,
"unicode_marker = %x\n", comp_obj_data.unicode_marker);
3703 ok(!comp_obj_data.unicode_user_type_len,
"unicode_user_type_len = %d\n", comp_obj_data.unicode_user_type_len);
3704 ok(!comp_obj_data.unicode_clipboard_format_len,
"unicode_clipboard_format_len = %d\n", comp_obj_data.unicode_clipboard_format_len);
3705 ok(!comp_obj_data.reserved4,
"reserved4 %d\n", comp_obj_data.reserved4);
3708 ok(!
ret,
"comp_obj_stream was not freed\n");
3710 ok(!
ret,
"ole_stream was not freed\n");