51#define NONAMELESSUNION
92#define STREAM_NUMBER_NOT_SET -2
93#define STREAM_NUMBER_CONTENTS -1
218 return wine_dbg_sprintf(
"{ cfFormat = 0x%x, ptd = %p, dwAspect = %d, lindex = %d, tymed = %d }",
219 formatetc->cfFormat, formatetc->ptd, formatetc->dwAspect,
220 formatetc->lindex, formatetc->tymed);
241 colors =
info->bmiHeader.biClrUsed;
244 if (!colors && (
info->bmiHeader.biBitCount <= 8))
245 colors = 1 <<
info->bmiHeader.biBitCount;
294 FORMATETC
fmt = *formatetc;
299 fmt.tymed = TYMED_HGLOBAL;
346 if (!
fmt->cfFormat ||
349 (
fmt->cfFormat ==
CF_DIB &&
fmt->tymed == TYMED_HGLOBAL) ||
352 else if (
fmt->tymed == TYMED_HGLOBAL)
356 WARN(
"invalid clipformat/tymed combination: %d/%d\n",
fmt->cfFormat,
fmt->tymed);
369 entry->stgmedium.tymed = TYMED_NULL;
376 entry->advise_flags = advf;
385 DWORD id = automatic ? 1 :
This->last_cache_id;
392 TRACE(
"creating unsupported format %d\n", formatetc->cfFormat);
406 This->last_cache_id++;
430 TRACE(
"(%p, %x, %d)\n",
this, aspect, lindex);
437 if ((this->sinkAspects & aspect) != 0)
439 if (this->sinkInterface !=
NULL)
441 IAdviseSink_OnViewChange(this->sinkInterface,
449 if ( (this->sinkAdviseFlag & ADVF_ONLYONCE) != 0)
451 IAdviseSink_Release(this->sinkInterface);
453 this->sinkInterface =
NULL;
454 this->sinkAspects = 0;
455 this->sinkAdviseFlag = 0;
505 char format_name[256];
509 else if (clipformat < 0xc000)
521 if (clipformat < 0xc000)
537 WCHAR pres[] = {2,
'O',
'l',
'e',
'P',
'r',
'e',
's',
538 '0' + (stream_number / 100) % 10,
539 '0' + (stream_number / 10) % 10,
540 '0' + stream_number % 10, 0};
564 med->tymed = TYMED_ENHMF;
565 med->pUnkForRelease =
NULL;
593 CLIPFORMAT clipformat;
598 hr = IStream_Stat( stm, &
stat, STATFLAG_NONAME );
610 hr = IStream_Read( stm, &mf_place,
sizeof(mf_place), &
read );
614 hr = IStream_Seek( stm, offset_zero, STREAM_SEEK_CUR, ¤t_pos );
643 * 2540) / mf_place.
inch;
645 * 2540) / mf_place.
inch;
680 hr = IStream_Stat( stm, &
stat, STATFLAG_NONAME );
687 hr = IStream_Read( stm, &pres,
sizeof(pres), &
read );
696 hr = IStream_Seek( stm, offset_zero, STREAM_SEEK_CUR, ¤t_pos );
706 if (
hr !=
S_OK)
goto fail;
708 if (
stat.cbSize.QuadPart < bi_size)
goto fail;
712 if (
hr !=
S_OK)
goto fail;
715 if (
stat.cbSize.QuadPart < info_size)
goto fail;
716 if (info_size > bi_size)
718 hr = IStream_Read( stm,
dib + bi_size, info_size - bi_size, &
read );
719 if (
hr !=
S_OK)
goto fail;
721 stat.cbSize.QuadPart -= info_size;
728 skip.QuadPart =
file.bfOffBits -
sizeof(
file) - info_size;
729 if (
stat.cbSize.QuadPart <
skip.QuadPart)
goto fail;
730 hr = IStream_Seek( stm,
skip, STREAM_SEEK_CUR,
NULL );
731 if (
hr !=
S_OK)
goto fail;
732 stat.cbSize.QuadPart -=
skip.QuadPart;
735 hr = IStream_Read( stm,
dib + info_size,
stat.cbSize.u.LowPart, &
read );
736 if (
hr !=
S_OK)
goto fail;
738 if (bi_size >=
sizeof(*
info))
741 if (
info->biXPelsPerMeter == 0 ||
info->biYPelsPerMeter == 0)
787 hr = IStream_Stat( stm, &
stat, STATFLAG_NONAME );
859 IStream_Release( stm );
865 if (
entry->fmtetc.ptd)
866 FIXME(
"ptd not serialized\n");
872 header->dwObjectExtentX = 0;
873 header->dwObjectExtentY = 0;
883 if (
entry->stgmedium.tymed != TYMED_NULL)
898 header.dwSize = data_size;
914 if (
hr ==
S_OK && data_size)
949 if (
entry->stgmedium.tymed != TYMED_NULL)
957 header.dwSize = data_size;
968 if (
hr ==
S_OK && data_size)
972 else if (
entry->stgmedium.tymed != TYMED_NULL)
990 meta_place_rec.
key = 0x9ac6cdd7;
991 meta_place_rec.
hwmf = 0;
992 meta_place_rec.
inch = 576;
1008 if (
hr ==
S_OK && data_size)
1036 header.dwSize = data_size;
1049 if (
hr ==
S_OK && data_size)
1053 else if (
entry->stgmedium.tymed != TYMED_NULL)
1085 WCHAR pres[] = {2,
'O',
'l',
'e',
'P',
'r',
'e',
's',
1129 FIXME(
"got unsupported clipboard format %x\n",
cache_entry->fmtetc.cfFormat);
1140 const STGMEDIUM *src_stgm)
1142 if (src_stgm->tymed == TYMED_MFPICT)
1150 dest_mfpict =
GlobalLock(dest_stgm->u.hMetaFilePict);
1156 *dest_mfpict = *src_mfpict;
1161 else if (src_stgm->tymed != TYMED_NULL)
1165 if (!dest_stgm->u.hGlobal)
1168 dest_stgm->tymed = src_stgm->tymed;
1169 dest_stgm->pUnkForRelease = src_stgm->pUnkForRelease;
1170 if (dest_stgm->pUnkForRelease)
1171 IUnknown_AddRef(dest_stgm->pUnkForRelease);
1190 memset( bmi, 0, header_size );
1194 med->tymed = TYMED_HGLOBAL;
1195 med->pUnkForRelease =
NULL;
1216 med->tymed = TYMED_GDI;
1217 med->pUnkForRelease =
NULL;
1225 const FORMATETC *formatetc,
1226 STGMEDIUM *stgmedium,
1232 if ((!
cache_entry->fmtetc.cfFormat && !formatetc->cfFormat) ||
1233 (
cache_entry->fmtetc.tymed == TYMED_NULL && formatetc->tymed == TYMED_NULL) ||
1234 stgmedium->tymed == TYMED_NULL)
1236 WARN(
"invalid formatetc\n");
1300 default:
return TYMED_HGLOBAL;
1314 static const struct data
1381 if (this->outer_unk == iface)
1393 *
ppvObject = &this->IPersistStorage_iface;
1407 *
ppvObject = &this->IOleCacheControl_iface;
1468 return IUnknown_QueryInterface(this->outer_unk,
riid,
ppvObject);
1479 return IUnknown_AddRef(this->outer_unk);
1490 return IUnknown_Release(this->outer_unk);
1500 LPFORMATETC pformatetcIn,
1508 memset(pmedium, 0,
sizeof(*pmedium));
1519 LPFORMATETC pformatetc,
1544 LPFORMATETC pformatectIn,
1545 LPFORMATETC pformatetcOut)
1558 LPFORMATETC pformatetc,
1565 TRACE(
"(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease);
1572 hres = IOleCache2_SetData(oleCache, pformatetc, pmedium, fRelease);
1574 IOleCache2_Release(oleCache);
1600 FORMATETC* pformatetc,
1603 DWORD* pdwConnection)
1650 return IUnknown_QueryInterface(this->outer_unk,
riid,
ppvObject);
1661 return IUnknown_AddRef(this->outer_unk);
1672 return IUnknown_Release(this->outer_unk);
1698 TRACE(
"(%p)\n", iface);
1724 TRACE(
"(%p, %p)\n", iface, pStg);
1726 if (
This->presentationStorage !=
NULL)
1729 This->presentationStorage = pStg;
1731 IStorage_AddRef(
This->presentationStorage);
1737 IStorage_Release( pStg );
1773 CLIPFORMAT clipformat;
1775 int stream_number = 0;
1788 fmtetc.cfFormat = clipformat;
1790 fmtetc.dwAspect =
header.dvAspect;
1791 fmtetc.lindex =
header.lindex;
1796 IStream_Release( stm );
1820 IStream_Release( stm );
1839 TRACE(
"(%p, %p)\n", iface, stg);
1841 IPersistStorage_HandsOffStorage( iface );
1853 if (
This->clsid_static)
1864 This->presentationStorage = stg;
1865 IStorage_AddRef(
This->presentationStorage );
1884 int stream_number = 0;
1886 TRACE(
"(%p, %p, %d)\n", iface, stg, same_as_load);
1891 if (
cache_entry->save_stream_num != stream_number)
1926 TRACE(
"(%p, %p)\n", iface, pStgNew);
1930 IPersistStorage_HandsOffStorage(iface);
1949 TRACE(
"(%p)\n", iface);
1951 if (this->presentationStorage !=
NULL)
1953 IStorage_Release(this->presentationStorage);
1954 this->presentationStorage =
NULL;
1975 return IUnknown_QueryInterface(this->outer_unk,
riid,
ppvObject);
1986 return IUnknown_AddRef(this->outer_unk);
1997 return IUnknown_Release(this->outer_unk);
2011 DVTARGETDEVICE* ptd,
2023 TRACE(
"(%p, %x, %d, %p, %p, %p, %p, %p, %p, %lx)\n",
2035 if (lprcBounds==
NULL)
2041 if ((
cache_entry->fmtetc.dwAspect != dwDrawAspect) ||
2057 if (pfnContinue && !pfnContinue(dwContinue))
return E_ABORT;
2069 SIZE oldViewportExt;
2070 POINT oldViewportOrg;
2073 if ((
cache_entry->stgmedium.tymed != TYMED_MFPICT) ||
2122 if ((
cache_entry->stgmedium.tymed != TYMED_HGLOBAL) ||
2129 0, 0,
info->bmiHeader.biWidth,
info->bmiHeader.biHeight,
2138 WARN(
"no data could be found to be drawn\n");
2148 DVTARGETDEVICE* ptd,
2149 HDC hicTargetDevice,
2189 TRACE(
"(%p, %x, %x, %p)\n", iface, aspects, advf, pAdvSink);
2194 if (this->sinkInterface !=
NULL)
2196 IAdviseSink_Release(this->sinkInterface);
2197 this->sinkInterface =
NULL;
2198 this->sinkAspects = 0;
2199 this->sinkAdviseFlag = 0;
2207 this->sinkInterface = pAdvSink;
2208 this->sinkAspects = aspects;
2209 this->sinkAdviseFlag = advf;
2211 IAdviseSink_AddRef(this->sinkInterface);
2218 if (advf & ADVF_PRIMEFIRST)
2240 TRACE(
"(%p, %p, %p, %p)\n", iface, pAspects, pAdvf, ppAdvSink);
2246 *pAspects = this->sinkAspects;
2249 *pAdvf = this->sinkAdviseFlag;
2251 if (ppAdvSink!=
NULL)
2253 if (this->sinkInterface !=
NULL)
2254 IAdviseSink_QueryInterface(this->sinkInterface,
2257 else *ppAdvSink =
NULL;
2272 DVTARGETDEVICE* ptd,
2279 TRACE(
"(%p, %x, %d, %p, %p)\n",
2280 iface, dwDrawAspect, lindex, ptd, lpsizel);
2289 FIXME(
"Unimplemented flag lindex = %d\n", lindex);
2296 FIXME(
"Unimplemented ptd = %p\n", ptd);
2301 if ((
cache_entry->fmtetc.dwAspect != dwDrawAspect) ||
2324 if ((
cache_entry->stgmedium.tymed != TYMED_MFPICT) ||
2328 lpsizel->
cx = mfpict->
xExt;
2329 lpsizel->
cy = mfpict->
yExt;
2338 LONG x_pels_m, y_pels_m;
2341 if ((
cache_entry->stgmedium.tymed != TYMED_HGLOBAL) ||
2345 x_pels_m =
info->biXPelsPerMeter;
2346 y_pels_m =
info->biYPelsPerMeter;
2349 if (x_pels_m != 0 && y_pels_m != 0)
2351 lpsizel->
cx =
info->biWidth * 100000 / x_pels_m;
2352 lpsizel->
cy =
info->biHeight * 100000 / y_pels_m;
2370 WARN(
"no data could be found to get the extents from\n");
2394 return IUnknown_QueryInterface(this->outer_unk,
riid,
ppvObject);
2405 return IUnknown_AddRef(this->outer_unk);
2416 return IUnknown_Release(this->outer_unk);
2430 flags =
cache_entry->advise_flags & ~(ADVFCACHE_NOHANDLER | ADVFCACHE_FORCEBUILTIN | ADVFCACHE_ONSAVE);
2432 if(
This->running_object)
2433 if(!(
flags & ADVF_NODATA))
2441 FORMATETC* pformatetc,
2443 DWORD* pdwConnection)
2450 TRACE(
"(%p, 0x%x, %p)\n", pformatetc, advf, pdwConnection);
2452 if (!pformatetc || !pdwConnection)
2457 fmt_cpy = *pformatetc;
2458 if (fmt_cpy.cfFormat ==
CF_BITMAP && fmt_cpy.tymed == TYMED_GDI)
2460 fmt_cpy.cfFormat =
CF_DIB;
2461 fmt_cpy.tymed = TYMED_HGLOBAL;
2465 if (fmt_cpy.dwAspect == DVASPECT_ICON && fmt_cpy.cfFormat == 0)
2468 fmt_cpy.tymed = TYMED_MFPICT;
2476 TRACE(
"found an existing cache entry\n");
2501 TRACE(
"(%d)\n", dwConnection);
2510 WARN(
"no connection found for %d\n", dwConnection);
2538 if (
i ==
count)
goto fail;
2548 if (
i ==
count)
goto fail;
2552 data[
i].formatetc.tymed = TYMED_GDI;
2572 return IOleCache2_UpdateCache( iface,
data, UPDFCACHE_ALLBUTNODATACACHE,
NULL );
2577 FORMATETC* pformatetc,
2585 TRACE(
"(%p, %p, %s)\n", pformatetc, pmedium, fRelease ?
"TRUE" :
"FALSE");
2599 WARN(
"cache entry not found\n");
2606 BOOL is_blank =
entry->stgmedium.tymed == TYMED_NULL;
2608 if ((
mode & UPDFCACHE_ONLYIFBLANK) && !is_blank)
return FALSE;
2610 if ((
mode & UPDFCACHE_NODATACACHE) && (
entry->advise_flags & ADVF_NODATA))
return TRUE;
2611 if ((
mode & UPDFCACHE_ONSAVECACHE) && (
entry->advise_flags & ADVFCACHE_ONSAVE))
return TRUE;
2612 if ((
mode & UPDFCACHE_ONSTOPCACHE) && (
entry->advise_flags & ADVF_DATAONSTOP))
return TRUE;
2613 if ((
mode & UPDFCACHE_NORMALCACHE) && (
entry->advise_flags == 0))
return TRUE;
2614 if ((
mode & UPDFCACHE_IFBLANK) && (is_blank && !(
entry->advise_flags & ADVF_NODATA)))
return TRUE;
2647 hr = IDataObject_GetData(
data, &
fmt, &med );
2651 fmt.tymed = TYMED_GDI;
2652 hr = IDataObject_GetData(
data, &
fmt, &med );
2657 fmt.tymed = TYMED_MFPICT;
2658 hr = IDataObject_GetData(
data, &
fmt, &med );
2664 else done_one =
TRUE;
2671 fmt.cfFormat = view_list[
i];
2673 hr = IDataObject_QueryGetData(
data, &
fmt );
2676 hr = IDataObject_GetData(
data, &
fmt, &med );
2691 else done_one =
TRUE;
2704 DWORD dwDiscardOptions)
2710 TRACE(
"(%d)\n", dwDiscardOptions);
2712 if (dwDiscardOptions == DISCARDCACHE_SAVEIFDIRTY)
2741 return IUnknown_QueryInterface(this->outer_unk,
riid,
ppvObject);
2752 return IUnknown_AddRef(this->outer_unk);
2763 return IUnknown_Release(this->outer_unk);
2774 TRACE(
"(%p)->(%p)\n", iface, data_obj);
2776 if(
This->running_object)
return S_OK;
2779 This->running_object = data_obj;
2797 TRACE(
"(%p)\n", iface);
2799 if(!
This->running_object)
return S_OK;
2832 IAdviseSink_AddRef(iface);
2852 IOleCache2_SetData(&
This->IOleCache2_iface,
fmt, med,
FALSE);
struct outqueuenode * head
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_remove(struct list_entry *entry)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
const CLSID CLSID_Picture_EnhMetafile
const CLSID CLSID_Picture_Dib
const CLSID CLSID_Picture_Metafile
static HRESULT copy_formatetc(FORMATETC *dst, const FORMATETC *src)
HRESULT EnumSTATDATA_Construct(IUnknown *holder, ULONG index, DWORD array_len, STATDATA *data, BOOL copy, IEnumSTATDATA **ppenum) DECLSPEC_HIDDEN
static HRESULT WINAPI DataCache_IViewObject2_QueryInterface(IViewObject2 *iface, REFIID riid, void **ppvObject)
static DataCache * impl_from_IUnknown(IUnknown *iface)
static int bitmap_info_size(const BITMAPINFO *info, WORD coloruse)
static HRESULT WINAPI DataCache_EnumFormatEtc(IDataObject *iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
static HRESULT DataCacheEntry_LoadData(DataCacheEntry *cache_entry, IStorage *stg)
static void DataCache_Destroy(DataCache *ptrToDestroy)
static HRESULT WINAPI DataCache_GetData(IDataObject *iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
static DataCache * impl_from_IOleCache2(IOleCache2 *iface)
static void init_stream_header(DataCacheEntry *entry, PresentationDataHeader *header)
static HRESULT DataCacheEntry_SetData(DataCacheEntry *cache_entry, const FORMATETC *formatetc, STGMEDIUM *stgmedium, BOOL fRelease)
static HRESULT WINAPI DataCache_Freeze(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect, DWORD *pdwFreeze)
static HRESULT WINAPI DataCache_GetClassID(IPersistStorage *iface, CLSID *clsid)
static void WINAPI DataCache_OnClose(IAdviseSink *iface)
static HRESULT save_dib(DataCacheEntry *entry, BOOL contents, IStream *stream)
static const IAdviseSinkVtbl DataCache_IAdviseSink_VTable
static HRESULT parse_contents_stream(DataCache *cache, IStorage *stg)
static ULONG WINAPI DataCache_IOleCacheControl_Release(IOleCacheControl *iface)
static HRESULT WINAPI DataCache_UpdateCache(IOleCache2 *iface, IDataObject *data, DWORD mode, void *reserved)
static HRESULT add_cache_entry(DataCache *This, const FORMATETC *fmt, DWORD advf, int stream_number)
static HRESULT check_valid_formatetc(const FORMATETC *fmt)
static HRESULT WINAPI DataCache_OnStop(IOleCacheControl *iface)
static HRESULT WINAPI DataCache_Draw(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds, BOOL(CALLBACK *pfnContinue)(ULONG_PTR dwContinue), ULONG_PTR dwContinue)
static HRESULT WINAPI DataCache_GetAdvise(IViewObject2 *iface, DWORD *pAspects, DWORD *pAdvf, IAdviseSink **ppAdvSink)
static HRESULT WINAPI DataCache_Cache(IOleCache2 *iface, FORMATETC *pformatetc, DWORD advf, DWORD *pdwConnection)
static HRESULT get_static_entry(DataCache *cache, DataCacheEntry **cache_entry)
static HRESULT WINAPI DataCache_EnumDAdvise(IDataObject *iface, IEnumSTATDATA **ppenumAdvise)
static HRESULT WINAPI DataCache_GetExtent(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, DVTARGETDEVICE *ptd, LPSIZEL lpsizel)
static const IUnknownVtbl DataCache_NDIUnknown_VTable
static HRESULT open_pres_stream(IStorage *stg, int stream_number, IStream **stm)
static HRESULT WINAPI DataCache_Load(IPersistStorage *iface, IStorage *stg)
static HRESULT WINAPI DataCache_DUnadvise(IDataObject *iface, DWORD dwConnection)
static HRESULT copy_stg_medium(CLIPFORMAT cf, STGMEDIUM *dest_stgm, const STGMEDIUM *src_stgm)
#define STREAM_NUMBER_CONTENTS
static HRESULT read_clipformat(IStream *stream, CLIPFORMAT *clipformat)
static HRESULT WINAPI DataCache_SaveCompleted(IPersistStorage *iface, IStorage *pStgNew)
static void WINAPI DataCache_OnDataChange(IAdviseSink *iface, FORMATETC *fmt, STGMEDIUM *med)
static HRESULT load_dib(DataCacheEntry *cache_entry, IStream *stm)
static HRESULT load_mf_pict(DataCacheEntry *cache_entry, IStream *stm)
static HRESULT WINAPI DataCache_IAdviseSink_QueryInterface(IAdviseSink *iface, REFIID iid, void **obj)
static HRESULT WINAPI DataCache_NDIUnknown_QueryInterface(IUnknown *iface, REFIID riid, void **ppvObject)
static const IViewObject2Vtbl DataCache_IViewObject2_VTable
static HRESULT write_clipformat(IStream *stream, CLIPFORMAT clipformat)
struct PresentationDataHeader PresentationDataHeader
static ULONG WINAPI DataCache_IViewObject2_AddRef(IViewObject2 *iface)
static HRESULT WINAPI DataCache_IPersistStorage_QueryInterface(IPersistStorage *iface, REFIID riid, void **ppvObject)
static const IPersistStorageVtbl DataCache_IPersistStorage_VTable
static HRESULT DataCacheEntry_DiscardData(DataCacheEntry *cache_entry)
static BOOL entry_updatable(DataCacheEntry *entry, DWORD mode)
static ULONG WINAPI DataCache_IOleCacheControl_AddRef(IOleCacheControl *iface)
static const IOleCache2Vtbl DataCache_IOleCache2_VTable
static HRESULT WINAPI DataCache_GetDataHere(IDataObject *iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium)
static HRESULT WINAPI DataCache_IDataObject_SetData(IDataObject *iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
static HRESULT WINAPI DataCache_OnRun(IOleCacheControl *iface, IDataObject *data_obj)
static void DataCache_FireOnViewChange(DataCache *this, DWORD aspect, LONG lindex)
static HRESULT DataCacheEntry_GetData(DataCacheEntry *cache_entry, IStorage *stg, FORMATETC *fmt, STGMEDIUM *stgmedium)
static HRESULT DataCacheEntry_Save(DataCacheEntry *cache_entry, IStorage *storage, BOOL same_as_load)
static HRESULT WINAPI DataCache_IOleCache2_SetData(IOleCache2 *iface, FORMATETC *pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
static HRESULT WINAPI DataCache_IsDirty(IPersistStorage *iface)
static const IDataObjectVtbl DataCache_IDataObject_VTable
static HRESULT WINAPI DataCache_InitNew(IPersistStorage *iface, IStorage *pStg)
static HRESULT synthesize_dib(HBITMAP bm, STGMEDIUM *med)
static DataCache * impl_from_IViewObject2(IViewObject2 *iface)
static HRESULT load_emf(DataCacheEntry *cache_entry, IStream *stm)
static HRESULT WINAPI DataCache_InitCache(IOleCache2 *iface, IDataObject *data)
static ULONG WINAPI DataCache_IAdviseSink_AddRef(IAdviseSink *iface)
static HRESULT WINAPI DataCache_IOleCacheControl_QueryInterface(IOleCacheControl *iface, REFIID riid, void **ppvObject)
static HRESULT WINAPI DataCache_EnumCache(IOleCache2 *iface, IEnumSTATDATA **enum_stat)
static ULONG WINAPI DataCache_NDIUnknown_Release(IUnknown *iface)
static HRESULT WINAPI DataCache_QueryGetData(IDataObject *iface, FORMATETC *fmt)
static HRESULT WINAPI DataCache_Unfreeze(IViewObject2 *iface, DWORD dwFreeze)
static HRESULT WINAPI DataCache_IOleCache2_QueryInterface(IOleCache2 *iface, REFIID riid, void **ppvObject)
HRESULT WINAPI CreateDataCache(LPUNKNOWN pUnkOuter, REFCLSID rclsid, REFIID riid, LPVOID *ppvObj)
static ULONG WINAPI DataCache_IPersistStorage_Release(IPersistStorage *iface)
static HRESULT WINAPI DataCache_DiscardCache(IOleCache2 *iface, DWORD dwDiscardOptions)
static DataCache * impl_from_IOleCacheControl(IOleCacheControl *iface)
static HRESULT save_emf(DataCacheEntry *entry, BOOL contents, IStream *stream)
static HRESULT synthesize_emf(HMETAFILEPICT data, STGMEDIUM *med)
static void DataCacheEntry_Destroy(DataCache *cache, DataCacheEntry *cache_entry)
const char * debugstr_formatetc(const FORMATETC *formatetc)
static HRESULT setup_sink(DataCache *This, DataCacheEntry *cache_entry)
static HRESULT parse_pres_streams(DataCache *cache, IStorage *stg)
static HRESULT create_stream(DataCacheEntry *cache_entry, IStorage *storage, BOOL contents, IStream **stream)
static void WINAPI DataCache_OnSave(IAdviseSink *iface)
static ULONG WINAPI DataCache_IOleCache2_Release(IOleCache2 *iface)
static HRESULT save_view_cache(DataCacheEntry *entry, IStream *stream)
#define STREAM_NUMBER_NOT_SET
static ULONG WINAPI DataCache_IViewObject2_Release(IViewObject2 *iface)
static HRESULT WINAPI DataCache_DAdvise(IDataObject *iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
static BOOL init_cache_entry(DataCacheEntry *entry, const FORMATETC *fmt, DWORD advf, DWORD id)
static DataCache * impl_from_IPersistStorage(IPersistStorage *iface)
static DataCache * impl_from_IDataObject(IDataObject *iface)
static void WINAPI DataCache_OnViewChange(IAdviseSink *iface, DWORD aspect, LONG index)
static ULONG WINAPI DataCache_IAdviseSink_Release(IAdviseSink *iface)
static DataCacheEntry * DataCache_GetEntryForFormatEtc(DataCache *This, const FORMATETC *formatetc)
static DataCache * impl_from_IAdviseSink(IAdviseSink *iface)
static ULONG WINAPI DataCache_NDIUnknown_AddRef(IUnknown *iface)
static HRESULT WINAPI DataCache_GetColorSet(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDevice, LOGPALETTE **ppColorSet)
static ULONG WINAPI DataCache_IDataObject_Release(IDataObject *iface)
static ULONG WINAPI DataCache_IPersistStorage_AddRef(IPersistStorage *iface)
static HRESULT create_automatic_entry(DataCache *cache, const CLSID *clsid)
static HRESULT WINAPI DataCache_GetCanonicalFormatEtc(IDataObject *iface, LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut)
static HRESULT synthesize_bitmap(HGLOBAL dib, STGMEDIUM *med)
static const WCHAR CONTENTS[]
static ULONG WINAPI DataCache_IOleCache2_AddRef(IOleCache2 *iface)
static HRESULT WINAPI DataCache_Save(IPersistStorage *iface, IStorage *stg, BOOL same_as_load)
static HRESULT WINAPI DataCache_SetAdvise(IViewObject2 *iface, DWORD aspects, DWORD advf, IAdviseSink *pAdvSink)
static HRESULT save_mfpict(DataCacheEntry *entry, BOOL contents, IStream *stream)
static void WINAPI DataCache_OnRename(IAdviseSink *iface, IMoniker *mk)
static HRESULT WINAPI DataCache_IDataObject_QueryInterface(IDataObject *iface, REFIID riid, void **ppvObject)
static HRESULT WINAPI DataCache_HandsOffStorage(IPersistStorage *iface)
static const IOleCacheControlVtbl DataCache_IOleCacheControl_VTable
static HRESULT DataCache_CreateEntry(DataCache *This, const FORMATETC *formatetc, DWORD advf, BOOL automatic, DataCacheEntry **cache_entry)
static ULONG WINAPI DataCache_IDataObject_AddRef(IDataObject *iface)
static DWORD tymed_from_cf(DWORD cf)
static HRESULT WINAPI DataCache_Uncache(IOleCache2 *iface, DWORD dwConnection)
static DataCache * DataCache_Construct(REFCLSID clsid, LPUNKNOWN pUnkOuter)
const char * wine_dbg_sprintf(const char *format,...)
#define HeapFree(x, y, z)
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
HRESULT WINAPI ReadClassStg(IStorage *pstg, CLSID *pclsid)
#define check(expected, result)
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
GLuint GLsizei GLsizei * length
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)
#define memcpy(s1, s2, n)
static const BYTE masks[8]
static const char * contents
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
#define STGM_SHARE_EXCLUSIVE
HANDLE WINAPI OleDuplicateData(HANDLE hSrc, CLIPFORMAT cfFormat, UINT uiFlags)
const GUID IID_IViewObject
const GUID IID_IAdviseSink
const GUID IID_IViewObject2
const GUID IID_IOleCache2
const GUID IID_IOleCacheControl
const GUID IID_IDataObject
const GUID IID_IPersistStorage
#define IsEqualIID(riid1, riid2)
#define IsEqualCLSID(rclsid1, rclsid2)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
IAdviseSink * sinkInterface
IAdviseSink IAdviseSink_iface
IViewObject2 IViewObject2_iface
IDataObject IDataObject_iface
IStorage * presentationStorage
IOleCache2 IOleCache2_iface
IOleCacheControl IOleCacheControl_iface
IPersistStorage IPersistStorage_iface
IDataObject * running_object
BITMAPINFOHEADER bmiHeader
#define FIELD_OFFSET(t, f)
#define CONTAINING_RECORD(address, type, field)
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
#define CACHE_S_SAMECACHE
#define OLE_E_NOCONNECTION
#define CACHE_S_FORMATETC_NOTSUPPORTED
#define CACHE_E_NOCACHE_UPDATED
#define OLE_E_ADVISENOTSUPPORTED
#define CO_E_ALREADYINITIALIZED
int WINAPI SetMapMode(_In_ HDC, _In_ int)
UINT WINAPI GetEnhMetaFileBits(_In_ HENHMETAFILE hEMF, _In_ UINT nSize, _Out_writes_bytes_opt_(nSize) LPBYTE lpData)
struct tagBITMAPFILEHEADER BITMAPFILEHEADER
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
int WINAPI GetDIBits(_In_ HDC hdc, _In_ HBITMAP hbm, _In_ UINT start, _In_ UINT cLines, _Out_opt_ LPVOID lpvBits, _At_((LPBITMAPINFOHEADER) lpbmi, _Inout_) LPBITMAPINFO lpbmi, _In_ UINT usage)
BOOL WINAPI SetViewportExtEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPSIZE)
BOOL WINAPI SetViewportOrgEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
HMETAFILE WINAPI CopyMetaFileW(_In_ HMETAFILE hmfSrc, _In_opt_ LPCWSTR pszFile)
UINT WINAPI GetWinMetaFileBits(_In_ HENHMETAFILE hemf, _In_ UINT cbData16, _Out_writes_bytes_opt_(cbData16) LPBYTE pData16, _In_ INT iMapMode, _In_ HDC hdcRef)
BOOL WINAPI SetWindowExtEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPSIZE)
UINT WINAPI GetMetaFileBitsEx(_In_ HMETAFILE hMF, _In_ UINT cbBuffer, _Out_writes_bytes_opt_(cbBuffer) LPVOID lpData)
HMETAFILE WINAPI SetMetaFileBitsEx(_In_ UINT cbBuffer, _In_reads_bytes_(cbBuffer) CONST BYTE *lpData)
HENHMETAFILE WINAPI SetEnhMetaFileBits(_In_ UINT nSize, _In_reads_bytes_(nSize) const BYTE *pb)
struct tagENHMETAHEADER ENHMETAHEADER
HBITMAP WINAPI CreateDIBitmap(_In_ HDC hdc, _In_opt_ const BITMAPINFOHEADER *pbmih, _In_ DWORD fdwInit, _In_opt_ const VOID *pvInit, _In_opt_ const BITMAPINFO *pbmi, _In_ UINT uUsage)
BOOL WINAPI PlayMetaFile(_In_ HDC, _In_ HMETAFILE)
int WINAPI StretchDIBits(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ const VOID *, _In_ const BITMAPINFO *, _In_ UINT, _In_ DWORD)
HENHMETAFILE WINAPI SetWinMetaFileBits(_In_ UINT nSize, _In_reads_bytes_(nSize) const BYTE *lpMeta16Data, _In_opt_ HDC hdcRef, _In_opt_ const METAFILEPICT *lpMFP)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
int WINAPI GetClipboardFormatNameA(_In_ UINT format, _Out_writes_(cchMaxCount) LPSTR lpszFormatName, _In_ int cchMaxCount)
HDC WINAPI GetDC(_In_opt_ HWND)
UINT WINAPI RegisterClipboardFormatA(_In_ LPCSTR)