Commit 0c5492aa authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

msxml3: Use ifaces instead of vtbl pointers in xmldoc.

parent 623abfca
...@@ -48,8 +48,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml); ...@@ -48,8 +48,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml);
typedef struct _xmldoc typedef struct _xmldoc
{ {
const IXMLDocumentVtbl *lpVtbl; IXMLDocument IXMLDocument_iface;
const IPersistStreamInitVtbl *lpvtblIPersistStreamInit; IPersistStreamInit IPersistStreamInit_iface;
LONG ref; LONG ref;
HRESULT error; HRESULT error;
...@@ -62,12 +62,12 @@ typedef struct _xmldoc ...@@ -62,12 +62,12 @@ typedef struct _xmldoc
static inline xmldoc *impl_from_IXMLDocument(IXMLDocument *iface) static inline xmldoc *impl_from_IXMLDocument(IXMLDocument *iface)
{ {
return (xmldoc *)((char*)iface - FIELD_OFFSET(xmldoc, lpVtbl)); return CONTAINING_RECORD(iface, xmldoc, IXMLDocument_iface);
} }
static inline xmldoc *impl_from_IPersistStreamInit(IPersistStreamInit *iface) static inline xmldoc *impl_from_IPersistStreamInit(IPersistStreamInit *iface)
{ {
return (xmldoc *)((char*)iface - FIELD_OFFSET(xmldoc, lpvtblIPersistStreamInit)); return CONTAINING_RECORD(iface, xmldoc, IPersistStreamInit_iface);
} }
static HRESULT WINAPI xmldoc_QueryInterface(IXMLDocument *iface, REFIID riid, void** ppvObject) static HRESULT WINAPI xmldoc_QueryInterface(IXMLDocument *iface, REFIID riid, void** ppvObject)
...@@ -85,7 +85,7 @@ static HRESULT WINAPI xmldoc_QueryInterface(IXMLDocument *iface, REFIID riid, vo ...@@ -85,7 +85,7 @@ static HRESULT WINAPI xmldoc_QueryInterface(IXMLDocument *iface, REFIID riid, vo
else if (IsEqualGUID(&IID_IPersistStreamInit, riid) || else if (IsEqualGUID(&IID_IPersistStreamInit, riid) ||
IsEqualGUID(&IID_IPersistStream, riid)) IsEqualGUID(&IID_IPersistStream, riid))
{ {
*ppvObject = &(This->lpvtblIPersistStreamInit); *ppvObject = &This->IPersistStreamInit_iface;
} }
else else
{ {
...@@ -186,8 +186,8 @@ static HRESULT WINAPI xmldoc_Invoke(IXMLDocument *iface, DISPID dispIdMember, ...@@ -186,8 +186,8 @@ static HRESULT WINAPI xmldoc_Invoke(IXMLDocument *iface, DISPID dispIdMember,
hr = get_typeinfo(IXMLDocument_tid, &typeinfo); hr = get_typeinfo(IXMLDocument_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{ {
hr = ITypeInfo_Invoke(typeinfo, &(This->lpVtbl), dispIdMember, wFlags, pDispParams, hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDocument_iface, dispIdMember, wFlags,
pVarResult, pExcepInfo, puArgErr); pDispParams, pVarResult, pExcepInfo, puArgErr);
ITypeInfo_Release(typeinfo); ITypeInfo_Release(typeinfo);
} }
...@@ -555,21 +555,21 @@ static HRESULT WINAPI xmldoc_IPersistStreamInit_QueryInterface( ...@@ -555,21 +555,21 @@ static HRESULT WINAPI xmldoc_IPersistStreamInit_QueryInterface(
IPersistStreamInit *iface, REFIID riid, LPVOID *ppvObj) IPersistStreamInit *iface, REFIID riid, LPVOID *ppvObj)
{ {
xmldoc *this = impl_from_IPersistStreamInit(iface); xmldoc *this = impl_from_IPersistStreamInit(iface);
return IXMLDocument_QueryInterface((IXMLDocument *)this, riid, ppvObj); return IXMLDocument_QueryInterface(&this->IXMLDocument_iface, riid, ppvObj);
} }
static ULONG WINAPI xmldoc_IPersistStreamInit_AddRef( static ULONG WINAPI xmldoc_IPersistStreamInit_AddRef(
IPersistStreamInit *iface) IPersistStreamInit *iface)
{ {
xmldoc *this = impl_from_IPersistStreamInit(iface); xmldoc *this = impl_from_IPersistStreamInit(iface);
return IXMLDocument_AddRef((IXMLDocument *)this); return IXMLDocument_AddRef(&this->IXMLDocument_iface);
} }
static ULONG WINAPI xmldoc_IPersistStreamInit_Release( static ULONG WINAPI xmldoc_IPersistStreamInit_Release(
IPersistStreamInit *iface) IPersistStreamInit *iface)
{ {
xmldoc *this = impl_from_IPersistStreamInit(iface); xmldoc *this = impl_from_IPersistStreamInit(iface);
return IXMLDocument_Release((IXMLDocument *)this); return IXMLDocument_Release(&this->IXMLDocument_iface);
} }
static HRESULT WINAPI xmldoc_IPersistStreamInit_GetClassID( static HRESULT WINAPI xmldoc_IPersistStreamInit_GetClassID(
...@@ -702,14 +702,14 @@ HRESULT XMLDocument_create(IUnknown *pUnkOuter, LPVOID *ppObj) ...@@ -702,14 +702,14 @@ HRESULT XMLDocument_create(IUnknown *pUnkOuter, LPVOID *ppObj)
if(!doc) if(!doc)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
doc->lpVtbl = &xmldoc_vtbl; doc->IXMLDocument_iface.lpVtbl = &xmldoc_vtbl;
doc->lpvtblIPersistStreamInit = &xmldoc_IPersistStreamInit_VTable; doc->IPersistStreamInit_iface.lpVtbl = &xmldoc_IPersistStreamInit_VTable;
doc->ref = 1; doc->ref = 1;
doc->error = S_OK; doc->error = S_OK;
doc->xmldoc = NULL; doc->xmldoc = NULL;
doc->stream = NULL; doc->stream = NULL;
*ppObj = &doc->lpVtbl; *ppObj = &doc->IXMLDocument_iface;
TRACE("returning iface %p\n", *ppObj); TRACE("returning iface %p\n", *ppObj);
return S_OK; return S_OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment