Jacek Caban : mshtml: Added PluginHost's IAdviseSinkEx stub implementation.
Alexandre Julliard
julliard at winehq.org
Mon Dec 6 13:18:34 CST 2010
Module: wine
Branch: master
Commit: 546f4bf5e3c87690a2638efa916f3f542d74c106
URL: http://source.winehq.org/git/wine.git/?a=commit;h=546f4bf5e3c87690a2638efa916f3f542d74c106
Author: Jacek Caban <jacek at codeweavers.com>
Date: Mon Dec 6 18:49:16 2010 +0100
mshtml: Added PluginHost's IAdviseSinkEx stub implementation.
---
dlls/mshtml/pluginhost.c | 80 ++++++++++++++++++++++++++++++++++++++++++-
dlls/mshtml/pluginhost.h | 1 +
dlls/mshtml/tests/activex.c | 19 ++++++++++-
3 files changed, 98 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/pluginhost.c b/dlls/mshtml/pluginhost.c
index 5b04399..1111071 100644
--- a/dlls/mshtml/pluginhost.c
+++ b/dlls/mshtml/pluginhost.c
@@ -63,7 +63,7 @@ static void activate_plugin(PluginHost *host)
container.pClientSite = &host->IOleClientSite_iface;
container.dwAmbientFlags = QACONTAINER_SUPPORTSMNEMONICS|QACONTAINER_MESSAGEREFLECT|QACONTAINER_USERMODE;
- container.pAdviseSink = NULL; /* FIXME */
+ container.pAdviseSink = &host->IAdviseSinkEx_iface;
container.pPropertyNotifySink = NULL; /* FIXME */
hres = IQuickActivate_QuickActivate(quick_activate, &container, &control);
@@ -102,6 +102,12 @@ static HRESULT WINAPI PHClientSite_QueryInterface(IOleClientSite *iface, REFIID
}else if(IsEqualGUID(&IID_IOleClientSite, riid)) {
TRACE("(%p)->(IID_IOleClientSite %p)\n", This, ppv);
*ppv = &This->IOleClientSite_iface;
+ }else if(IsEqualGUID(&IID_IAdviseSink, riid)) {
+ TRACE("(%p)->(IID_IAdviseSink %p)\n", This, ppv);
+ *ppv = &This->IAdviseSinkEx_iface;
+ }else if(IsEqualGUID(&IID_IAdviseSinkEx, riid)) {
+ TRACE("(%p)->(IID_IAdviseSinkEx %p)\n", This, ppv);
+ *ppv = &This->IAdviseSinkEx_iface;
}else {
WARN("Unsupported interface %s\n", debugstr_guid(riid));
*ppv = NULL;
@@ -193,6 +199,77 @@ static const IOleClientSiteVtbl OleClientSiteVtbl = {
PHClientSite_RequestNewObjectLayout
};
+static inline PluginHost *impl_from_IAdviseSinkEx(IAdviseSinkEx *iface)
+{
+ return CONTAINING_RECORD(iface, PluginHost, IAdviseSinkEx_iface);
+}
+
+static HRESULT WINAPI PHAdviseSinkEx_QueryInterface(IAdviseSinkEx *iface, REFIID riid, void **ppv)
+{
+ PluginHost *This = impl_from_IAdviseSinkEx(iface);
+ return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
+}
+
+static ULONG WINAPI PHAdviseSinkEx_AddRef(IAdviseSinkEx *iface)
+{
+ PluginHost *This = impl_from_IAdviseSinkEx(iface);
+ return IOleClientSite_AddRef(&This->IOleClientSite_iface);
+}
+
+static ULONG WINAPI PHAdviseSinkEx_Release(IAdviseSinkEx *iface)
+{
+ PluginHost *This = impl_from_IAdviseSinkEx(iface);
+ return IOleClientSite_Release(&This->IOleClientSite_iface);
+}
+
+static void WINAPI PHAdviseSinkEx_OnDataChange(IAdviseSinkEx *iface, FORMATETC *pFormatetc, STGMEDIUM *pStgMedium)
+{
+ PluginHost *This = impl_from_IAdviseSinkEx(iface);
+ FIXME("(%p)->(%p %p)\n", This, pFormatetc, pStgMedium);
+}
+
+static void WINAPI PHAdviseSinkEx_OnViewChange(IAdviseSinkEx *iface, DWORD dwAspect, LONG lindex)
+{
+ PluginHost *This = impl_from_IAdviseSinkEx(iface);
+ FIXME("(%p)->(%d %d)\n", This, dwAspect, lindex);
+}
+
+static void WINAPI PHAdviseSinkEx_OnRename(IAdviseSinkEx *iface, IMoniker *pmk)
+{
+ PluginHost *This = impl_from_IAdviseSinkEx(iface);
+ FIXME("(%p)->(%p)\n", This, pmk);
+}
+
+static void WINAPI PHAdviseSinkEx_OnSave(IAdviseSinkEx *iface)
+{
+ PluginHost *This = impl_from_IAdviseSinkEx(iface);
+ FIXME("(%p)\n", This);
+}
+
+static void WINAPI PHAdviseSinkEx_OnClose(IAdviseSinkEx *iface)
+{
+ PluginHost *This = impl_from_IAdviseSinkEx(iface);
+ FIXME("(%p)\n", This);
+}
+
+static void WINAPI PHAdviseSinkEx_OnViewStatusChange(IAdviseSinkEx *iface, DWORD dwViewStatus)
+{
+ PluginHost *This = impl_from_IAdviseSinkEx(iface);
+ FIXME("(%p)->(%d)\n", This, dwViewStatus);
+}
+
+static const IAdviseSinkExVtbl AdviseSinkExVtbl = {
+ PHAdviseSinkEx_QueryInterface,
+ PHAdviseSinkEx_AddRef,
+ PHAdviseSinkEx_Release,
+ PHAdviseSinkEx_OnDataChange,
+ PHAdviseSinkEx_OnViewChange,
+ PHAdviseSinkEx_OnRename,
+ PHAdviseSinkEx_OnSave,
+ PHAdviseSinkEx_OnClose,
+ PHAdviseSinkEx_OnViewStatusChange
+};
+
HRESULT create_plugin_host(IUnknown *unk, PluginHost **ret)
{
PluginHost *host;
@@ -202,6 +279,7 @@ HRESULT create_plugin_host(IUnknown *unk, PluginHost **ret)
return E_OUTOFMEMORY;
host->IOleClientSite_iface.lpVtbl = &OleClientSiteVtbl;
+ host->IAdviseSinkEx_iface.lpVtbl = &AdviseSinkExVtbl;
host->ref = 1;
diff --git a/dlls/mshtml/pluginhost.h b/dlls/mshtml/pluginhost.h
index 5d53e08..91c6323 100644
--- a/dlls/mshtml/pluginhost.h
+++ b/dlls/mshtml/pluginhost.h
@@ -20,6 +20,7 @@ typedef struct HTMLObjectElement HTMLObjectElement;
typedef struct {
IOleClientSite IOleClientSite_iface;
+ IAdviseSinkEx IAdviseSinkEx_iface;
LONG ref;
diff --git a/dlls/mshtml/tests/activex.c b/dlls/mshtml/tests/activex.c
index dc3d903..384b738 100644
--- a/dlls/mshtml/tests/activex.c
+++ b/dlls/mshtml/tests/activex.c
@@ -87,6 +87,21 @@ static const char object_ax_str[] =
"</object>"
"</body></html>";
+static BOOL iface_cmp(IUnknown *iface1, IUnknown *iface2)
+{
+ IUnknown *unk1, *unk2;
+
+ if(iface1 == iface2)
+ return TRUE;
+
+ IUnknown_QueryInterface(iface1, &IID_IUnknown, (void**)&unk1);
+ IUnknown_Release(unk1);
+ IUnknown_QueryInterface(iface2, &IID_IUnknown, (void**)&unk2);
+ IUnknown_Release(unk2);
+
+ return unk1 == unk2;
+}
+
static HRESULT ax_qi(REFIID,void**);
static HRESULT WINAPI OleControl_QueryInterface(IOleControl *iface, REFIID riid, void **ppv)
@@ -165,7 +180,6 @@ static HRESULT WINAPI QuickActivate_QuickActivate(IQuickActivate *iface, QACONTA
ok(container != NULL, "container == NULL\n");
ok(container->cbSize == sizeof(*container), "container->cbSize = %d\n", container->cbSize);
ok(container->pClientSite != NULL, "container->pClientSite == NULL\n");
- todo_wine
ok(container->pAdviseSink != NULL, "container->pAdviseSink == NULL\n");
todo_wine
ok(container->pPropertyNotifySink != NULL, "container->pPropertyNotifySink == NULL\n");
@@ -193,6 +207,9 @@ static HRESULT WINAPI QuickActivate_QuickActivate(IQuickActivate *iface, QACONTA
ok(!control->dwPropNotifyCookie, "control->dwPropNotifyCookie = %x\n", control->dwPropNotifyCookie);
ok(!control->dwPointerActivationPolicy, "control->dwPointerActivationPolicy = %x\n", control->dwPointerActivationPolicy);
+ ok(iface_cmp((IUnknown*)container->pClientSite, (IUnknown*)container->pAdviseSink),
+ "container->pClientSite != container->pAdviseSink\n");
+
return S_OK;
}
More information about the wine-cvs
mailing list