Chris Wulff : shdocvw: Add IPersistMemory interface stub.
Alexandre Julliard
julliard at winehq.org
Wed Oct 31 08:35:34 CDT 2007
Module: wine
Branch: master
Commit: 62e7be0ede4ec02021312921870249cdf984d6d5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=62e7be0ede4ec02021312921870249cdf984d6d5
Author: Chris Wulff <crwulff at rochester.rr.com>
Date: Wed Oct 31 00:06:58 2007 -0400
shdocvw: Add IPersistMemory interface stub.
---
dlls/shdocvw/persist.c | 84 +++++++++++++++++++++++++++++++++++++++++++-
dlls/shdocvw/shdocvw.h | 2 +
dlls/shdocvw/webbrowser.c | 3 ++
3 files changed, 87 insertions(+), 2 deletions(-)
diff --git a/dlls/shdocvw/persist.c b/dlls/shdocvw/persist.c
index b4fecbb..940dd16 100644
--- a/dlls/shdocvw/persist.c
+++ b/dlls/shdocvw/persist.c
@@ -92,8 +92,6 @@ static HRESULT WINAPI PersistStorage_SaveCompleted(IPersistStorage *iface, LPSTO
return E_NOTIMPL;
}
-#define PERSTORAGE_THIS(ifce) DEFINE_THIS(WebBrowser, PersistStorage, iface)
-
static const IPersistStorageVtbl PersistStorageVtbl =
{
PersistStorage_QueryInterface,
@@ -108,6 +106,87 @@ static const IPersistStorageVtbl PersistStorageVtbl =
};
/**********************************************************************
+ * Implement the IPersistMemory interface
+ */
+
+#define PERMEMORY_THIS(ifce) DEFINE_THIS(WebBrowser, PersistMemory, iface)
+
+static HRESULT WINAPI PersistMemory_QueryInterface(IPersistMemory *iface,
+ REFIID riid, LPVOID *ppobj)
+{
+ WebBrowser *This = PERMEMORY_THIS(iface);
+ return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppobj);
+}
+
+static ULONG WINAPI PersistMemory_AddRef(IPersistMemory *iface)
+{
+ WebBrowser *This = PERMEMORY_THIS(iface);
+ return IWebBrowser_AddRef(WEBBROWSER(This));
+}
+
+static ULONG WINAPI PersistMemory_Release(IPersistMemory *iface)
+{
+ WebBrowser *This = PERMEMORY_THIS(iface);
+ return IWebBrowser_Release(WEBBROWSER(This));
+}
+
+static HRESULT WINAPI PersistMemory_GetClassID(IPersistMemory *iface, CLSID *pClassID)
+{
+ WebBrowser *This = PERMEMORY_THIS(iface);
+ FIXME("(%p)->(%p)\n", This, pClassID);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI PersistMemory_IsDirty(IPersistMemory *iface)
+{
+ WebBrowser *This = PERMEMORY_THIS(iface);
+ FIXME("(%p)\n", This);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI PersistMemory_InitNew(IPersistMemory *iface)
+{
+ WebBrowser *This = PERMEMORY_THIS(iface);
+ FIXME("(%p)\n", This);
+ return S_OK;
+}
+
+static HRESULT WINAPI PersistMemory_Load(IPersistMemory *iface, LPVOID pMem, ULONG cbSize)
+{
+ WebBrowser *This = PERMEMORY_THIS(iface);
+ FIXME("(%p)->(%p %x)\n", This, pMem, cbSize);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI PersistMemory_Save(IPersistMemory *iface, LPVOID pMem,
+ BOOL fClearDirty, ULONG cbSize)
+{
+ WebBrowser *This = PERMEMORY_THIS(iface);
+ FIXME("(%p)->(%p %x %x)\n", This, pMem, fClearDirty, cbSize);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI PersistMemory_GetSizeMax(IPersistMemory *iface, ULONG *pCbSize)
+{
+ WebBrowser *This = PERMEMORY_THIS(iface);
+ FIXME("(%p)->(%p)\n", This, pCbSize);
+ return E_NOTIMPL;
+}
+
+static const IPersistMemoryVtbl PersistMemoryVtbl =
+{
+ PersistMemory_QueryInterface,
+ PersistMemory_AddRef,
+ PersistMemory_Release,
+ PersistMemory_GetClassID,
+ PersistMemory_IsDirty,
+ PersistMemory_Load,
+ PersistMemory_Save,
+ PersistMemory_GetSizeMax,
+ PersistMemory_InitNew
+};
+
+/**********************************************************************
* Implement the IPersistStreamInit interface
*/
@@ -192,5 +271,6 @@ static const IPersistStreamInitVtbl PersistStreamInitVtbl =
void WebBrowser_Persist_Init(WebBrowser *This)
{
This->lpPersistStorageVtbl = &PersistStorageVtbl;
+ This->lpPersistMemoryVtbl = &PersistMemoryVtbl;
This->lpPersistStreamInitVtbl = &PersistStreamInitVtbl;
}
diff --git a/dlls/shdocvw/shdocvw.h b/dlls/shdocvw/shdocvw.h
index 28637bf..db47b63 100644
--- a/dlls/shdocvw/shdocvw.h
+++ b/dlls/shdocvw/shdocvw.h
@@ -100,6 +100,7 @@ struct WebBrowser {
const IOleInPlaceObjectVtbl *lpOleInPlaceObjectVtbl;
const IOleControlVtbl *lpOleControlVtbl;
const IPersistStorageVtbl *lpPersistStorageVtbl;
+ const IPersistMemoryVtbl *lpPersistMemoryVtbl;
const IPersistStreamInitVtbl *lpPersistStreamInitVtbl;
const IProvideClassInfo2Vtbl *lpProvideClassInfoVtbl;
const IViewObject2Vtbl *lpViewObjectVtbl;
@@ -152,6 +153,7 @@ struct InternetExplorer {
#define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectVtbl)
#define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
#define PERSTORAGE(x) ((IPersistStorage*) &(x)->lpPersistStorageVtbl)
+#define PERMEMORY(x) ((IPersistMemory*) &(x)->lpPersistMemoryVtbl)
#define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
#define CLASSINFO(x) ((IProvideClassInfo2*) &(x)->lpProvideClassInfoVtbl)
#define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
diff --git a/dlls/shdocvw/webbrowser.c b/dlls/shdocvw/webbrowser.c
index c9af82f..49914f7 100644
--- a/dlls/shdocvw/webbrowser.c
+++ b/dlls/shdocvw/webbrowser.c
@@ -72,6 +72,9 @@ static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser2 *iface, REFIID riid
}else if(IsEqualGUID(&IID_IPersistStorage, riid)) {
TRACE("(%p)->(IID_IPersistStorage %p)\n", This, ppv);
*ppv = PERSTORAGE(This);
+ }else if(IsEqualGUID(&IID_IPersistMemory, riid)) {
+ TRACE("(%p)->(IID_IPersistStorage %p)\n", This, ppv);
+ *ppv = PERMEMORY(This);
}else if(IsEqualGUID (&IID_IPersistStreamInit, riid)) {
TRACE("(%p)->(IID_IPersistStreamInit %p)\n", This, ppv);
*ppv = PERSTRINIT(This);
More information about the wine-cvs
mailing list