Piotr Caban : mshtml: Added OleObject_Advise implementation.
Alexandre Julliard
julliard at winehq.org
Mon Dec 7 10:26:19 CST 2009
Module: wine
Branch: master
Commit: bbfa604dc04990cdbaf89ccc9ea958a979f7790e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bbfa604dc04990cdbaf89ccc9ea958a979f7790e
Author: Piotr Caban <piotr at codeweavers.com>
Date: Mon Dec 7 14:52:28 2009 +0100
mshtml: Added OleObject_Advise implementation.
---
dlls/mshtml/htmldoc.c | 2 ++
dlls/mshtml/mshtml_private.h | 2 ++
dlls/mshtml/oleobj.c | 19 +++++++++++++++++--
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 291bba5..b52005b 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 4e02ce6..bf539d4 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 e9cb204..7ae03a4 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)
More information about the wine-cvs
mailing list