ole32/tests: Set tymed in GetData and AddRef the interfaces (ReleaseStgMedium releases them even if pUnkForRelease is non-NULL).
This commit is contained in:
parent
af5ce0d249
commit
126ec0181f
|
@ -245,11 +245,22 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor
|
||||||
IUnknown_AddRef(pmedium->pUnkForRelease);
|
IUnknown_AddRef(pmedium->pUnkForRelease);
|
||||||
|
|
||||||
if(pformatetc->cfFormat == CF_TEXT || pformatetc->cfFormat == cf_global)
|
if(pformatetc->cfFormat == CF_TEXT || pformatetc->cfFormat == cf_global)
|
||||||
|
{
|
||||||
|
pmedium->tymed = TYMED_HGLOBAL;
|
||||||
U(*pmedium).hGlobal = This->text;
|
U(*pmedium).hGlobal = This->text;
|
||||||
|
}
|
||||||
else if(pformatetc->cfFormat == cf_stream)
|
else if(pformatetc->cfFormat == cf_stream)
|
||||||
|
{
|
||||||
|
pmedium->tymed = TYMED_ISTREAM;
|
||||||
|
IStream_AddRef(This->stm);
|
||||||
U(*pmedium).pstm = This->stm;
|
U(*pmedium).pstm = This->stm;
|
||||||
|
}
|
||||||
else if(pformatetc->cfFormat == cf_storage)
|
else if(pformatetc->cfFormat == cf_storage)
|
||||||
|
{
|
||||||
|
pmedium->tymed = TYMED_ISTORAGE;
|
||||||
|
IStorage_AddRef(This->stg);
|
||||||
U(*pmedium).pstg = This->stg;
|
U(*pmedium).pstg = This->stg;
|
||||||
|
}
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue