Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/ieframe/ieframe.h | 2 ++ dlls/ieframe/oleobject.c | 23 ++++++++++++++++++++--- dlls/ieframe/webbrowser.c | 3 +++ 3 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/dlls/ieframe/ieframe.h b/dlls/ieframe/ieframe.h index 8d238863be..329cea2f7c 100644 --- a/dlls/ieframe/ieframe.h +++ b/dlls/ieframe/ieframe.h @@ -199,6 +199,8 @@ struct WebBrowser { DWORD sink_aspects; DWORD sink_flags;
+ IOleAdviseHolder *advise_holder; + /* window context */
HWND frame_hwnd; diff --git a/dlls/ieframe/oleobject.c b/dlls/ieframe/oleobject.c index 62faaae6bd..9f5da4039d 100644 --- a/dlls/ieframe/oleobject.c +++ b/dlls/ieframe/oleobject.c @@ -760,11 +760,28 @@ static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect, }
static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink, - DWORD* pdwConnection) + DWORD *pdwConnection) { WebBrowser *This = impl_from_IOleObject(iface); - FIXME("(%p)->(%p, %p)\n", This, pAdvSink, pdwConnection); - return E_NOTIMPL; + HRESULT hr = S_OK; + + TRACE("(%p)->(%p, %p)\n", This, pAdvSink, pdwConnection); + + if(!pdwConnection) + return E_INVALIDARG; + + *pdwConnection = 0; + + if(!pAdvSink) + return E_INVALIDARG; + + if(!This->advise_holder) + hr = CreateOleAdviseHolder(&This->advise_holder); + + if(hr == S_OK) + hr = IOleAdviseHolder_Advise(This->advise_holder, pAdvSink, pdwConnection); + + return hr; }
static HRESULT WINAPI OleObject_Unadvise(IOleObject *iface, DWORD dwConnection) diff --git a/dlls/ieframe/webbrowser.c b/dlls/ieframe/webbrowser.c index 356b0a2833..87b74b8e01 100644 --- a/dlls/ieframe/webbrowser.c +++ b/dlls/ieframe/webbrowser.c @@ -170,6 +170,9 @@ static ULONG WINAPI WebBrowser_Release(IUnknown *iface) if(This->sink) IAdviseSink_Release(This->sink);
+ if(This->advise_holder) + IOleAdviseHolder_Release(This->advise_holder); + if(This->doc_host.document) IUnknown_Release(This->doc_host.document);