Commit 25d7ecde authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

ole32: Add support for getting stream based objects from a flushed clipboard.

parent f8a9ca2c
......@@ -959,6 +959,33 @@ static HRESULT get_stgmed_for_global(HGLOBAL h, STGMEDIUM *med)
}
/************************************************************************
* get_stgmed_for_stream
*
* Returns a stg medium with a stream based on the handle
*/
static HRESULT get_stgmed_for_stream(HGLOBAL h, STGMEDIUM *med)
{
HRESULT hr;
HGLOBAL dst;
med->pUnkForRelease = NULL;
med->tymed = TYMED_NULL;
hr = dup_global_mem(h, GMEM_MOVEABLE, &dst);
if(FAILED(hr)) return hr;
hr = CreateStreamOnHGlobal(dst, TRUE, &med->u.pstm);
if(FAILED(hr))
{
GlobalFree(dst);
return hr;
}
med->tymed = TYMED_ISTREAM;
return hr;
}
/************************************************************************
* snapshot_GetData
*/
static HRESULT WINAPI snapshot_GetData(IDataObject *iface, FORMATETC *fmt,
......@@ -1005,6 +1032,8 @@ static HRESULT WINAPI snapshot_GetData(IDataObject *iface, FORMATETC *fmt,
if(mask & TYMED_HGLOBAL)
hr = get_stgmed_for_global(h, med);
else if(mask & TYMED_ISTREAM)
hr = get_stgmed_for_stream(h, med);
else
{
FIXME("Unhandled tymed - emum tymed %x req tymed %x\n", entry->fmtetc.tymed, fmt->tymed);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment