diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 291bba53051..b52005b2e10 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1951,6 +1951,8 @@ static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface) This->basedoc.window->doc_obj = NULL; IHTMLWindow2_Release(HTMLWINDOW2(This->basedoc.window)); } + if(This->basedoc.advise_holder) + IOleAdviseHolder_Release(This->basedoc.advise_holder); if(This->client) IOleObject_SetClientSite(OLEOBJ(&This->basedoc), NULL); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 4e02ce61e9a..bf539d444d6 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -338,6 +338,8 @@ struct HTMLDocument { ConnectionPoint cp_htmldocevents; ConnectionPoint cp_htmldocevents2; ConnectionPoint cp_propnotif; + + IOleAdviseHolder *advise_holder; }; static inline HRESULT htmldoc_query_interface(HTMLDocument *This, REFIID riid, void **ppv) diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index e9cb2040a0a..7ae03a4631a 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -380,8 +380,23 @@ static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect, static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink, DWORD *pdwConnection) { HTMLDocument *This = OLEOBJ_THIS(iface); - FIXME("(%p)->(%p %p)\n", This, pAdvSink, pdwConnection); - return E_NOTIMPL; + TRACE("(%p)->(%p %p)\n", This, pAdvSink, pdwConnection); + + if(!pdwConnection) + return E_INVALIDARG; + + if(!pAdvSink) { + *pdwConnection = 0; + return E_INVALIDARG; + } + + if(!This->advise_holder) { + CreateOleAdviseHolder(&This->advise_holder); + if(!This->advise_holder) + return E_OUTOFMEMORY; + } + + return IOleAdviseHolder_Advise(This->advise_holder, pAdvSink, pdwConnection); } static HRESULT WINAPI OleObject_Unadvise(IOleObject *iface, DWORD dwConnection)