shdocvw [2/3]: Add a stub implementation of the IRunnableObject interface

James Hawkins truiken at gmail.com
Fri Oct 6 20:14:00 CDT 2006


Hi,

Changelog:
* Add a stub implementation of the IRunnableObject interface.

 dlls/shdocvw/Makefile.in  |    1
 dlls/shdocvw/runnable.c   |   96 +++++++++++++++++++++++++++++++++++++++++++++
 dlls/shdocvw/shdocvw.h    |    3 +
 dlls/shdocvw/webbrowser.c |    5 +-
 4 files changed, 103 insertions(+), 2 deletions(-)

-- 
James Hawkins
-------------- next part --------------
diff --git a/dlls/shdocvw/Makefile.in b/dlls/shdocvw/Makefile.in
index 74d8e24..6f9cb94 100644
--- a/dlls/shdocvw/Makefile.in
+++ b/dlls/shdocvw/Makefile.in
@@ -22,6 +22,7 @@ C_SRCS = \
 	oleobject.c \
 	persist.c \
 	regsvr.c \
+	runnable.c \
 	shdocvw_main.c \
 	shlinstobj.c \
 	view.c \
diff --git a/dlls/shdocvw/runnable.c b/dlls/shdocvw/runnable.c
new file mode 100644
index 0000000..b2a4700
--- /dev/null
+++ b/dlls/shdocvw/runnable.c
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2006 James Hawkins
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "wine/debug.h"
+#include "shdocvw.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
+
+#define RUNNABLEOBJ_THIS(iface) DEFINE_THIS(WebBrowser, RunnableObject, iface)
+
+static HRESULT WINAPI RunnableObject_QueryInterface(IRunnableObject *iface, REFIID riid, void **ppv)
+{
+    WebBrowser *This = RUNNABLEOBJ_THIS(iface);
+    return IWebBrowser2_QueryInterface(WEBBROWSER(This), riid, ppv);
+}
+
+static ULONG WINAPI RunnableObject_AddRef(IRunnableObject *iface)
+{
+    WebBrowser *This = RUNNABLEOBJ_THIS(iface);
+    return IWebBrowser2_AddRef(WEBBROWSER(This));
+}
+
+static ULONG WINAPI RunnableObject_Release(IRunnableObject *iface)
+{
+    WebBrowser *This = RUNNABLEOBJ_THIS(iface);
+    return IWebBrowser2_Release(WEBBROWSER(This));
+}
+
+static HRESULT WINAPI RunnableObject_GetRunningClass(IRunnableObject *iface, LPCLSID lpClsid)
+{
+    WebBrowser *This = RUNNABLEOBJ_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, lpClsid);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI RunnableObject_Run(IRunnableObject *iface, LPBC lpbc)
+{
+    WebBrowser *This = RUNNABLEOBJ_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, lpbc);
+    return S_OK;
+}
+
+static BOOL WINAPI RunnableObject_IsRunning(IRunnableObject *iface)
+{
+    WebBrowser *This = RUNNABLEOBJ_THIS(iface);
+    FIXME("(%p)->()\n", This);
+    return FALSE;
+}
+
+static HRESULT WINAPI RunnableObject_LockRunning(IRunnableObject *iface,
+                                                 BOOL fLock, BOOL fLastUnlockCloses)
+{
+    WebBrowser *This = RUNNABLEOBJ_THIS(iface);
+    FIXME("(%p)->(%d, %d)\n", This, fLock, fLastUnlockCloses);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI RunnableObject_SetContainedObject(IRunnableObject *iface, BOOL fContained)
+{
+    WebBrowser *This = RUNNABLEOBJ_THIS(iface);
+    FIXME("(%p)->(%d)\n", This, fContained);
+    return S_OK;
+}
+
+static const IRunnableObjectVtbl RunnableObjectVtbl = {
+    RunnableObject_QueryInterface,
+    RunnableObject_AddRef,
+    RunnableObject_Release,
+    RunnableObject_GetRunningClass,
+    RunnableObject_Run,
+    RunnableObject_IsRunning,
+    RunnableObject_LockRunning,
+    RunnableObject_SetContainedObject
+};
+
+#undef RUNNABLEOBJ_THIS
+
+void WebBrowser_RunnableObject_Init(WebBrowser *This)
+{
+    This->lpRunnableObjectVtbl = &RunnableObjectVtbl;
+}
diff --git a/dlls/shdocvw/shdocvw.h b/dlls/shdocvw/shdocvw.h
index a022eb2..193fbfc 100644
--- a/dlls/shdocvw/shdocvw.h
+++ b/dlls/shdocvw/shdocvw.h
@@ -101,6 +101,7 @@ struct WebBrowser {
     const IOleInPlaceActiveObjectVtbl   *lpOleInPlaceActiveObjectVtbl;
     const IOleCommandTargetVtbl         *lpOleCommandTargetVtbl;
     const IHlinkFrameVtbl               *lpHlinkFrameVtbl;
+    const IRunnableObjectVtbl           *lpRunnableObjectVtbl;
 
     LONG ref;
 
@@ -157,6 +158,7 @@ #define VIEWOBJ2(x)     ((IViewObject2*)
 #define ACTIVEOBJ(x)    ((IOleInPlaceActiveObject*)     &(x)->lpOleInPlaceActiveObjectVtbl)
 #define OLECMD(x)       ((IOleCommandTarget*)           &(x)->lpOleCommandTargetVtbl)
 #define HLINKFRAME(x)   ((IHlinkFrame*)                 &(x)->lpHlinkFrameVtbl)
+#define RUNNABLEOBJ(x)  ((IRunnableObject*)             &(x)->lpRunnableObjectVtbl)
 
 #define CLIENTSITE(x)   ((IOleClientSite*)              &(x)->lpOleClientSiteVtbl)
 #define INPLACESITE(x)  ((IOleInPlaceSite*)             &(x)->lpOleInPlaceSiteVtbl)
@@ -173,6 +175,7 @@ void WebBrowser_ViewObject_Init(WebBrows
 void WebBrowser_Persist_Init(WebBrowser*);
 void WebBrowser_ClassInfo_Init(WebBrowser*);
 void WebBrowser_HlinkFrame_Init(WebBrowser*);
+void WebBrowser_RunnableObject_Init(WebBrowser*);
 
 void WebBrowser_OleObject_Destroy(WebBrowser*);
 
diff --git a/dlls/shdocvw/webbrowser.c b/dlls/shdocvw/webbrowser.c
index 20fb8bf..1953909 100644
--- a/dlls/shdocvw/webbrowser.c
+++ b/dlls/shdocvw/webbrowser.c
@@ -103,8 +103,8 @@ static HRESULT WINAPI WebBrowser_QueryIn
         TRACE("(%p)->(IID_IQuickActivate %p) returning NULL\n", This, ppv);
         return E_NOINTERFACE;
     }else if(IsEqualGUID(&IID_IRunnableObject, riid)) {
-        TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This, ppv);
-        return E_NOINTERFACE;
+        TRACE("(%p)->(IID_IRunnableObject %p)\n", This, ppv);
+        *ppv = RUNNABLEOBJ(This);
     }
 
     if(*ppv) {
@@ -966,6 +966,7 @@ static HRESULT WebBrowser_Create(INT ver
     WebBrowser_Persist_Init(ret);
     WebBrowser_ClassInfo_Init(ret);
     WebBrowser_HlinkFrame_Init(ret);
+    WebBrowser_RunnableObject_Init(ret);
 
     hres = IWebBrowser_QueryInterface(WEBBROWSER(ret), riid, ppv);
     if(SUCCEEDED(hres)) {
-- 
1.4.2.1


More information about the wine-patches mailing list