Commit 13e19978 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

msxml3: Standardize the COM usage in saxreader.c.

parent b3514b47
...@@ -47,8 +47,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml); ...@@ -47,8 +47,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml);
typedef struct _saxreader typedef struct _saxreader
{ {
const struct IVBSAXXMLReaderVtbl *lpVBSAXXMLReaderVtbl; IVBSAXXMLReader IVBSAXXMLReader_iface;
const struct ISAXXMLReaderVtbl *lpSAXXMLReaderVtbl; ISAXXMLReader ISAXXMLReader_iface;
LONG ref; LONG ref;
struct ISAXContentHandler *contentHandler; struct ISAXContentHandler *contentHandler;
struct IVBSAXContentHandler *vbcontentHandler; struct IVBSAXContentHandler *vbcontentHandler;
...@@ -64,8 +64,8 @@ typedef struct _saxreader ...@@ -64,8 +64,8 @@ typedef struct _saxreader
typedef struct _saxlocator typedef struct _saxlocator
{ {
const struct IVBSAXLocatorVtbl *lpVBSAXLocatorVtbl; IVBSAXLocator IVBSAXLocator_iface;
const struct ISAXLocatorVtbl *lpSAXLocatorVtbl; ISAXLocator ISAXLocator_iface;
LONG ref; LONG ref;
saxreader *saxreader; saxreader *saxreader;
HRESULT ret; HRESULT ret;
...@@ -85,8 +85,8 @@ typedef struct _saxlocator ...@@ -85,8 +85,8 @@ typedef struct _saxlocator
typedef struct _saxattributes typedef struct _saxattributes
{ {
const struct IVBSAXAttributesVtbl *lpVBSAXAttributesVtbl; IVBSAXAttributes IVBSAXAttributes_iface;
const struct ISAXAttributesVtbl *lpSAXAttributesVtbl; ISAXAttributes ISAXAttributes_iface;
LONG ref; LONG ref;
int nb_attributes; int nb_attributes;
BSTR *szLocalname; BSTR *szLocalname;
...@@ -97,32 +97,32 @@ typedef struct _saxattributes ...@@ -97,32 +97,32 @@ typedef struct _saxattributes
static inline saxreader *impl_from_IVBSAXXMLReader( IVBSAXXMLReader *iface ) static inline saxreader *impl_from_IVBSAXXMLReader( IVBSAXXMLReader *iface )
{ {
return (saxreader *)((char*)iface - FIELD_OFFSET(saxreader, lpVBSAXXMLReaderVtbl)); return CONTAINING_RECORD(iface, saxreader, IVBSAXXMLReader_iface);
} }
static inline saxreader *impl_from_ISAXXMLReader( ISAXXMLReader *iface ) static inline saxreader *impl_from_ISAXXMLReader( ISAXXMLReader *iface )
{ {
return (saxreader *)((char*)iface - FIELD_OFFSET(saxreader, lpSAXXMLReaderVtbl)); return CONTAINING_RECORD(iface, saxreader, ISAXXMLReader_iface);
} }
static inline saxlocator *impl_from_IVBSAXLocator( IVBSAXLocator *iface ) static inline saxlocator *impl_from_IVBSAXLocator( IVBSAXLocator *iface )
{ {
return (saxlocator *)((char*)iface - FIELD_OFFSET(saxlocator, lpVBSAXLocatorVtbl)); return CONTAINING_RECORD(iface, saxlocator, IVBSAXLocator_iface);
} }
static inline saxlocator *impl_from_ISAXLocator( ISAXLocator *iface ) static inline saxlocator *impl_from_ISAXLocator( ISAXLocator *iface )
{ {
return (saxlocator *)((char*)iface - FIELD_OFFSET(saxlocator, lpSAXLocatorVtbl)); return CONTAINING_RECORD(iface, saxlocator, ISAXLocator_iface);
} }
static inline saxattributes *impl_from_IVBSAXAttributes( IVBSAXAttributes *iface ) static inline saxattributes *impl_from_IVBSAXAttributes( IVBSAXAttributes *iface )
{ {
return (saxattributes *)((char*)iface - FIELD_OFFSET(saxattributes, lpVBSAXAttributesVtbl)); return CONTAINING_RECORD(iface, saxattributes, IVBSAXAttributes_iface);
} }
static inline saxattributes *impl_from_ISAXAttributes( ISAXAttributes *iface ) static inline saxattributes *impl_from_ISAXAttributes( ISAXAttributes *iface )
{ {
return (saxattributes *)((char*)iface - FIELD_OFFSET(saxattributes, lpSAXAttributesVtbl)); return CONTAINING_RECORD(iface, saxattributes, ISAXAttributes_iface);
} }
static inline BOOL has_content_handler(const saxlocator *locator) static inline BOOL has_content_handler(const saxlocator *locator)
...@@ -215,12 +215,12 @@ static void format_error_message_from_id(saxlocator *This, HRESULT hr) ...@@ -215,12 +215,12 @@ static void format_error_message_from_id(saxlocator *This, HRESULT hr)
{ {
BSTR bstrMsg = SysAllocString(msg); BSTR bstrMsg = SysAllocString(msg);
IVBSAXErrorHandler_fatalError(This->saxreader->vberrorHandler, IVBSAXErrorHandler_fatalError(This->saxreader->vberrorHandler,
(IVBSAXLocator*)&This->lpVBSAXLocatorVtbl, &bstrMsg, hr); &This->IVBSAXLocator_iface, &bstrMsg, hr);
SysFreeString(bstrMsg); SysFreeString(bstrMsg);
} }
else else
ISAXErrorHandler_fatalError(This->saxreader->errorHandler, ISAXErrorHandler_fatalError(This->saxreader->errorHandler,
(ISAXLocator*)&This->lpSAXLocatorVtbl, msg, hr); &This->ISAXLocator_iface, msg, hr);
} }
} }
...@@ -307,13 +307,13 @@ static HRESULT WINAPI ivbsaxattributes_QueryInterface( ...@@ -307,13 +307,13 @@ static HRESULT WINAPI ivbsaxattributes_QueryInterface(
static ULONG WINAPI ivbsaxattributes_AddRef(IVBSAXAttributes* iface) static ULONG WINAPI ivbsaxattributes_AddRef(IVBSAXAttributes* iface)
{ {
saxattributes *This = impl_from_IVBSAXAttributes(iface); saxattributes *This = impl_from_IVBSAXAttributes(iface);
return ISAXAttributes_AddRef((ISAXAttributes*)&This->lpSAXAttributesVtbl); return ISAXAttributes_AddRef(&This->ISAXAttributes_iface);
} }
static ULONG WINAPI ivbsaxattributes_Release(IVBSAXAttributes* iface) static ULONG WINAPI ivbsaxattributes_Release(IVBSAXAttributes* iface)
{ {
saxattributes *This = impl_from_IVBSAXAttributes(iface); saxattributes *This = impl_from_IVBSAXAttributes(iface);
return ISAXAttributes_Release((ISAXAttributes*)&This->lpSAXAttributesVtbl); return ISAXAttributes_Release(&This->ISAXAttributes_iface);
} }
/*** IDispatch methods ***/ /*** IDispatch methods ***/
...@@ -391,8 +391,8 @@ static HRESULT WINAPI ivbsaxattributes_Invoke( ...@@ -391,8 +391,8 @@ static HRESULT WINAPI ivbsaxattributes_Invoke(
hr = get_typeinfo(IVBSAXAttributes_tid, &typeinfo); hr = get_typeinfo(IVBSAXAttributes_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{ {
hr = ITypeInfo_Invoke(typeinfo, &(This->lpVBSAXAttributesVtbl), dispIdMember, wFlags, pDispParams, hr = ITypeInfo_Invoke(typeinfo, &This->IVBSAXAttributes_iface, dispIdMember, wFlags,
pVarResult, pExcepInfo, puArgErr); pDispParams, pVarResult, pExcepInfo, puArgErr);
ITypeInfo_Release(typeinfo); ITypeInfo_Release(typeinfo);
} }
...@@ -405,9 +405,7 @@ static HRESULT WINAPI ivbsaxattributes_get_length( ...@@ -405,9 +405,7 @@ static HRESULT WINAPI ivbsaxattributes_get_length(
int *nLength) int *nLength)
{ {
saxattributes *This = impl_from_IVBSAXAttributes( iface ); saxattributes *This = impl_from_IVBSAXAttributes( iface );
return ISAXAttributes_getLength( return ISAXAttributes_getLength(&This->ISAXAttributes_iface, nLength);
(ISAXAttributes*)&This->lpSAXAttributesVtbl,
nLength);
} }
static HRESULT WINAPI ivbsaxattributes_getURI( static HRESULT WINAPI ivbsaxattributes_getURI(
...@@ -417,9 +415,7 @@ static HRESULT WINAPI ivbsaxattributes_getURI( ...@@ -417,9 +415,7 @@ static HRESULT WINAPI ivbsaxattributes_getURI(
{ {
int len; int len;
saxattributes *This = impl_from_IVBSAXAttributes( iface ); saxattributes *This = impl_from_IVBSAXAttributes( iface );
return ISAXAttributes_getURI( return ISAXAttributes_getURI(&This->ISAXAttributes_iface, nIndex, (const WCHAR**)uri, &len);
(ISAXAttributes*)&This->lpSAXAttributesVtbl,
nIndex, (const WCHAR**)uri, &len);
} }
static HRESULT WINAPI ivbsaxattributes_getLocalName( static HRESULT WINAPI ivbsaxattributes_getLocalName(
...@@ -429,9 +425,8 @@ static HRESULT WINAPI ivbsaxattributes_getLocalName( ...@@ -429,9 +425,8 @@ static HRESULT WINAPI ivbsaxattributes_getLocalName(
{ {
int len; int len;
saxattributes *This = impl_from_IVBSAXAttributes( iface ); saxattributes *This = impl_from_IVBSAXAttributes( iface );
return ISAXAttributes_getLocalName( return ISAXAttributes_getLocalName(&This->ISAXAttributes_iface, nIndex,
(ISAXAttributes*)&This->lpSAXAttributesVtbl, (const WCHAR**)localName, &len);
nIndex, (const WCHAR**)localName, &len);
} }
static HRESULT WINAPI ivbsaxattributes_getQName( static HRESULT WINAPI ivbsaxattributes_getQName(
...@@ -441,9 +436,7 @@ static HRESULT WINAPI ivbsaxattributes_getQName( ...@@ -441,9 +436,7 @@ static HRESULT WINAPI ivbsaxattributes_getQName(
{ {
int len; int len;
saxattributes *This = impl_from_IVBSAXAttributes( iface ); saxattributes *This = impl_from_IVBSAXAttributes( iface );
return ISAXAttributes_getQName( return ISAXAttributes_getQName(&This->ISAXAttributes_iface, nIndex, (const WCHAR**)QName, &len);
(ISAXAttributes*)&This->lpSAXAttributesVtbl,
nIndex, (const WCHAR**)QName, &len);
} }
static HRESULT WINAPI ivbsaxattributes_getIndexFromName( static HRESULT WINAPI ivbsaxattributes_getIndexFromName(
...@@ -453,8 +446,7 @@ static HRESULT WINAPI ivbsaxattributes_getIndexFromName( ...@@ -453,8 +446,7 @@ static HRESULT WINAPI ivbsaxattributes_getIndexFromName(
int *index) int *index)
{ {
saxattributes *This = impl_from_IVBSAXAttributes( iface ); saxattributes *This = impl_from_IVBSAXAttributes( iface );
return ISAXAttributes_getIndexFromName( return ISAXAttributes_getIndexFromName(&This->ISAXAttributes_iface, uri, SysStringLen(uri),
(ISAXAttributes*)&This->lpSAXAttributesVtbl, uri, SysStringLen(uri),
localName, SysStringLen(localName), index); localName, SysStringLen(localName), index);
} }
...@@ -464,8 +456,7 @@ static HRESULT WINAPI ivbsaxattributes_getIndexFromQName( ...@@ -464,8 +456,7 @@ static HRESULT WINAPI ivbsaxattributes_getIndexFromQName(
int *index) int *index)
{ {
saxattributes *This = impl_from_IVBSAXAttributes( iface ); saxattributes *This = impl_from_IVBSAXAttributes( iface );
return ISAXAttributes_getIndexFromQName( return ISAXAttributes_getIndexFromQName(&This->ISAXAttributes_iface, QName,
(ISAXAttributes*)&This->lpSAXAttributesVtbl, QName,
SysStringLen(QName), index); SysStringLen(QName), index);
} }
...@@ -476,9 +467,7 @@ static HRESULT WINAPI ivbsaxattributes_getType( ...@@ -476,9 +467,7 @@ static HRESULT WINAPI ivbsaxattributes_getType(
{ {
int len; int len;
saxattributes *This = impl_from_IVBSAXAttributes( iface ); saxattributes *This = impl_from_IVBSAXAttributes( iface );
return ISAXAttributes_getType( return ISAXAttributes_getType(&This->ISAXAttributes_iface, nIndex, (const WCHAR**)type, &len);
(ISAXAttributes*)&This->lpSAXAttributesVtbl,
nIndex, (const WCHAR**)type, &len);
} }
static HRESULT WINAPI ivbsaxattributes_getTypeFromName( static HRESULT WINAPI ivbsaxattributes_getTypeFromName(
...@@ -489,8 +478,7 @@ static HRESULT WINAPI ivbsaxattributes_getTypeFromName( ...@@ -489,8 +478,7 @@ static HRESULT WINAPI ivbsaxattributes_getTypeFromName(
{ {
int len; int len;
saxattributes *This = impl_from_IVBSAXAttributes( iface ); saxattributes *This = impl_from_IVBSAXAttributes( iface );
return ISAXAttributes_getTypeFromName( return ISAXAttributes_getTypeFromName(&This->ISAXAttributes_iface, uri, SysStringLen(uri),
(ISAXAttributes*)&This->lpSAXAttributesVtbl, uri, SysStringLen(uri),
localName, SysStringLen(localName), (const WCHAR**)type, &len); localName, SysStringLen(localName), (const WCHAR**)type, &len);
} }
...@@ -501,9 +489,8 @@ static HRESULT WINAPI ivbsaxattributes_getTypeFromQName( ...@@ -501,9 +489,8 @@ static HRESULT WINAPI ivbsaxattributes_getTypeFromQName(
{ {
int len; int len;
saxattributes *This = impl_from_IVBSAXAttributes( iface ); saxattributes *This = impl_from_IVBSAXAttributes( iface );
return ISAXAttributes_getTypeFromQName( return ISAXAttributes_getTypeFromQName(&This->ISAXAttributes_iface, QName, SysStringLen(QName),
(ISAXAttributes*)&This->lpSAXAttributesVtbl, QName, (const WCHAR**)type, &len);
SysStringLen(QName), (const WCHAR**)type, &len);
} }
static HRESULT WINAPI ivbsaxattributes_getValue( static HRESULT WINAPI ivbsaxattributes_getValue(
...@@ -513,9 +500,7 @@ static HRESULT WINAPI ivbsaxattributes_getValue( ...@@ -513,9 +500,7 @@ static HRESULT WINAPI ivbsaxattributes_getValue(
{ {
int len; int len;
saxattributes *This = impl_from_IVBSAXAttributes( iface ); saxattributes *This = impl_from_IVBSAXAttributes( iface );
return ISAXAttributes_getValue( return ISAXAttributes_getValue(&This->ISAXAttributes_iface, nIndex, (const WCHAR**)value, &len);
(ISAXAttributes*)&This->lpSAXAttributesVtbl,
nIndex, (const WCHAR**)value, &len);
} }
static HRESULT WINAPI ivbsaxattributes_getValueFromName( static HRESULT WINAPI ivbsaxattributes_getValueFromName(
...@@ -526,8 +511,7 @@ static HRESULT WINAPI ivbsaxattributes_getValueFromName( ...@@ -526,8 +511,7 @@ static HRESULT WINAPI ivbsaxattributes_getValueFromName(
{ {
int len; int len;
saxattributes *This = impl_from_IVBSAXAttributes( iface ); saxattributes *This = impl_from_IVBSAXAttributes( iface );
return ISAXAttributes_getValueFromName( return ISAXAttributes_getValueFromName(&This->ISAXAttributes_iface, uri, SysStringLen(uri),
(ISAXAttributes*)&This->lpSAXAttributesVtbl, uri, SysStringLen(uri),
localName, SysStringLen(localName), (const WCHAR**)value, &len); localName, SysStringLen(localName), (const WCHAR**)value, &len);
} }
...@@ -538,8 +522,7 @@ static HRESULT WINAPI ivbsaxattributes_getValueFromQName( ...@@ -538,8 +522,7 @@ static HRESULT WINAPI ivbsaxattributes_getValueFromQName(
{ {
int len; int len;
saxattributes *This = impl_from_IVBSAXAttributes( iface ); saxattributes *This = impl_from_IVBSAXAttributes( iface );
return ISAXAttributes_getValueFromQName( return ISAXAttributes_getValueFromQName(&This->ISAXAttributes_iface, QName,
(ISAXAttributes*)&This->lpSAXAttributesVtbl, QName,
SysStringLen(QName), (const WCHAR**)value, &len); SysStringLen(QName), (const WCHAR**)value, &len);
} }
...@@ -915,8 +898,8 @@ static HRESULT SAXAttributes_create(saxattributes **attr, ...@@ -915,8 +898,8 @@ static HRESULT SAXAttributes_create(saxattributes **attr,
if(!attributes) if(!attributes)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
attributes->lpVBSAXAttributesVtbl = &ivbsaxattributes_vtbl; attributes->IVBSAXAttributes_iface.lpVtbl = &ivbsaxattributes_vtbl;
attributes->lpSAXAttributesVtbl = &isaxattributes_vtbl; attributes->ISAXAttributes_iface.lpVtbl = &isaxattributes_vtbl;
attributes->ref = 1; attributes->ref = 1;
attributes->nb_attributes = nb_namespaces+nb_attributes; attributes->nb_attributes = nb_namespaces+nb_attributes;
...@@ -1065,19 +1048,14 @@ static void libxmlStartElementNS( ...@@ -1065,19 +1048,14 @@ static void libxmlStartElementNS(
if(hr == S_OK) if(hr == S_OK)
{ {
if(This->vbInterface) if(This->vbInterface)
hr = IVBSAXContentHandler_startElement( hr = IVBSAXContentHandler_startElement(This->saxreader->vbcontentHandler,
This->saxreader->vbcontentHandler, &NamespaceUri, &LocalName, &QName, &attr->IVBSAXAttributes_iface);
&NamespaceUri, &LocalName, &QName,
(IVBSAXAttributes*)&attr->lpVBSAXAttributesVtbl);
else else
hr = ISAXContentHandler_startElement( hr = ISAXContentHandler_startElement(This->saxreader->contentHandler, NamespaceUri,
This->saxreader->contentHandler, SysStringLen(NamespaceUri), LocalName, SysStringLen(LocalName), QName,
NamespaceUri, SysStringLen(NamespaceUri), SysStringLen(QName), &attr->ISAXAttributes_iface);
LocalName, SysStringLen(LocalName),
QName, SysStringLen(QName),
(ISAXAttributes*)&attr->lpSAXAttributesVtbl);
ISAXAttributes_Release((ISAXAttributes*)&attr->lpSAXAttributesVtbl); ISAXAttributes_Release(&attr->ISAXAttributes_iface);
} }
SysFreeString(NamespaceUri); SysFreeString(NamespaceUri);
...@@ -1244,13 +1222,11 @@ static void libxmlSetDocumentLocator( ...@@ -1244,13 +1222,11 @@ static void libxmlSetDocumentLocator(
if(has_content_handler(This)) if(has_content_handler(This))
{ {
if(This->vbInterface) if(This->vbInterface)
hr = IVBSAXContentHandler_putref_documentLocator( hr = IVBSAXContentHandler_putref_documentLocator(This->saxreader->vbcontentHandler,
This->saxreader->vbcontentHandler, &This->IVBSAXLocator_iface);
(IVBSAXLocator*)&This->lpVBSAXLocatorVtbl);
else else
hr = ISAXContentHandler_putDocumentLocator( hr = ISAXContentHandler_putDocumentLocator(This->saxreader->contentHandler,
This->saxreader->contentHandler, &This->ISAXLocator_iface);
(ISAXLocator*)&This->lpSAXLocatorVtbl);
} }
if(FAILED(hr)) if(FAILED(hr))
...@@ -1322,13 +1298,13 @@ static void libxmlFatalError(void *ctx, const char *msg, ...) ...@@ -1322,13 +1298,13 @@ static void libxmlFatalError(void *ctx, const char *msg, ...)
if(This->vbInterface) if(This->vbInterface)
{ {
BSTR bstrError = SysAllocString(error); BSTR bstrError = SysAllocString(error);
IVBSAXErrorHandler_fatalError(This->saxreader->vberrorHandler, IVBSAXErrorHandler_fatalError(This->saxreader->vberrorHandler, &This->IVBSAXLocator_iface,
(IVBSAXLocator*)&This->lpVBSAXLocatorVtbl, &bstrError, E_FAIL); &bstrError, E_FAIL);
SysFreeString(bstrError); SysFreeString(bstrError);
} }
else else
ISAXErrorHandler_fatalError(This->saxreader->errorHandler, ISAXErrorHandler_fatalError(This->saxreader->errorHandler, &This->ISAXLocator_iface,
(ISAXLocator*)&This->lpSAXLocatorVtbl, error, E_FAIL); error, E_FAIL);
heap_free(error); heap_free(error);
...@@ -1453,7 +1429,7 @@ static ULONG WINAPI ivbsaxlocator_Release( ...@@ -1453,7 +1429,7 @@ static ULONG WINAPI ivbsaxlocator_Release(
IVBSAXLocator* iface) IVBSAXLocator* iface)
{ {
saxlocator *This = impl_from_IVBSAXLocator( iface ); saxlocator *This = impl_from_IVBSAXLocator( iface );
return ISAXLocator_Release((ISAXLocator*)&This->lpVBSAXLocatorVtbl); return ISAXLocator_Release((ISAXLocator*)&This->IVBSAXLocator_iface);
} }
/*** IDispatch methods ***/ /*** IDispatch methods ***/
...@@ -1531,8 +1507,8 @@ static HRESULT WINAPI ivbsaxlocator_Invoke( ...@@ -1531,8 +1507,8 @@ static HRESULT WINAPI ivbsaxlocator_Invoke(
hr = get_typeinfo(IVBSAXLocator_tid, &typeinfo); hr = get_typeinfo(IVBSAXLocator_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{ {
hr = ITypeInfo_Invoke(typeinfo, &(This->lpVBSAXLocatorVtbl), dispIdMember, wFlags, pDispParams, hr = ITypeInfo_Invoke(typeinfo, &This->IVBSAXLocator_iface, dispIdMember, wFlags,
pVarResult, pExcepInfo, puArgErr); pDispParams, pVarResult, pExcepInfo, puArgErr);
ITypeInfo_Release(typeinfo); ITypeInfo_Release(typeinfo);
} }
...@@ -1545,9 +1521,7 @@ static HRESULT WINAPI ivbsaxlocator_get_columnNumber( ...@@ -1545,9 +1521,7 @@ static HRESULT WINAPI ivbsaxlocator_get_columnNumber(
int *pnColumn) int *pnColumn)
{ {
saxlocator *This = impl_from_IVBSAXLocator( iface ); saxlocator *This = impl_from_IVBSAXLocator( iface );
return ISAXLocator_getColumnNumber( return ISAXLocator_getColumnNumber((ISAXLocator*)&This->IVBSAXLocator_iface, pnColumn);
(ISAXLocator*)&This->lpVBSAXLocatorVtbl,
pnColumn);
} }
static HRESULT WINAPI ivbsaxlocator_get_lineNumber( static HRESULT WINAPI ivbsaxlocator_get_lineNumber(
...@@ -1555,9 +1529,7 @@ static HRESULT WINAPI ivbsaxlocator_get_lineNumber( ...@@ -1555,9 +1529,7 @@ static HRESULT WINAPI ivbsaxlocator_get_lineNumber(
int *pnLine) int *pnLine)
{ {
saxlocator *This = impl_from_IVBSAXLocator( iface ); saxlocator *This = impl_from_IVBSAXLocator( iface );
return ISAXLocator_getLineNumber( return ISAXLocator_getLineNumber((ISAXLocator*)&This->IVBSAXLocator_iface, pnLine);
(ISAXLocator*)&This->lpVBSAXLocatorVtbl,
pnLine);
} }
static HRESULT WINAPI ivbsaxlocator_get_publicId( static HRESULT WINAPI ivbsaxlocator_get_publicId(
...@@ -1565,8 +1537,7 @@ static HRESULT WINAPI ivbsaxlocator_get_publicId( ...@@ -1565,8 +1537,7 @@ static HRESULT WINAPI ivbsaxlocator_get_publicId(
BSTR* publicId) BSTR* publicId)
{ {
saxlocator *This = impl_from_IVBSAXLocator( iface ); saxlocator *This = impl_from_IVBSAXLocator( iface );
return ISAXLocator_getPublicId( return ISAXLocator_getPublicId((ISAXLocator*)&This->IVBSAXLocator_iface,
(ISAXLocator*)&This->lpVBSAXLocatorVtbl,
(const WCHAR**)publicId); (const WCHAR**)publicId);
} }
...@@ -1575,8 +1546,7 @@ static HRESULT WINAPI ivbsaxlocator_get_systemId( ...@@ -1575,8 +1546,7 @@ static HRESULT WINAPI ivbsaxlocator_get_systemId(
BSTR* systemId) BSTR* systemId)
{ {
saxlocator *This = impl_from_IVBSAXLocator( iface ); saxlocator *This = impl_from_IVBSAXLocator( iface );
return ISAXLocator_getSystemId( return ISAXLocator_getSystemId((ISAXLocator*)&This->IVBSAXLocator_iface,
(ISAXLocator*)&This->lpVBSAXLocatorVtbl,
(const WCHAR**)systemId); (const WCHAR**)systemId);
} }
...@@ -1643,7 +1613,7 @@ static ULONG WINAPI isaxlocator_Release( ...@@ -1643,7 +1613,7 @@ static ULONG WINAPI isaxlocator_Release(
SysFreeString(This->systemId); SysFreeString(This->systemId);
heap_free(This->nsStack); heap_free(This->nsStack);
ISAXXMLReader_Release((ISAXXMLReader*)&This->saxreader->lpSAXXMLReaderVtbl); ISAXXMLReader_Release(&This->saxreader->ISAXXMLReader_iface);
heap_free( This ); heap_free( This );
} }
...@@ -1734,13 +1704,13 @@ static HRESULT SAXLocator_create(saxreader *reader, saxlocator **ppsaxlocator, B ...@@ -1734,13 +1704,13 @@ static HRESULT SAXLocator_create(saxreader *reader, saxlocator **ppsaxlocator, B
if( !locator ) if( !locator )
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
locator->lpVBSAXLocatorVtbl = &ivbsaxlocator_vtbl; locator->IVBSAXLocator_iface.lpVtbl = &ivbsaxlocator_vtbl;
locator->lpSAXLocatorVtbl = &isaxlocator_vtbl; locator->ISAXLocator_iface.lpVtbl = &isaxlocator_vtbl;
locator->ref = 1; locator->ref = 1;
locator->vbInterface = vbInterface; locator->vbInterface = vbInterface;
locator->saxreader = reader; locator->saxreader = reader;
ISAXXMLReader_AddRef((ISAXXMLReader*)&reader->lpSAXXMLReaderVtbl); ISAXXMLReader_AddRef(&reader->ISAXXMLReader_iface);
locator->pParserCtxt = NULL; locator->pParserCtxt = NULL;
locator->publicId = NULL; locator->publicId = NULL;
...@@ -1754,7 +1724,7 @@ static HRESULT SAXLocator_create(saxreader *reader, saxlocator **ppsaxlocator, B ...@@ -1754,7 +1724,7 @@ static HRESULT SAXLocator_create(saxreader *reader, saxlocator **ppsaxlocator, B
locator->nsStack = heap_alloc(sizeof(int)*locator->nsStackSize); locator->nsStack = heap_alloc(sizeof(int)*locator->nsStackSize);
if(!locator->nsStack) if(!locator->nsStack)
{ {
ISAXXMLReader_Release((ISAXXMLReader*)&reader->lpSAXXMLReaderVtbl); ISAXXMLReader_Release(&reader->ISAXXMLReader_iface);
heap_free(locator); heap_free(locator);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
...@@ -1797,7 +1767,7 @@ static HRESULT internal_parseBuffer(saxreader *This, const char *buffer, int siz ...@@ -1797,7 +1767,7 @@ static HRESULT internal_parseBuffer(saxreader *This, const char *buffer, int siz
locator->pParserCtxt = xmlCreateMemoryParserCtxt(buffer, size); locator->pParserCtxt = xmlCreateMemoryParserCtxt(buffer, size);
if(!locator->pParserCtxt) if(!locator->pParserCtxt)
{ {
ISAXLocator_Release((ISAXLocator*)&locator->lpSAXLocatorVtbl); ISAXLocator_Release(&locator->ISAXLocator_iface);
return E_FAIL; return E_FAIL;
} }
...@@ -1820,7 +1790,7 @@ static HRESULT internal_parseBuffer(saxreader *This, const char *buffer, int siz ...@@ -1820,7 +1790,7 @@ static HRESULT internal_parseBuffer(saxreader *This, const char *buffer, int siz
locator->pParserCtxt = NULL; locator->pParserCtxt = NULL;
} }
ISAXLocator_Release((ISAXLocator*)&locator->lpSAXLocatorVtbl); ISAXLocator_Release(&locator->ISAXLocator_iface);
return hr; return hr;
} }
...@@ -1844,7 +1814,7 @@ static HRESULT internal_parseStream(saxreader *This, IStream *stream, BOOL vbInt ...@@ -1844,7 +1814,7 @@ static HRESULT internal_parseStream(saxreader *This, IStream *stream, BOOL vbInt
data, dataRead, NULL); data, dataRead, NULL);
if(!locator->pParserCtxt) if(!locator->pParserCtxt)
{ {
ISAXLocator_Release((ISAXLocator*)&locator->lpSAXLocatorVtbl); ISAXLocator_Release(&locator->ISAXLocator_iface);
return E_FAIL; return E_FAIL;
} }
...@@ -1872,7 +1842,7 @@ static HRESULT internal_parseStream(saxreader *This, IStream *stream, BOOL vbInt ...@@ -1872,7 +1842,7 @@ static HRESULT internal_parseStream(saxreader *This, IStream *stream, BOOL vbInt
xmlFreeParserCtxt(locator->pParserCtxt); xmlFreeParserCtxt(locator->pParserCtxt);
locator->pParserCtxt = NULL; locator->pParserCtxt = NULL;
ISAXLocator_Release((ISAXLocator*)&locator->lpSAXLocatorVtbl); ISAXLocator_Release(&locator->ISAXLocator_iface);
return hr; return hr;
} }
...@@ -2292,7 +2262,7 @@ static HRESULT WINAPI saxxmlreader_QueryInterface(IVBSAXXMLReader* iface, REFIID ...@@ -2292,7 +2262,7 @@ static HRESULT WINAPI saxxmlreader_QueryInterface(IVBSAXXMLReader* iface, REFIID
} }
else if( IsEqualGUID( riid, &IID_ISAXXMLReader )) else if( IsEqualGUID( riid, &IID_ISAXXMLReader ))
{ {
*ppvObject = &This->lpSAXXMLReaderVtbl; *ppvObject = &This->ISAXXMLReader_iface;
} }
else else
{ {
...@@ -2427,8 +2397,8 @@ static HRESULT WINAPI saxxmlreader_Invoke( ...@@ -2427,8 +2397,8 @@ static HRESULT WINAPI saxxmlreader_Invoke(
hr = get_typeinfo(IVBSAXXMLReader_tid, &typeinfo); hr = get_typeinfo(IVBSAXXMLReader_tid, &typeinfo);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{ {
hr = ITypeInfo_Invoke(typeinfo, &(This->lpVBSAXXMLReaderVtbl), dispIdMember, wFlags, pDispParams, hr = ITypeInfo_Invoke(typeinfo, &This->IVBSAXXMLReader_iface, dispIdMember, wFlags,
pVarResult, pExcepInfo, puArgErr); pDispParams, pVarResult, pExcepInfo, puArgErr);
ITypeInfo_Release(typeinfo); ITypeInfo_Release(typeinfo);
} }
...@@ -2633,19 +2603,19 @@ static const struct IVBSAXXMLReaderVtbl saxreader_vtbl = ...@@ -2633,19 +2603,19 @@ static const struct IVBSAXXMLReaderVtbl saxreader_vtbl =
static HRESULT WINAPI isaxxmlreader_QueryInterface(ISAXXMLReader* iface, REFIID riid, void **ppvObject) static HRESULT WINAPI isaxxmlreader_QueryInterface(ISAXXMLReader* iface, REFIID riid, void **ppvObject)
{ {
saxreader *This = impl_from_ISAXXMLReader( iface ); saxreader *This = impl_from_ISAXXMLReader( iface );
return saxxmlreader_QueryInterface((IVBSAXXMLReader*)&This->lpVBSAXXMLReaderVtbl, riid, ppvObject); return saxxmlreader_QueryInterface(&This->IVBSAXXMLReader_iface, riid, ppvObject);
} }
static ULONG WINAPI isaxxmlreader_AddRef(ISAXXMLReader* iface) static ULONG WINAPI isaxxmlreader_AddRef(ISAXXMLReader* iface)
{ {
saxreader *This = impl_from_ISAXXMLReader( iface ); saxreader *This = impl_from_ISAXXMLReader( iface );
return saxxmlreader_AddRef((IVBSAXXMLReader*)&This->lpVBSAXXMLReaderVtbl); return saxxmlreader_AddRef(&This->IVBSAXXMLReader_iface);
} }
static ULONG WINAPI isaxxmlreader_Release(ISAXXMLReader* iface) static ULONG WINAPI isaxxmlreader_Release(ISAXXMLReader* iface)
{ {
saxreader *This = impl_from_ISAXXMLReader( iface ); saxreader *This = impl_from_ISAXXMLReader( iface );
return saxxmlreader_Release((IVBSAXXMLReader*)&This->lpVBSAXXMLReaderVtbl); return saxxmlreader_Release(&This->IVBSAXXMLReader_iface);
} }
/*** ISAXXMLReader methods ***/ /*** ISAXXMLReader methods ***/
...@@ -2655,9 +2625,7 @@ static HRESULT WINAPI isaxxmlreader_getFeature( ...@@ -2655,9 +2625,7 @@ static HRESULT WINAPI isaxxmlreader_getFeature(
VARIANT_BOOL *pValue) VARIANT_BOOL *pValue)
{ {
saxreader *This = impl_from_ISAXXMLReader( iface ); saxreader *This = impl_from_ISAXXMLReader( iface );
return IVBSAXXMLReader_getFeature( return IVBSAXXMLReader_getFeature(&This->IVBSAXXMLReader_iface, pFeature, pValue);
(IVBSAXXMLReader*)&This->lpVBSAXXMLReaderVtbl,
pFeature, pValue);
} }
static HRESULT WINAPI isaxxmlreader_putFeature( static HRESULT WINAPI isaxxmlreader_putFeature(
...@@ -2666,9 +2634,7 @@ static HRESULT WINAPI isaxxmlreader_putFeature( ...@@ -2666,9 +2634,7 @@ static HRESULT WINAPI isaxxmlreader_putFeature(
VARIANT_BOOL vfValue) VARIANT_BOOL vfValue)
{ {
saxreader *This = impl_from_ISAXXMLReader( iface ); saxreader *This = impl_from_ISAXXMLReader( iface );
return IVBSAXXMLReader_putFeature( return IVBSAXXMLReader_putFeature(&This->IVBSAXXMLReader_iface, pFeature, vfValue);
(IVBSAXXMLReader*)&This->lpVBSAXXMLReaderVtbl,
pFeature, vfValue);
} }
static HRESULT WINAPI isaxxmlreader_getProperty( static HRESULT WINAPI isaxxmlreader_getProperty(
...@@ -2677,9 +2643,7 @@ static HRESULT WINAPI isaxxmlreader_getProperty( ...@@ -2677,9 +2643,7 @@ static HRESULT WINAPI isaxxmlreader_getProperty(
VARIANT *pValue) VARIANT *pValue)
{ {
saxreader *This = impl_from_ISAXXMLReader( iface ); saxreader *This = impl_from_ISAXXMLReader( iface );
return IVBSAXXMLReader_getProperty( return IVBSAXXMLReader_getProperty(&This->IVBSAXXMLReader_iface, pProp, pValue);
(IVBSAXXMLReader*)&This->lpVBSAXXMLReaderVtbl,
pProp, pValue);
} }
static HRESULT WINAPI isaxxmlreader_putProperty( static HRESULT WINAPI isaxxmlreader_putProperty(
...@@ -2760,9 +2724,7 @@ static HRESULT WINAPI isaxxmlreader_getBaseURL( ...@@ -2760,9 +2724,7 @@ static HRESULT WINAPI isaxxmlreader_getBaseURL(
const WCHAR **pBaseUrl) const WCHAR **pBaseUrl)
{ {
saxreader *This = impl_from_ISAXXMLReader( iface ); saxreader *This = impl_from_ISAXXMLReader( iface );
return IVBSAXXMLReader_get_baseURL( return IVBSAXXMLReader_get_baseURL(&This->IVBSAXXMLReader_iface, pBaseUrl);
(IVBSAXXMLReader*)&This->lpVBSAXXMLReaderVtbl,
pBaseUrl);
} }
static HRESULT WINAPI isaxxmlreader_putBaseURL( static HRESULT WINAPI isaxxmlreader_putBaseURL(
...@@ -2770,9 +2732,7 @@ static HRESULT WINAPI isaxxmlreader_putBaseURL( ...@@ -2770,9 +2732,7 @@ static HRESULT WINAPI isaxxmlreader_putBaseURL(
const WCHAR *pBaseUrl) const WCHAR *pBaseUrl)
{ {
saxreader *This = impl_from_ISAXXMLReader( iface ); saxreader *This = impl_from_ISAXXMLReader( iface );
return IVBSAXXMLReader_put_baseURL( return IVBSAXXMLReader_put_baseURL(&This->IVBSAXXMLReader_iface, pBaseUrl);
(IVBSAXXMLReader*)&This->lpVBSAXXMLReaderVtbl,
pBaseUrl);
} }
static HRESULT WINAPI isaxxmlreader_getSecureBaseURL( static HRESULT WINAPI isaxxmlreader_getSecureBaseURL(
...@@ -2780,9 +2740,7 @@ static HRESULT WINAPI isaxxmlreader_getSecureBaseURL( ...@@ -2780,9 +2740,7 @@ static HRESULT WINAPI isaxxmlreader_getSecureBaseURL(
const WCHAR **pSecureBaseUrl) const WCHAR **pSecureBaseUrl)
{ {
saxreader *This = impl_from_ISAXXMLReader( iface ); saxreader *This = impl_from_ISAXXMLReader( iface );
return IVBSAXXMLReader_get_secureBaseURL( return IVBSAXXMLReader_get_secureBaseURL(&This->IVBSAXXMLReader_iface, pSecureBaseUrl);
(IVBSAXXMLReader*)&This->lpVBSAXXMLReaderVtbl,
pSecureBaseUrl);
} }
static HRESULT WINAPI isaxxmlreader_putSecureBaseURL( static HRESULT WINAPI isaxxmlreader_putSecureBaseURL(
...@@ -2790,9 +2748,7 @@ static HRESULT WINAPI isaxxmlreader_putSecureBaseURL( ...@@ -2790,9 +2748,7 @@ static HRESULT WINAPI isaxxmlreader_putSecureBaseURL(
const WCHAR *secureBaseUrl) const WCHAR *secureBaseUrl)
{ {
saxreader *This = impl_from_ISAXXMLReader( iface ); saxreader *This = impl_from_ISAXXMLReader( iface );
return IVBSAXXMLReader_put_secureBaseURL( return IVBSAXXMLReader_put_secureBaseURL(&This->IVBSAXXMLReader_iface, secureBaseUrl);
(IVBSAXXMLReader*)&This->lpVBSAXXMLReaderVtbl,
secureBaseUrl);
} }
static HRESULT WINAPI isaxxmlreader_parse( static HRESULT WINAPI isaxxmlreader_parse(
...@@ -2846,8 +2802,8 @@ HRESULT SAXXMLReader_create(IUnknown *pUnkOuter, LPVOID *ppObj) ...@@ -2846,8 +2802,8 @@ HRESULT SAXXMLReader_create(IUnknown *pUnkOuter, LPVOID *ppObj)
if( !reader ) if( !reader )
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
reader->lpVBSAXXMLReaderVtbl = &saxreader_vtbl; reader->IVBSAXXMLReader_iface.lpVtbl = &saxreader_vtbl;
reader->lpSAXXMLReaderVtbl = &isaxreader_vtbl; reader->ISAXXMLReader_iface.lpVtbl = &isaxreader_vtbl;
reader->ref = 1; reader->ref = 1;
reader->contentHandler = NULL; reader->contentHandler = NULL;
reader->vbcontentHandler = NULL; reader->vbcontentHandler = NULL;
...@@ -2872,7 +2828,7 @@ HRESULT SAXXMLReader_create(IUnknown *pUnkOuter, LPVOID *ppObj) ...@@ -2872,7 +2828,7 @@ HRESULT SAXXMLReader_create(IUnknown *pUnkOuter, LPVOID *ppObj)
reader->sax.fatalError = libxmlFatalError; reader->sax.fatalError = libxmlFatalError;
reader->sax.cdataBlock = libxmlCDataBlock; reader->sax.cdataBlock = libxmlCDataBlock;
*ppObj = &reader->lpVBSAXXMLReaderVtbl; *ppObj = &reader->IVBSAXXMLReader_iface;
TRACE("returning iface %p\n", *ppObj); TRACE("returning iface %p\n", *ppObj);
......
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