mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-02 13:27:35 +00:00
ole32: Allocate memory for a copy of the ptd member of FORMATETC in
DataAdviseHolder_Advise since there is no requirement for the application to keep this memory valid for the lifetime of the connection.
This commit is contained in:
parent
5e9df71e0e
commit
bb1276425f
1 changed files with 11 additions and 1 deletions
|
@ -723,8 +723,18 @@ static HRESULT WINAPI DataAdviseHolder_Advise(
|
|||
* Store the new sink
|
||||
*/
|
||||
This->Connections[index].sink = pAdvise;
|
||||
memcpy(&(This->Connections[index].fmat), pFetc, sizeof(FORMATETC));
|
||||
This->Connections[index].advf = advf & ~WINE_ADVF_REMOTE;
|
||||
memcpy(&(This->Connections[index].fmat), pFetc, sizeof(FORMATETC));
|
||||
if (pFetc->ptd)
|
||||
{
|
||||
This->Connections[index].fmat.ptd = CoTaskMemAlloc(pFetc->ptd->tdSize);
|
||||
if (!This->Connections[index].fmat.ptd)
|
||||
{
|
||||
IDataAdviseHolder_Unadvise(iface, index + 1);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
memcpy(This->Connections[index].fmat.ptd, pFetc->ptd, pFetc->ptd->tdSize);
|
||||
}
|
||||
|
||||
if (This->Connections[index].sink != NULL) {
|
||||
IAdviseSink_AddRef(This->Connections[index].sink);
|
||||
|
|
Loading…
Reference in a new issue