ole32: Query support also for static storage formats.
This commit is contained in:
parent
1ee773bdad
commit
83aa7eff6c
|
@ -102,6 +102,8 @@ static inline void init_fmtetc(FORMATETC *fmt, CLIPFORMAT cf, TYMED tymed)
|
||||||
*/
|
*/
|
||||||
static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf)
|
static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf)
|
||||||
{
|
{
|
||||||
|
static const UINT fmt_id[] = { CF_METAFILEPICT, CF_BITMAP, CF_DIB };
|
||||||
|
UINT i;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
FORMATETC fmt;
|
FORMATETC fmt;
|
||||||
STGMEDIUM med;
|
STGMEDIUM med;
|
||||||
|
@ -132,6 +134,17 @@ static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf)
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < sizeof(fmt_id)/sizeof(fmt_id[0]); i++)
|
||||||
|
{
|
||||||
|
init_fmtetc(&fmt, fmt_id[i], TYMED_ISTORAGE);
|
||||||
|
hr = IDataObject_QueryGetData(data, &fmt);
|
||||||
|
if(SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
*src_cf = fmt_id[i];
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* IPersistStorage */
|
/* IPersistStorage */
|
||||||
hr = IDataObject_QueryInterface(data, &IID_IPersistStorage, (void**)&persist);
|
hr = IDataObject_QueryInterface(data, &IID_IPersistStorage, (void**)&persist);
|
||||||
if(FAILED(hr)) return hr;
|
if(FAILED(hr)) return hr;
|
||||||
|
|
Loading…
Reference in New Issue