mshtml: COM cleanup for the IPersist* ifaces in HTMLDocument.

This commit is contained in:
Michael Stefaniuc 2010-12-22 10:48:41 +01:00 committed by Alexandre Julliard
parent a31ba56b13
commit f0c55f59e3
4 changed files with 70 additions and 67 deletions

View File

@ -1731,13 +1731,13 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv)
*ppv = &This->IHTMLDocument6_iface; *ppv = &This->IHTMLDocument6_iface;
}else if(IsEqualGUID(&IID_IPersist, riid)) { }else if(IsEqualGUID(&IID_IPersist, riid)) {
TRACE("(%p)->(IID_IPersist, %p)\n", This, ppv); TRACE("(%p)->(IID_IPersist, %p)\n", This, ppv);
*ppv = PERSIST(This); *ppv = &This->IPersistFile_iface;
}else if(IsEqualGUID(&IID_IPersistMoniker, riid)) { }else if(IsEqualGUID(&IID_IPersistMoniker, riid)) {
TRACE("(%p)->(IID_IPersistMoniker, %p)\n", This, ppv); TRACE("(%p)->(IID_IPersistMoniker, %p)\n", This, ppv);
*ppv = PERSISTMON(This); *ppv = &This->IPersistMoniker_iface;
}else if(IsEqualGUID(&IID_IPersistFile, riid)) { }else if(IsEqualGUID(&IID_IPersistFile, riid)) {
TRACE("(%p)->(IID_IPersistFile, %p)\n", This, ppv); TRACE("(%p)->(IID_IPersistFile, %p)\n", This, ppv);
*ppv = PERSISTFILE(This); *ppv = &This->IPersistFile_iface;
}else if(IsEqualGUID(&IID_IMonikerProp, riid)) { }else if(IsEqualGUID(&IID_IMonikerProp, riid)) {
TRACE("(%p)->(IID_IMonikerProp, %p)\n", This, ppv); TRACE("(%p)->(IID_IMonikerProp, %p)\n", This, ppv);
*ppv = MONPROP(This); *ppv = MONPROP(This);
@ -1788,7 +1788,7 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv)
*ppv = CONPTCONT(&This->cp_container); *ppv = CONPTCONT(&This->cp_container);
}else if(IsEqualGUID(&IID_IPersistStreamInit, riid)) { }else if(IsEqualGUID(&IID_IPersistStreamInit, riid)) {
TRACE("(%p)->(IID_IPersistStreamInit %p)\n", This, ppv); TRACE("(%p)->(IID_IPersistStreamInit %p)\n", This, ppv);
*ppv = PERSTRINIT(This); *ppv = &This->IPersistStreamInit_iface;
}else if(IsEqualGUID(&DIID_DispHTMLDocument, riid)) { }else if(IsEqualGUID(&DIID_DispHTMLDocument, riid)) {
TRACE("(%p)->(DIID_DispHTMLDocument %p)\n", This, ppv); TRACE("(%p)->(DIID_DispHTMLDocument %p)\n", This, ppv);
*ppv = &This->IHTMLDocument2_iface; *ppv = &This->IHTMLDocument2_iface;
@ -1797,7 +1797,7 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv)
*ppv = SUPPERRINFO(This); *ppv = SUPPERRINFO(This);
}else if(IsEqualGUID(&IID_IPersistHistory, riid)) { }else if(IsEqualGUID(&IID_IPersistHistory, riid)) {
TRACE("(%p)->(IID_IPersistHistory %p)\n", This, ppv); TRACE("(%p)->(IID_IPersistHistory %p)\n", This, ppv);
*ppv = PERSISTHIST(This); *ppv = &This->IPersistHistory_iface;
}else if(IsEqualGUID(&CLSID_CMarkup, riid)) { }else if(IsEqualGUID(&CLSID_CMarkup, riid)) {
FIXME("(%p)->(CLSID_CMarkup %p)\n", This, ppv); FIXME("(%p)->(CLSID_CMarkup %p)\n", This, ppv);
*ppv = NULL; *ppv = NULL;

View File

@ -347,9 +347,9 @@ struct HTMLDocument {
IHTMLDocument4 IHTMLDocument4_iface; IHTMLDocument4 IHTMLDocument4_iface;
IHTMLDocument5 IHTMLDocument5_iface; IHTMLDocument5 IHTMLDocument5_iface;
IHTMLDocument6 IHTMLDocument6_iface; IHTMLDocument6 IHTMLDocument6_iface;
const IPersistMonikerVtbl *lpPersistMonikerVtbl; IPersistMoniker IPersistMoniker_iface;
const IPersistFileVtbl *lpPersistFileVtbl; IPersistFile IPersistFile_iface;
const IPersistHistoryVtbl *lpPersistHistoryVtbl; IPersistHistory IPersistHistory_iface;
const IMonikerPropVtbl *lpMonikerPropVtbl; const IMonikerPropVtbl *lpMonikerPropVtbl;
const IOleObjectVtbl *lpOleObjectVtbl; const IOleObjectVtbl *lpOleObjectVtbl;
const IOleDocumentVtbl *lpOleDocumentVtbl; const IOleDocumentVtbl *lpOleDocumentVtbl;
@ -361,7 +361,7 @@ struct HTMLDocument {
const IOleCommandTargetVtbl *lpOleCommandTargetVtbl; const IOleCommandTargetVtbl *lpOleCommandTargetVtbl;
const IOleControlVtbl *lpOleControlVtbl; const IOleControlVtbl *lpOleControlVtbl;
const IHlinkTargetVtbl *lpHlinkTargetVtbl; const IHlinkTargetVtbl *lpHlinkTargetVtbl;
const IPersistStreamInitVtbl *lpPersistStreamInitVtbl; IPersistStreamInit IPersistStreamInit_iface;
const IDispatchExVtbl *lpIDispatchExVtbl; const IDispatchExVtbl *lpIDispatchExVtbl;
const ISupportErrorInfoVtbl *lpSupportErrorInfoVtbl; const ISupportErrorInfoVtbl *lpSupportErrorInfoVtbl;
const IObjectWithSiteVtbl *lpObjectWithSiteVtbl; const IObjectWithSiteVtbl *lpObjectWithSiteVtbl;
@ -626,9 +626,6 @@ struct HTMLDocumentNode {
#define HTMLWINDOW3(x) ((IHTMLWindow3*) &(x)->lpHTMLWindow3Vtbl) #define HTMLWINDOW3(x) ((IHTMLWindow3*) &(x)->lpHTMLWindow3Vtbl)
#define HTMLWINDOW4(x) ((IHTMLWindow4*) &(x)->lpHTMLWindow4Vtbl) #define HTMLWINDOW4(x) ((IHTMLWindow4*) &(x)->lpHTMLWindow4Vtbl)
#define PERSIST(x) ((IPersist*) &(x)->lpPersistFileVtbl)
#define PERSISTMON(x) ((IPersistMoniker*) &(x)->lpPersistMonikerVtbl)
#define PERSISTFILE(x) ((IPersistFile*) &(x)->lpPersistFileVtbl)
#define MONPROP(x) ((IMonikerProp*) &(x)->lpMonikerPropVtbl) #define MONPROP(x) ((IMonikerProp*) &(x)->lpMonikerPropVtbl)
#define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl) #define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
#define OLEDOC(x) ((IOleDocument*) &(x)->lpOleDocumentVtbl) #define OLEDOC(x) ((IOleDocument*) &(x)->lpOleDocumentVtbl)
@ -645,8 +642,6 @@ struct HTMLDocumentNode {
#define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl) #define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
#define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl) #define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl)
#define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl) #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 CUSTOMDOC(x) ((ICustomDoc*) &(x)->lpCustomDocVtbl)
#define OBJSITE(x) ((IObjectWithSite*) &(x)->lpObjectWithSiteVtbl) #define OBJSITE(x) ((IObjectWithSite*) &(x)->lpObjectWithSiteVtbl)

View File

@ -604,7 +604,7 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
} }
} }
hres = IPersistMoniker_Load(PERSISTMON(This), TRUE, mon, NULL, 0); hres = IPersistMoniker_Load(&This->IPersistMoniker_iface, TRUE, mon, NULL, 0);
IMoniker_Release(mon); IMoniker_Release(mon);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;

View File

@ -339,45 +339,48 @@ static HRESULT get_doc_string(HTMLDocumentNode *This, char **str)
* IPersistMoniker implementation * IPersistMoniker implementation
*/ */
#define PERSISTMON_THIS(iface) DEFINE_THIS(HTMLDocument, PersistMoniker, iface) static inline HTMLDocument *impl_from_IPersistMoniker(IPersistMoniker *iface)
{
return CONTAINING_RECORD(iface, HTMLDocument, IPersistMoniker_iface);
}
static HRESULT WINAPI PersistMoniker_QueryInterface(IPersistMoniker *iface, REFIID riid, void **ppv) static HRESULT WINAPI PersistMoniker_QueryInterface(IPersistMoniker *iface, REFIID riid, void **ppv)
{ {
HTMLDocument *This = PERSISTMON_THIS(iface); HTMLDocument *This = impl_from_IPersistMoniker(iface);
return htmldoc_query_interface(This, riid, ppv); return htmldoc_query_interface(This, riid, ppv);
} }
static ULONG WINAPI PersistMoniker_AddRef(IPersistMoniker *iface) static ULONG WINAPI PersistMoniker_AddRef(IPersistMoniker *iface)
{ {
HTMLDocument *This = PERSISTMON_THIS(iface); HTMLDocument *This = impl_from_IPersistMoniker(iface);
return htmldoc_addref(This); return htmldoc_addref(This);
} }
static ULONG WINAPI PersistMoniker_Release(IPersistMoniker *iface) static ULONG WINAPI PersistMoniker_Release(IPersistMoniker *iface)
{ {
HTMLDocument *This = PERSISTMON_THIS(iface); HTMLDocument *This = impl_from_IPersistMoniker(iface);
return htmldoc_release(This); return htmldoc_release(This);
} }
static HRESULT WINAPI PersistMoniker_GetClassID(IPersistMoniker *iface, CLSID *pClassID) static HRESULT WINAPI PersistMoniker_GetClassID(IPersistMoniker *iface, CLSID *pClassID)
{ {
HTMLDocument *This = PERSISTMON_THIS(iface); HTMLDocument *This = impl_from_IPersistMoniker(iface);
return IPersist_GetClassID(PERSIST(This), pClassID); return IPersist_GetClassID(&This->IPersistFile_iface, pClassID);
} }
static HRESULT WINAPI PersistMoniker_IsDirty(IPersistMoniker *iface) static HRESULT WINAPI PersistMoniker_IsDirty(IPersistMoniker *iface)
{ {
HTMLDocument *This = PERSISTMON_THIS(iface); HTMLDocument *This = impl_from_IPersistMoniker(iface);
TRACE("(%p)\n", This); TRACE("(%p)\n", This);
return IPersistStreamInit_IsDirty(PERSTRINIT(This)); return IPersistStreamInit_IsDirty(&This->IPersistStreamInit_iface);
} }
static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAvailable, static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAvailable,
IMoniker *pimkName, LPBC pibc, DWORD grfMode) IMoniker *pimkName, LPBC pibc, DWORD grfMode)
{ {
HTMLDocument *This = PERSISTMON_THIS(iface); HTMLDocument *This = impl_from_IPersistMoniker(iface);
HRESULT hres; HRESULT hres;
TRACE("(%p)->(%x %p %p %08x)\n", This, fFullyAvailable, pimkName, pibc, grfMode); TRACE("(%p)->(%x %p %p %08x)\n", This, fFullyAvailable, pimkName, pibc, grfMode);
@ -421,21 +424,21 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva
static HRESULT WINAPI PersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName, static HRESULT WINAPI PersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName,
LPBC pbc, BOOL fRemember) LPBC pbc, BOOL fRemember)
{ {
HTMLDocument *This = PERSISTMON_THIS(iface); HTMLDocument *This = impl_from_IPersistMoniker(iface);
FIXME("(%p)->(%p %p %x)\n", This, pimkName, pbc, fRemember); FIXME("(%p)->(%p %p %x)\n", This, pimkName, pbc, fRemember);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI PersistMoniker_SaveCompleted(IPersistMoniker *iface, IMoniker *pimkName, LPBC pibc) static HRESULT WINAPI PersistMoniker_SaveCompleted(IPersistMoniker *iface, IMoniker *pimkName, LPBC pibc)
{ {
HTMLDocument *This = PERSISTMON_THIS(iface); HTMLDocument *This = impl_from_IPersistMoniker(iface);
FIXME("(%p)->(%p %p)\n", This, pimkName, pibc); FIXME("(%p)->(%p %p)\n", This, pimkName, pibc);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI PersistMoniker_GetCurMoniker(IPersistMoniker *iface, IMoniker **ppimkName) static HRESULT WINAPI PersistMoniker_GetCurMoniker(IPersistMoniker *iface, IMoniker **ppimkName)
{ {
HTMLDocument *This = PERSISTMON_THIS(iface); HTMLDocument *This = impl_from_IPersistMoniker(iface);
TRACE("(%p)->(%p)\n", This, ppimkName); TRACE("(%p)->(%p)\n", This, ppimkName);
@ -517,29 +520,32 @@ static const IMonikerPropVtbl MonikerPropVtbl = {
* IPersistFile implementation * IPersistFile implementation
*/ */
#define PERSISTFILE_THIS(iface) DEFINE_THIS(HTMLDocument, PersistFile, iface) static inline HTMLDocument *impl_from_IPersistFile(IPersistFile *iface)
{
return CONTAINING_RECORD(iface, HTMLDocument, IPersistFile_iface);
}
static HRESULT WINAPI PersistFile_QueryInterface(IPersistFile *iface, REFIID riid, void **ppv) static HRESULT WINAPI PersistFile_QueryInterface(IPersistFile *iface, REFIID riid, void **ppv)
{ {
HTMLDocument *This = PERSISTFILE_THIS(iface); HTMLDocument *This = impl_from_IPersistFile(iface);
return htmldoc_query_interface(This, riid, ppv); return htmldoc_query_interface(This, riid, ppv);
} }
static ULONG WINAPI PersistFile_AddRef(IPersistFile *iface) static ULONG WINAPI PersistFile_AddRef(IPersistFile *iface)
{ {
HTMLDocument *This = PERSISTFILE_THIS(iface); HTMLDocument *This = impl_from_IPersistFile(iface);
return htmldoc_addref(This); return htmldoc_addref(This);
} }
static ULONG WINAPI PersistFile_Release(IPersistFile *iface) static ULONG WINAPI PersistFile_Release(IPersistFile *iface)
{ {
HTMLDocument *This = PERSISTFILE_THIS(iface); HTMLDocument *This = impl_from_IPersistFile(iface);
return htmldoc_release(This); return htmldoc_release(This);
} }
static HRESULT WINAPI PersistFile_GetClassID(IPersistFile *iface, CLSID *pClassID) static HRESULT WINAPI PersistFile_GetClassID(IPersistFile *iface, CLSID *pClassID)
{ {
HTMLDocument *This = PERSISTFILE_THIS(iface); HTMLDocument *This = impl_from_IPersistFile(iface);
TRACE("(%p)->(%p)\n", This, pClassID); TRACE("(%p)->(%p)\n", This, pClassID);
@ -552,23 +558,23 @@ static HRESULT WINAPI PersistFile_GetClassID(IPersistFile *iface, CLSID *pClassI
static HRESULT WINAPI PersistFile_IsDirty(IPersistFile *iface) static HRESULT WINAPI PersistFile_IsDirty(IPersistFile *iface)
{ {
HTMLDocument *This = PERSISTFILE_THIS(iface); HTMLDocument *This = impl_from_IPersistFile(iface);
TRACE("(%p)\n", This); TRACE("(%p)\n", This);
return IPersistStreamInit_IsDirty(PERSTRINIT(This)); return IPersistStreamInit_IsDirty(&This->IPersistStreamInit_iface);
} }
static HRESULT WINAPI PersistFile_Load(IPersistFile *iface, LPCOLESTR pszFileName, DWORD dwMode) static HRESULT WINAPI PersistFile_Load(IPersistFile *iface, LPCOLESTR pszFileName, DWORD dwMode)
{ {
HTMLDocument *This = PERSISTFILE_THIS(iface); HTMLDocument *This = impl_from_IPersistFile(iface);
FIXME("(%p)->(%s %08x)\n", This, debugstr_w(pszFileName), dwMode); FIXME("(%p)->(%s %08x)\n", This, debugstr_w(pszFileName), dwMode);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI PersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileName, BOOL fRemember) static HRESULT WINAPI PersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileName, BOOL fRemember)
{ {
HTMLDocument *This = PERSISTFILE_THIS(iface); HTMLDocument *This = impl_from_IPersistFile(iface);
char *str; char *str;
DWORD written=0; DWORD written=0;
HANDLE file; HANDLE file;
@ -593,14 +599,14 @@ static HRESULT WINAPI PersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileNam
static HRESULT WINAPI PersistFile_SaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName) static HRESULT WINAPI PersistFile_SaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName)
{ {
HTMLDocument *This = PERSISTFILE_THIS(iface); HTMLDocument *This = impl_from_IPersistFile(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(pszFileName)); FIXME("(%p)->(%s)\n", This, debugstr_w(pszFileName));
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI PersistFile_GetCurFile(IPersistFile *iface, LPOLESTR *pszFileName) static HRESULT WINAPI PersistFile_GetCurFile(IPersistFile *iface, LPOLESTR *pszFileName)
{ {
HTMLDocument *This = PERSISTFILE_THIS(iface); HTMLDocument *This = impl_from_IPersistFile(iface);
FIXME("(%p)->(%p)\n", This, pszFileName); FIXME("(%p)->(%p)\n", This, pszFileName);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -617,36 +623,39 @@ static const IPersistFileVtbl PersistFileVtbl = {
PersistFile_GetCurFile PersistFile_GetCurFile
}; };
#define PERSTRINIT_THIS(iface) DEFINE_THIS(HTMLDocument, PersistStreamInit, iface) static inline HTMLDocument *impl_from_IPersistStreamInit(IPersistStreamInit *iface)
{
return CONTAINING_RECORD(iface, HTMLDocument, IPersistStreamInit_iface);
}
static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface, static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface,
REFIID riid, void **ppv) REFIID riid, void **ppv)
{ {
HTMLDocument *This = PERSTRINIT_THIS(iface); HTMLDocument *This = impl_from_IPersistStreamInit(iface);
return htmldoc_query_interface(This, riid, ppv); return htmldoc_query_interface(This, riid, ppv);
} }
static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface) static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
{ {
HTMLDocument *This = PERSTRINIT_THIS(iface); HTMLDocument *This = impl_from_IPersistStreamInit(iface);
return htmldoc_addref(This); return htmldoc_addref(This);
} }
static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface) static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
{ {
HTMLDocument *This = PERSTRINIT_THIS(iface); HTMLDocument *This = impl_from_IPersistStreamInit(iface);
return htmldoc_release(This); return htmldoc_release(This);
} }
static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID) static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID)
{ {
HTMLDocument *This = PERSTRINIT_THIS(iface); HTMLDocument *This = impl_from_IPersistStreamInit(iface);
return IPersist_GetClassID(PERSIST(This), pClassID); return IPersist_GetClassID(&This->IPersistFile_iface, pClassID);
} }
static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface) static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
{ {
HTMLDocument *This = PERSTRINIT_THIS(iface); HTMLDocument *This = impl_from_IPersistStreamInit(iface);
TRACE("(%p)\n", This); TRACE("(%p)\n", This);
@ -658,7 +667,7 @@ static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM pStm) static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM pStm)
{ {
HTMLDocument *This = PERSTRINIT_THIS(iface); HTMLDocument *This = impl_from_IPersistStreamInit(iface);
IMoniker *mon; IMoniker *mon;
HRESULT hres; HRESULT hres;
@ -683,7 +692,7 @@ static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM
static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStm, static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStm,
BOOL fClearDirty) BOOL fClearDirty)
{ {
HTMLDocument *This = PERSTRINIT_THIS(iface); HTMLDocument *This = impl_from_IPersistStreamInit(iface);
char *str; char *str;
DWORD written=0; DWORD written=0;
HRESULT hres; HRESULT hres;
@ -709,14 +718,14 @@ static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM
static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface, static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface,
ULARGE_INTEGER *pcbSize) ULARGE_INTEGER *pcbSize)
{ {
HTMLDocument *This = PERSTRINIT_THIS(iface); HTMLDocument *This = impl_from_IPersistStreamInit(iface);
FIXME("(%p)->(%p)\n", This, pcbSize); FIXME("(%p)->(%p)\n", This, pcbSize);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface) static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
{ {
HTMLDocument *This = PERSTRINIT_THIS(iface); HTMLDocument *This = impl_from_IPersistStreamInit(iface);
IMoniker *mon; IMoniker *mon;
HRESULT hres; HRESULT hres;
@ -738,8 +747,6 @@ static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
return channelbsc_load_stream(This->window->bscallback, NULL); return channelbsc_load_stream(This->window->bscallback, NULL);
} }
#undef PERSTRINIT_THIS
static const IPersistStreamInitVtbl PersistStreamInitVtbl = { static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
PersistStreamInit_QueryInterface, PersistStreamInit_QueryInterface,
PersistStreamInit_AddRef, PersistStreamInit_AddRef,
@ -756,62 +763,63 @@ static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
* IPersistHistory implementation * IPersistHistory implementation
*/ */
#define PERSISTHIST_THIS(iface) DEFINE_THIS(HTMLDocument, PersistHistory, iface) static inline HTMLDocument *impl_from_IPersistHistory(IPersistHistory *iface)
{
return CONTAINING_RECORD(iface, HTMLDocument, IPersistHistory_iface);
}
static HRESULT WINAPI PersistHistory_QueryInterface(IPersistHistory *iface, REFIID riid, void **ppv) static HRESULT WINAPI PersistHistory_QueryInterface(IPersistHistory *iface, REFIID riid, void **ppv)
{ {
HTMLDocument *This = PERSISTHIST_THIS(iface); HTMLDocument *This = impl_from_IPersistHistory(iface);
return htmldoc_query_interface(This, riid, ppv); return htmldoc_query_interface(This, riid, ppv);
} }
static ULONG WINAPI PersistHistory_AddRef(IPersistHistory *iface) static ULONG WINAPI PersistHistory_AddRef(IPersistHistory *iface)
{ {
HTMLDocument *This = PERSISTHIST_THIS(iface); HTMLDocument *This = impl_from_IPersistHistory(iface);
return htmldoc_addref(This); return htmldoc_addref(This);
} }
static ULONG WINAPI PersistHistory_Release(IPersistHistory *iface) static ULONG WINAPI PersistHistory_Release(IPersistHistory *iface)
{ {
HTMLDocument *This = PERSISTHIST_THIS(iface); HTMLDocument *This = impl_from_IPersistHistory(iface);
return htmldoc_release(This); return htmldoc_release(This);
} }
static HRESULT WINAPI PersistHistory_GetClassID(IPersistHistory *iface, CLSID *pClassID) static HRESULT WINAPI PersistHistory_GetClassID(IPersistHistory *iface, CLSID *pClassID)
{ {
HTMLDocument *This = PERSISTHIST_THIS(iface); HTMLDocument *This = impl_from_IPersistHistory(iface);
return IPersist_GetClassID(PERSIST(This), pClassID); return IPersist_GetClassID(&This->IPersistFile_iface, pClassID);
} }
static HRESULT WINAPI PersistHistory_LoadHistory(IPersistHistory *iface, IStream *pStream, IBindCtx *pbc) static HRESULT WINAPI PersistHistory_LoadHistory(IPersistHistory *iface, IStream *pStream, IBindCtx *pbc)
{ {
HTMLDocument *This = PERSISTHIST_THIS(iface); HTMLDocument *This = impl_from_IPersistHistory(iface);
FIXME("(%p)->(%p %p)\n", This, pStream, pbc); FIXME("(%p)->(%p %p)\n", This, pStream, pbc);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI PersistHistory_SaveHistory(IPersistHistory *iface, IStream *pStream) static HRESULT WINAPI PersistHistory_SaveHistory(IPersistHistory *iface, IStream *pStream)
{ {
HTMLDocument *This = PERSISTHIST_THIS(iface); HTMLDocument *This = impl_from_IPersistHistory(iface);
FIXME("(%p)->(%p)\n", This, pStream); FIXME("(%p)->(%p)\n", This, pStream);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI PersistHistory_SetPositionCookie(IPersistHistory *iface, DWORD dwPositioncookie) static HRESULT WINAPI PersistHistory_SetPositionCookie(IPersistHistory *iface, DWORD dwPositioncookie)
{ {
HTMLDocument *This = PERSISTHIST_THIS(iface); HTMLDocument *This = impl_from_IPersistHistory(iface);
FIXME("(%p)->(%x)\n", This, dwPositioncookie); FIXME("(%p)->(%x)\n", This, dwPositioncookie);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI PersistHistory_GetPositionCookie(IPersistHistory *iface, DWORD *pdwPositioncookie) static HRESULT WINAPI PersistHistory_GetPositionCookie(IPersistHistory *iface, DWORD *pdwPositioncookie)
{ {
HTMLDocument *This = PERSISTHIST_THIS(iface); HTMLDocument *This = impl_from_IPersistHistory(iface);
FIXME("(%p)->(%p)\n", This, pdwPositioncookie); FIXME("(%p)->(%p)\n", This, pdwPositioncookie);
return E_NOTIMPL; return E_NOTIMPL;
} }
#undef PERSISTHIST_THIS
static const IPersistHistoryVtbl PersistHistoryVtbl = { static const IPersistHistoryVtbl PersistHistoryVtbl = {
PersistHistory_QueryInterface, PersistHistory_QueryInterface,
PersistHistory_AddRef, PersistHistory_AddRef,
@ -825,9 +833,9 @@ static const IPersistHistoryVtbl PersistHistoryVtbl = {
void HTMLDocument_Persist_Init(HTMLDocument *This) void HTMLDocument_Persist_Init(HTMLDocument *This)
{ {
This->lpPersistMonikerVtbl = &PersistMonikerVtbl; This->IPersistMoniker_iface.lpVtbl = &PersistMonikerVtbl;
This->lpPersistFileVtbl = &PersistFileVtbl; This->IPersistFile_iface.lpVtbl = &PersistFileVtbl;
This->lpMonikerPropVtbl = &MonikerPropVtbl; This->lpMonikerPropVtbl = &MonikerPropVtbl;
This->lpPersistStreamInitVtbl = &PersistStreamInitVtbl; This->IPersistStreamInit_iface.lpVtbl = &PersistStreamInitVtbl;
This->lpPersistHistoryVtbl = &PersistHistoryVtbl; This->IPersistHistory_iface.lpVtbl = &PersistHistoryVtbl;
} }