mshtml: Added IPersistHistory stub implementation.

This commit is contained in:
Jacek Caban 2009-04-15 19:58:05 +02:00 committed by Alexandre Julliard
parent dbfbce975d
commit 781b0873e6
4 changed files with 78 additions and 3 deletions

View File

@ -134,8 +134,8 @@ static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID
TRACE("(%p)->(IID_ISupportErrorInfo %p)\n", This, ppvObject);
*ppvObject = SUPPERRINFO(This);
}else if(IsEqualGUID(&IID_IPersistHistory, riid)) {
FIXME("(%p)->(IID_IPersistHistory currently not supported %p)\n", This, ppvObject);
*ppvObject = NULL;
TRACE("(%p)->(IID_IPersistHistory %p)\n", This, ppvObject);
*ppvObject = PERSISTHIST(This);
}else if(IsEqualGUID(&CLSID_CMarkup, riid)) {
FIXME("(%p)->(CLSID_CMarkup %p)\n", This, ppvObject);
return E_NOINTERFACE;

View File

@ -21,6 +21,7 @@
#include "mshtml.h"
#include "mshtmhst.h"
#include "hlink.h"
#include "perhist.h"
#include "dispex.h"
#include "wine/list.h"
@ -229,6 +230,7 @@ struct HTMLDocument {
const IHTMLDocument5Vtbl *lpHTMLDocument5Vtbl;
const IPersistMonikerVtbl *lpPersistMonikerVtbl;
const IPersistFileVtbl *lpPersistFileVtbl;
const IPersistHistoryVtbl *lpPersistHistoryVtbl;
const IMonikerPropVtbl *lpMonikerPropVtbl;
const IOleObjectVtbl *lpOleObjectVtbl;
const IOleDocumentVtbl *lpOleDocumentVtbl;
@ -442,6 +444,7 @@ typedef struct {
#define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl)
#define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
#define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
#define PERSISTHIST(x) ((IPersistHistory*) &(x)->lpPersistHistoryVtbl)
#define CUSTOMDOC(x) ((ICustomDoc*) &(x)->lpCustomDocVtbl)
#define NSWBCHROME(x) ((nsIWebBrowserChrome*) &(x)->lpWebBrowserChromeVtbl)

View File

@ -748,12 +748,84 @@ static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
PersistStreamInit_InitNew
};
/**********************************************************
* IPersistHistory implementation
*/
#define PERSISTHIST_THIS(iface) DEFINE_THIS(HTMLDocument, PersistHistory, iface)
static HRESULT WINAPI PersistHistory_QueryInterface(IPersistHistory *iface, REFIID riid, void **ppvObject)
{
HTMLDocument *This = PERSISTHIST_THIS(iface);
return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
}
static ULONG WINAPI PersistHistory_AddRef(IPersistHistory *iface)
{
HTMLDocument *This = PERSISTHIST_THIS(iface);
return IHTMLDocument2_AddRef(HTMLDOC(This));
}
static ULONG WINAPI PersistHistory_Release(IPersistHistory *iface)
{
HTMLDocument *This = PERSISTHIST_THIS(iface);
return IHTMLDocument2_Release(HTMLDOC(This));
}
static HRESULT WINAPI PersistHistory_GetClassID(IPersistHistory *iface, CLSID *pClassID)
{
HTMLDocument *This = PERSISTHIST_THIS(iface);
return IPersist_GetClassID(PERSIST(This), pClassID);
}
static HRESULT WINAPI PersistHistory_LoadHistory(IPersistHistory *iface, IStream *pStream, IBindCtx *pbc)
{
HTMLDocument *This = PERSISTHIST_THIS(iface);
FIXME("(%p)->(%p %p)\n", This, pStream, pbc);
return E_NOTIMPL;
}
static HRESULT WINAPI PersistHistory_SaveHistory(IPersistHistory *iface, IStream *pStream)
{
HTMLDocument *This = PERSISTHIST_THIS(iface);
FIXME("(%p)->(%p)\n", This, pStream);
return E_NOTIMPL;
}
static HRESULT WINAPI PersistHistory_SetPositionCookie(IPersistHistory *iface, DWORD dwPositioncookie)
{
HTMLDocument *This = PERSISTHIST_THIS(iface);
FIXME("(%p)->(%x)\n", This, dwPositioncookie);
return E_NOTIMPL;
}
static HRESULT WINAPI PersistHistory_GetPositionCookie(IPersistHistory *iface, DWORD *pdwPositioncookie)
{
HTMLDocument *This = PERSISTHIST_THIS(iface);
FIXME("(%p)->(%p)\n", This, pdwPositioncookie);
return E_NOTIMPL;
}
#undef PERSISTHIST_THIS
static const IPersistHistoryVtbl PersistHistoryVtbl = {
PersistHistory_QueryInterface,
PersistHistory_AddRef,
PersistHistory_Release,
PersistHistory_GetClassID,
PersistHistory_LoadHistory,
PersistHistory_SaveHistory,
PersistHistory_SetPositionCookie,
PersistHistory_GetPositionCookie
};
void HTMLDocument_Persist_Init(HTMLDocument *This)
{
This->lpPersistMonikerVtbl = &PersistMonikerVtbl;
This->lpPersistFileVtbl = &PersistFileVtbl;
This->lpMonikerPropVtbl = &MonikerPropVtbl;
This->lpPersistStreamInitVtbl = &PersistStreamInitVtbl;
This->lpPersistHistoryVtbl = &PersistHistoryVtbl;
This->bscallback = NULL;
This->mon = NULL;

View File

@ -4191,7 +4191,7 @@ static void test_IPersistHistory(void)
return;
hres = IUnknown_QueryInterface(unk, &IID_IPersistHistory, (void**)&phist);
todo_wine ok(hres == S_OK, "QueryInterface returned %08x, expected S_OK\n", hres);
ok(hres == S_OK, "QueryInterface returned %08x, expected S_OK\n", hres);
if(hres == S_OK)
IPersistHistory_Release(phist);