Jacek Caban : mshtml: Added PluginHost' s IServiceProvider stub implementation.

Alexandre Julliard julliard at winehq.org
Mon Dec 6 13:18:35 CST 2010


Module: wine
Branch: master
Commit: c12d9ff8d7f1209fb76b405113b278407de57337
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c12d9ff8d7f1209fb76b405113b278407de57337

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Dec  6 18:51:20 2010 +0100

mshtml: Added PluginHost's IServiceProvider stub implementation.

---

 dlls/mshtml/pluginhost.c    |   41 +++++++++++++++++++++++++++++++++++++++++
 dlls/mshtml/pluginhost.h    |    1 +
 dlls/mshtml/tests/activex.c |    1 +
 3 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/dlls/mshtml/pluginhost.c b/dlls/mshtml/pluginhost.c
index f652b82..e7f39d8 100644
--- a/dlls/mshtml/pluginhost.c
+++ b/dlls/mshtml/pluginhost.c
@@ -129,6 +129,9 @@ static HRESULT WINAPI PHClientSite_QueryInterface(IOleClientSite *iface, REFIID
     }else if(IsEqualGUID(&IID_IBindHost, riid)) {
         TRACE("(%p)->(IID_IBindHost %p)\n", This, ppv);
         *ppv = &This->IBindHost_iface;
+    }else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
+        TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv);
+        *ppv = &This->IServiceProvider_iface;
     }else {
         WARN("Unsupported interface %s\n", debugstr_guid(riid));
         *ppv = NULL;
@@ -691,6 +694,43 @@ static const IBindHostVtbl BindHostVtbl = {
     PHBindHost_MonikerBindToObject
 };
 
+static inline PluginHost *impl_from_IServiceProvider(IServiceProvider *iface)
+{
+    return CONTAINING_RECORD(iface, PluginHost, IServiceProvider_iface);
+}
+
+static HRESULT WINAPI PHServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
+{
+    PluginHost *This = impl_from_IServiceProvider(iface);
+    return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
+}
+
+static ULONG WINAPI PHServiceProvider_AddRef(IServiceProvider *iface)
+{
+    PluginHost *This = impl_from_IServiceProvider(iface);
+    return IOleClientSite_AddRef(&This->IOleClientSite_iface);
+}
+
+static ULONG WINAPI PHServiceProvider_Release(IServiceProvider *iface)
+{
+    PluginHost *This = impl_from_IServiceProvider(iface);
+    return IOleClientSite_Release(&This->IOleClientSite_iface);
+}
+
+static HRESULT WINAPI PHServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
+{
+    PluginHost *This = impl_from_IServiceProvider(iface);
+    FIXME("(%p)->(%s %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
+    return E_NOINTERFACE;
+}
+
+static const IServiceProviderVtbl ServiceProviderVtbl = {
+    PHServiceProvider_QueryInterface,
+    PHServiceProvider_AddRef,
+    PHServiceProvider_Release,
+    PHServiceProvider_QueryService
+};
+
 HRESULT create_plugin_host(IUnknown *unk, PluginHost **ret)
 {
     PluginHost *host;
@@ -706,6 +746,7 @@ HRESULT create_plugin_host(IUnknown *unk, PluginHost **ret)
     host->IOleInPlaceSiteEx_iface.lpVtbl   = &OleInPlaceSiteExVtbl;
     host->IOleControlSite_iface.lpVtbl     = &OleControlSiteVtbl;
     host->IBindHost_iface.lpVtbl           = &BindHostVtbl;
+    host->IServiceProvider_iface.lpVtbl    = &ServiceProviderVtbl;
 
     host->ref = 1;
 
diff --git a/dlls/mshtml/pluginhost.h b/dlls/mshtml/pluginhost.h
index 2e87ea3..2b66696 100644
--- a/dlls/mshtml/pluginhost.h
+++ b/dlls/mshtml/pluginhost.h
@@ -26,6 +26,7 @@ typedef struct {
     IOleInPlaceSiteEx    IOleInPlaceSiteEx_iface;
     IOleControlSite      IOleControlSite_iface;
     IBindHost            IBindHost_iface;
+    IServiceProvider     IServiceProvider_iface;
 
     LONG ref;
 
diff --git a/dlls/mshtml/tests/activex.c b/dlls/mshtml/tests/activex.c
index 51a6b84..9984ae0 100644
--- a/dlls/mshtml/tests/activex.c
+++ b/dlls/mshtml/tests/activex.c
@@ -98,6 +98,7 @@ static const REFIID pluginhost_iids[] = {
     &IID_IOleInPlaceSiteEx,
     &IID_IOleControlSite,
     &IID_IBindHost,
+    &IID_IServiceProvider,
     NULL
 };
 




More information about the wine-cvs mailing list