[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Please, look at my patch, I'm not sure it's correct
From: Vitaly Perov <vitperov () etersoft ! ru>
Date: 2008-10-31 16:05:29
Message-ID: 200810311905.29316.vitperov () etersoft ! ru
[Download RAW message or body]
Hi,
This patch add a stub implementation of IMarshal interface.
I have no experience at implementing interfaces, so I'm not sure it's
implemented correctly.
Please, look at this patch. I'll be grateful for any remarks.
Thank you.
--
Best wishes,
Vitaly Perov
Russia, Saint-Petersburg. www.etersoft.ru
["0001-mshtml-Add-stub-implementation-of-IMarshal-interfac.patch" (text/x-diff)]
From b690702315a0365b12ac07664778ed084761ab11 Mon Sep 17 00:00:00 2001
From: Vitaly Perov <vitperov@etersoft.ru>
Date: Fri, 31 Oct 2008 13:30:38 +0300
Subject: [PATCH] mshtml: Add stub implementation of IMarshal interface
---
dlls/mshtml/Makefile.in | 1 +
dlls/mshtml/htmldoc.c | 4 +
dlls/mshtml/marshal.c | 139 ++++++++++++++++++++++++++++++++++++++++++
dlls/mshtml/mshtml_private.h | 4 +
4 files changed, 148 insertions(+), 0 deletions(-)
create mode 100644 dlls/mshtml/marshal.c
diff --git a/dlls/mshtml/Makefile.in b/dlls/mshtml/Makefile.in
index 016a75f..cd94c08 100644
--- a/dlls/mshtml/Makefile.in
+++ b/dlls/mshtml/Makefile.in
@@ -46,6 +46,7 @@ C_SRCS = \
install.c \
loadopts.c \
main.c \
+ marshal.c \
navigate.c \
nsembed.c \
nsevents.c \
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 7948714..401500a 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -143,6 +143,9 @@ static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID
*ppvObject = PERPROPBAG(This);
}else if(dispex_query_interface(&This->dispex, riid, ppvObject)) {
return *ppvObject ? S_OK : E_NOINTERFACE;
+ }else if(IsEqualGUID(&IID_IMarshal, riid)) {
+ FIXME("(%p)->(IID_IMarshal %p)\n", This, ppvObject);
+ *ppvObject = MARSHAL(This);
}
if(*ppvObject) {
@@ -1624,6 +1627,7 @@ static HRESULT alloc_doc(HTMLDocument **ret)
HTMLDocument_Window_Init(doc);
HTMLDocument_Service_Init(doc);
HTMLDocument_Hlink_Init(doc);
+ HTMLDocument_Marshal_Init(doc);
ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)HTMLDOC(doc));
ConnectionPoint_Init(&doc->cp_propnotif, &doc->cp_container, &IID_IPropertyNotifySink);
diff --git a/dlls/mshtml/marshal.c b/dlls/mshtml/marshal.c
new file mode 100644
index 0000000..dd0863c
--- /dev/null
+++ b/dlls/mshtml/marshal.c
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2008 Vitaly Perov
+ *
+ * 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 <stdarg.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "ole2.h"
+
+#include "wine/debug.h"
+#include "wine/unicode.h"
+
+#include "mshtml_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
+
+/**********************************************************
+ * IMarshal implementation
+ */
+
+#define MARSHAL_THIS(iface) DEFINE_THIS(HTMLDocument, Marshal, iface)
+
+static HRESULT WINAPI Marshal_QueryInterface(IMarshal *iface, REFIID riid, void **ppv)
+{
+ HTMLDocument *This = MARSHAL_THIS(iface);
+ return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
+}
+
+static ULONG WINAPI Marshal_AddRef(IMarshal *iface)
+{
+ HTMLDocument *This = MARSHAL_THIS(iface);
+ return IHTMLDocument2_AddRef(HTMLDOC(This));
+}
+
+static ULONG WINAPI Marshal_Release(IMarshal *iface)
+{
+ HTMLDocument *This = MARSHAL_THIS(iface);
+ return IHTMLDocument2_Release(HTMLDOC(This));
+}
+
+static HRESULT WINAPI Marshal_GetUnmarshalClass(
+ IMarshal* This,
+ REFIID riid,
+ void *pv,
+ DWORD dwDestContext,
+ void *pvDestContext,
+ DWORD mshlflags,
+ CLSID *pCid)
+{
+ FIXME("Not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Marshal_GetMarshalSizeMax(
+ IMarshal* This,
+ REFIID riid,
+ void *pv,
+ DWORD dwDestContext,
+ void *pvDestContext,
+ DWORD mshlflags,
+ DWORD *pSize)
+{
+ FIXME("Not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Marshal_MarshalInterface(
+ IMarshal* This,
+ IStream *pStm,
+ REFIID riid,
+ void *pv,
+ DWORD dwDestContext,
+ void *pvDestContext,
+ DWORD mshlflags)
+{
+ FIXME("Not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Marshal_UnmarshalInterface(
+ IMarshal* This,
+ IStream *pStm,
+ REFIID riid,
+ void **ppv)
+{
+ FIXME("Not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Marshal_ReleaseMarshalData(
+ IMarshal* This,
+ IStream *pStm)
+{
+ FIXME("Not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI Marshal_DisconnectObject(
+ IMarshal* This,
+ DWORD dwReserved)
+{
+ FIXME("Not implemented\n");
+ return E_NOTIMPL;
+}
+
+static const IMarshalVtbl MarshalVtbl = {
+ Marshal_QueryInterface,
+ Marshal_AddRef,
+ Marshal_Release,
+ Marshal_GetUnmarshalClass,
+ Marshal_GetMarshalSizeMax,
+ Marshal_MarshalInterface,
+ Marshal_UnmarshalInterface,
+ Marshal_ReleaseMarshalData,
+ Marshal_DisconnectObject
+};
+
+void HTMLDocument_Marshal_Init(HTMLDocument *This)
+{
+ This->lpMarshalVtbl = &MarshalVtbl;
+}
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index c9615ad..b84c971 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -238,6 +238,7 @@ struct HTMLDocument {
const IDispatchExVtbl *lpIDispatchExVtbl;
const IProvideClassInfoVtbl *lpInfoVtbl;
const IPersistPropertyBagVtbl *lpPersistPropertyBagVtbl;
+ const IMarshalVtbl *lpMarshalVtbl;
LONG ref;
@@ -460,6 +461,8 @@ typedef struct {
#define DISPATCHEX(x) ((IDispatchEx*) &(x)->lpIDispatchExVtbl)
#define PERPROPBAG(x) ((IPersistPropertyBag*) &(x)->lpPersistPropertyBagVtbl)
+#define MARSHAL(x) ((IMarshalVtbl*) &(x)->lpMarshalVtbl)
+
#define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
#define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
@@ -483,6 +486,7 @@ void HTMLDocument_View_Init(HTMLDocument*);
void HTMLDocument_Window_Init(HTMLDocument*);
void HTMLDocument_Service_Init(HTMLDocument*);
void HTMLDocument_Hlink_Init(HTMLDocument*);
+void HTMLDocument_Marshal_Init(HTMLDocument*);
HRESULT HTMLCurrentStyle_Create(HTMLElement*,IHTMLCurrentStyle**);
--
1.5.6.5.GIT
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic