[Wine-devel] Add IPersistPropertyBag to HTMLDocument
Ivan Sinitsin
=?iso-8859-1?q?ivan_=CE=C1_etersoft=2Eru?=
Пн Июл 14 10:30:41 MSD 2008
Вторая версия патча, сделан после внесения измений в основной wine
--
Sinitsin Ivan
----------- следующая часть -----------
From 8614ee5c2d7b82773f0b9a59cd169ed0b270d852 Mon Sep 17 00:00:00 2001
From: Sinitsin Ivan <ivan на etersoft.ru>
Date: Wed, 2 Jul 2008 12:14:45 +0400
Subject: [PATCH] mshtml.dll:Add IPersistPropertyBag interface to HTMLDocument
---
dlls/mshtml/htmldoc.c | 2 +-
dlls/mshtml/mshtml_private.h | 2 +
dlls/mshtml/persist.c | 64 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 67 insertions(+), 1 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index b77d69e..86f379b 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -136,7 +136,7 @@ static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID
return E_NOINTERFACE;
}else if(IsEqualGUID(&IID_IPersistPropertyBag, riid)) {
TRACE("(%p)->(IID_IPersistPropertyBag %p) returning NULL\n", This, ppvObject);
- return E_NOINTERFACE;
+ *ppvObject = PERPROPBAG(This);
}else if(dispex_query_interface(&This->dispex, riid, ppvObject)) {
return *ppvObject ? S_OK : E_NOINTERFACE;
}
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index ef7868d..8dc3b8e 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -220,6 +220,7 @@ struct HTMLDocument {
const IPersistStreamInitVtbl *lpPersistStreamInitVtbl;
const ICustomDocVtbl *lpCustomDocVtbl;
const IDispatchExVtbl *lpIDispatchExVtbl;
+ const IPersistPropertyBagVtbl *lpPersistPropertyBagVtbl;
LONG ref;
@@ -430,6 +431,7 @@ typedef struct {
#define HTMLLOCATION(x) ((IHTMLLocation*) &(x)->lpHTMLLocationVtbl)
#define DISPATCHEX(x) ((IDispatchEx*) &(x)->lpIDispatchExVtbl)
+#define PERPROPBAG(x) ((IPersistPropertyBag*) &(x)->lpPersistPropertyBagVtbl)
#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)
diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c
index 78a5d6b..884bc67 100644
--- a/dlls/mshtml/persist.c
+++ b/dlls/mshtml/persist.c
@@ -745,12 +745,76 @@ static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
PersistStreamInit_InitNew
};
+#define PERPROPBAG_THIS(iface) DEFINE_THIS(HTMLDocument, PersistStreamInit, iface)
+
+static HRESULT WINAPI PersistPropertyBag_QueryInterface(IPersistPropertyBag *iface,
+ REFIID riid, void **ppv)
+{
+ HTMLDocument *This = PERPROPBAG_THIS(iface);
+ return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
+}
+
+static ULONG WINAPI PersistPropertyBag_AddRef(IPersistPropertyBag *iface)
+{
+ HTMLDocument *This = PERPROPBAG_THIS(iface);
+ return IHTMLDocument2_AddRef(HTMLDOC(This));
+}
+
+static ULONG WINAPI PersistPropertyBag_Release(IPersistPropertyBag *iface)
+{
+ HTMLDocument *This = PERPROPBAG_THIS(iface);
+ return IHTMLDocument2_Release(HTMLDOC(This));
+}
+
+static HRESULT WINAPI PersistPropertyBag_GetClassID(IPersistPropertyBag *iface, CLSID *pClassID)
+{
+ HTMLDocument *This = PERPROPBAG_THIS(iface);
+ return IPersist_GetClassID(PERSIST(This), pClassID);
+}
+
+static HRESULT WINAPI PersistPropertyBag_InitNew(IPersistPropertyBag *iface)
+{
+ HTMLDocument *This = PERPROPBAG_THIS(iface);
+ FIXME("(%p)\n", This);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI PersistPropertyBag_Load(IPersistPropertyBag *iface, IPropertyBag *pPropBag, IErrorLog *pErrorLog)
+{
+ HTMLDocument *This = PERPROPBAG_THIS(iface);
+
+ FIXME("(%p) not implemented\n", This);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI PersistPropertyBag_Save(IPersistPropertyBag *iface,IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
+{
+ HTMLDocument *This = PERPROPBAG_THIS(iface);
+
+ FIXME("(%p)->(%x) not implemented\n", This, fClearDirty);
+ return E_NOTIMPL;
+}
+
+#undef PERPROPBAG_THIS
+
+static const IPersistPropertyBagVtbl PersistPropertyBagVtbl = {
+ PersistPropertyBag_QueryInterface,
+ PersistPropertyBag_AddRef,
+ PersistPropertyBag_Release,
+ PersistPropertyBag_GetClassID,
+ PersistPropertyBag_InitNew,
+ PersistPropertyBag_Load,
+ PersistPropertyBag_Save
+};
+
+
void HTMLDocument_Persist_Init(HTMLDocument *This)
{
This->lpPersistMonikerVtbl = &PersistMonikerVtbl;
This->lpPersistFileVtbl = &PersistFileVtbl;
This->lpMonikerPropVtbl = &MonikerPropVtbl;
This->lpPersistStreamInitVtbl = &PersistStreamInitVtbl;
+ This->lpPersistPropertyBagVtbl = &PersistPropertyBagVtbl;
This->bscallback = NULL;
This->mon = NULL;
--
1.5.4.5.GIT
Подробная информация о списке рассылки Wine-devel