ReactOS  0.4.15-dev-448-gd6c4411
saxreader.c File Reference
#include <stdio.h>
#include <assert.h>
#include "windows.h"
#include "ole2.h"
#include "msxml2.h"
#include "msxml2did.h"
#include "ocidl.h"
#include "dispex.h"
#include "wine/heap.h"
#include "wine/test.h"
Include dependency graph for saxreader.c:

Go to the source code of this file.

Classes

struct  msxmlsupported_data_t
 
struct  attribute_entry
 
struct  call_entry
 
struct  call_sequence
 
struct  saxlexicalhandler
 
struct  saxdeclhandler
 
struct  mxwriter_write_test_t
 
struct  mxwriter_stream_test_t
 
struct  saxreader_props_test_t
 
struct  feature_ns_entry_t
 
struct  enc_test_entry_t
 
struct  mxwriter_props_t
 
struct  writer_startendelement_t
 
struct  writer_startendelement2_t
 
struct  writer_characters_t
 
struct  addattribute_test_t
 

Macros

#define COBJMACROS
 
#define CONST_VTABLE
 
#define EXPECT_HR(hr, hr_exp)   ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
 
#define EXPECT_REF(obj, ref)   _expect_ref((IUnknown*)obj, ref, __LINE__)
 
#define CONTENT_HANDLER_INDEX   0
 
#define NUM_CALL_SEQUENCES   1
 
#define ok_sequence(seq, index, exp, contx, todo)   ok_sequence_(seq, index, (exp), (contx), (todo), __FILE__, __LINE__)
 

Typedefs

typedef enum _CH CH
 
typedef struct mxwriter_write_test_t mxwriter_write_test
 
typedef struct mxwriter_stream_test_t mxwriter_stream_test
 

Enumerations

enum  _CH {
  CH_ENDTEST, CH_PUTDOCUMENTLOCATOR, CH_STARTDOCUMENT, CH_ENDDOCUMENT,
  CH_STARTPREFIXMAPPING, CH_ENDPREFIXMAPPING, CH_STARTELEMENT, CH_ENDELEMENT,
  CH_CHARACTERS, CH_IGNORABLEWHITESPACE, CH_PROCESSINGINSTRUCTION, CH_SKIPPEDENTITY,
  LH_STARTCDATA, LH_ENDCDATA, EH_ERROR, EH_FATALERROR,
  EH_IGNORABLEWARNING, EVENT_LAST
}
 
enum  startendtype { StartElement = 0x001, EndElement = 0x010, StartEndElement = 0x011, DisableEscaping = 0x100 }
 

Functions

static void _expect_ref (IUnknown *obj, ULONG ref, int line)
 
static LONG get_refcount (void *iface)
 
static BOOL is_clsid_supported (const GUID *clsid, const struct msxmlsupported_data_t *table)
 
static BSTR alloc_str_from_narrow (const char *str)
 
static BSTR _bstr_ (const char *str)
 
static void free_bstrs (void)
 
static void test_saxstr (const char *file, unsigned line, BSTR str, const char *expected, BOOL todo, int *failcount)
 
static void init_call_entry (ISAXLocator *locator, struct call_entry *call)
 
static void add_call (struct call_sequence **seq, int sequence_index, const struct call_entry *call)
 
static void flush_sequence (struct call_sequence **seg, int sequence_index)
 
static const charget_event_name (CH event)
 
static void compare_attributes (const struct call_entry *actual, const struct call_entry *expected, const char *context, BOOL todo, const char *file, int line, int *failcount)
 
static void ok_sequence_ (struct call_sequence **seq, int sequence_index, const struct call_entry *expected, const char *context, BOOL todo, const char *file, int line)
 
static void init_call_sequences (struct call_sequence **seq, int n)
 
static void set_expected_seq (struct call_entry *expected)
 
static HRESULT get_expected_ret (void)
 
static HRESULT WINAPI contentHandler_QueryInterface (ISAXContentHandler *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI contentHandler_AddRef (ISAXContentHandler *iface)
 
static ULONG WINAPI contentHandler_Release (ISAXContentHandler *iface)
 
static HRESULT WINAPI contentHandler_putDocumentLocator (ISAXContentHandler *iface, ISAXLocator *pLocator)
 
static HRESULT WINAPI contentHandler_startDocument (ISAXContentHandler *iface)
 
static HRESULT WINAPI contentHandler_endDocument (ISAXContentHandler *iface)
 
static HRESULT WINAPI contentHandler_startPrefixMapping (ISAXContentHandler *iface, const WCHAR *prefix, int prefix_len, const WCHAR *uri, int uri_len)
 
static HRESULT WINAPI contentHandler_endPrefixMapping (ISAXContentHandler *iface, const WCHAR *prefix, int len)
 
static HRESULT WINAPI contentHandler_startElement (ISAXContentHandler *iface, const WCHAR *uri, int uri_len, const WCHAR *localname, int local_len, const WCHAR *qname, int qname_len, ISAXAttributes *saxattr)
 
static HRESULT WINAPI contentHandler_endElement (ISAXContentHandler *iface, const WCHAR *uri, int uri_len, const WCHAR *localname, int local_len, const WCHAR *qname, int qname_len)
 
static HRESULT WINAPI contentHandler_characters (ISAXContentHandler *iface, const WCHAR *chars, int len)
 
static HRESULT WINAPI contentHandler_ignorableWhitespace (ISAXContentHandler *iface, const WCHAR *chars, int len)
 
static HRESULT WINAPI contentHandler_processingInstruction (ISAXContentHandler *iface, const WCHAR *target, int target_len, const WCHAR *data, int data_len)
 
static HRESULT WINAPI contentHandler_skippedEntity (ISAXContentHandler *iface, const WCHAR *name, int len)
 
static HRESULT WINAPI isaxerrorHandler_QueryInterface (ISAXErrorHandler *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI isaxerrorHandler_AddRef (ISAXErrorHandler *iface)
 
static ULONG WINAPI isaxerrorHandler_Release (ISAXErrorHandler *iface)
 
static HRESULT WINAPI isaxerrorHandler_error (ISAXErrorHandler *iface, ISAXLocator *pLocator, const WCHAR *pErrorMessage, HRESULT hrErrorCode)
 
static HRESULT WINAPI isaxerrorHandler_fatalError (ISAXErrorHandler *iface, ISAXLocator *pLocator, const WCHAR *message, HRESULT hr)
 
static HRESULT WINAPI isaxerrorHandler_ignorableWarning (ISAXErrorHandler *iface, ISAXLocator *pLocator, const WCHAR *pErrorMessage, HRESULT hrErrorCode)
 
static HRESULT WINAPI isaxattributes_QueryInterface (ISAXAttributes *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI isaxattributes_AddRef (ISAXAttributes *iface)
 
static ULONG WINAPI isaxattributes_Release (ISAXAttributes *iface)
 
static HRESULT WINAPI isaxattributes_getLength (ISAXAttributes *iface, int *length)
 
static HRESULT WINAPI isaxattributes_getURI (ISAXAttributes *iface, int nIndex, const WCHAR **pUrl, int *pUriSize)
 
static HRESULT WINAPI isaxattributes_getLocalName (ISAXAttributes *iface, int nIndex, const WCHAR **pLocalName, int *pLocalNameLength)
 
static HRESULT WINAPI isaxattributes_getQName (ISAXAttributes *iface, int index, const WCHAR **QName, int *QNameLength)
 
static HRESULT WINAPI isaxattributes_getName (ISAXAttributes *iface, int nIndex, const WCHAR **pUri, int *pUriLength, const WCHAR **pLocalName, int *pLocalNameSize, const WCHAR **pQName, int *pQNameLength)
 
static HRESULT WINAPI isaxattributes_getIndexFromName (ISAXAttributes *iface, const WCHAR *pUri, int cUriLength, const WCHAR *pLocalName, int cocalNameLength, int *index)
 
static HRESULT WINAPI isaxattributes_getIndexFromQName (ISAXAttributes *iface, const WCHAR *pQName, int nQNameLength, int *index)
 
static HRESULT WINAPI isaxattributes_getType (ISAXAttributes *iface, int nIndex, const WCHAR **pType, int *pTypeLength)
 
static HRESULT WINAPI isaxattributes_getTypeFromName (ISAXAttributes *iface, const WCHAR *pUri, int nUri, const WCHAR *pLocalName, int nLocalName, const WCHAR **pType, int *nType)
 
static HRESULT WINAPI isaxattributes_getTypeFromQName (ISAXAttributes *iface, const WCHAR *pQName, int nQName, const WCHAR **pType, int *nType)
 
static HRESULT WINAPI isaxattributes_getValue (ISAXAttributes *iface, int index, const WCHAR **value, int *nValue)
 
static HRESULT WINAPI isaxattributes_getValueFromName (ISAXAttributes *iface, const WCHAR *pUri, int nUri, const WCHAR *pLocalName, int nLocalName, const WCHAR **pValue, int *nValue)
 
static HRESULT WINAPI isaxattributes_getValueFromQName (ISAXAttributes *iface, const WCHAR *pQName, int nQName, const WCHAR **pValue, int *nValue)
 
static struct saxlexicalhandlerimpl_from_ISAXLexicalHandler (ISAXLexicalHandler *iface)
 
static HRESULT WINAPI isaxlexical_QueryInterface (ISAXLexicalHandler *iface, REFIID riid, void **out)
 
static ULONG WINAPI isaxlexical_AddRef (ISAXLexicalHandler *iface)
 
static ULONG WINAPI isaxlexical_Release (ISAXLexicalHandler *iface)
 
static HRESULT WINAPI isaxlexical_startDTD (ISAXLexicalHandler *iface, const WCHAR *pName, int nName, const WCHAR *pPublicId, int nPublicId, const WCHAR *pSystemId, int nSystemId)
 
static HRESULT WINAPI isaxlexical_endDTD (ISAXLexicalHandler *iface)
 
static HRESULT WINAPI isaxlexical_startEntity (ISAXLexicalHandler *iface, const WCHAR *pName, int nName)
 
static HRESULT WINAPI isaxlexical_endEntity (ISAXLexicalHandler *iface, const WCHAR *pName, int nName)
 
static HRESULT WINAPI isaxlexical_startCDATA (ISAXLexicalHandler *iface)
 
static HRESULT WINAPI isaxlexical_endCDATA (ISAXLexicalHandler *iface)
 
static HRESULT WINAPI isaxlexical_comment (ISAXLexicalHandler *iface, const WCHAR *pChars, int nChars)
 
static void init_saxlexicalhandler (struct saxlexicalhandler *handler, HRESULT hr)
 
static struct saxdeclhandlerimpl_from_ISAXDeclHandler (ISAXDeclHandler *iface)
 
static HRESULT WINAPI isaxdecl_QueryInterface (ISAXDeclHandler *iface, REFIID riid, void **out)
 
static ULONG WINAPI isaxdecl_AddRef (ISAXDeclHandler *iface)
 
static ULONG WINAPI isaxdecl_Release (ISAXDeclHandler *iface)
 
static HRESULT WINAPI isaxdecl_elementDecl (ISAXDeclHandler *iface, const WCHAR *pName, int nName, const WCHAR *pModel, int nModel)
 
static HRESULT WINAPI isaxdecl_attributeDecl (ISAXDeclHandler *iface, const WCHAR *pElementName, int nElementName, const WCHAR *pAttributeName, int nAttributeName, const WCHAR *pType, int nType, const WCHAR *pValueDefault, int nValueDefault, const WCHAR *pValue, int nValue)
 
static HRESULT WINAPI isaxdecl_internalEntityDecl (ISAXDeclHandler *iface, const WCHAR *pName, int nName, const WCHAR *pValue, int nValue)
 
static HRESULT WINAPI isaxdecl_externalEntityDecl (ISAXDeclHandler *iface, const WCHAR *pName, int nName, const WCHAR *pPublicId, int nPublicId, const WCHAR *pSystemId, int nSystemId)
 
static void init_saxdeclhandler (struct saxdeclhandler *handler, HRESULT hr)
 
static HRESULT WINAPI istream_QueryInterface (IStream *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI istream_AddRef (IStream *iface)
 
static ULONG WINAPI istream_Release (IStream *iface)
 
static HRESULT WINAPI istream_Read (IStream *iface, void *pv, ULONG cb, ULONG *pcbRead)
 
static HRESULT WINAPI istream_Write (IStream *iface, const void *pv, ULONG cb, ULONG *pcbWritten)
 
static HRESULT WINAPI istream_Seek (IStream *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
 
static HRESULT WINAPI istream_SetSize (IStream *iface, ULARGE_INTEGER libNewSize)
 
static HRESULT WINAPI istream_CopyTo (IStream *iface, IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *plibWritten)
 
static HRESULT WINAPI istream_Commit (IStream *iface, DWORD grfCommitFlags)
 
static HRESULT WINAPI istream_Revert (IStream *iface)
 
static HRESULT WINAPI istream_LockRegion (IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
 
static HRESULT WINAPI istream_UnlockRegion (IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
 
static HRESULT WINAPI istream_Stat (IStream *iface, STATSTG *pstatstg, DWORD grfStatFlag)
 
static HRESULT WINAPI istream_Clone (IStream *iface, IStream **ppstm)
 
static HRESULT WINAPI mxstream_Write (IStream *iface, const void *pv, ULONG cb, ULONG *pcbWritten)
 
static HRESULT WINAPI instream_Read (IStream *iface, void *pv, ULONG cb, ULONG *pcbRead)
 
static IStreamcreate_test_stream (const char *data, int len)
 
static void test_saxreader (void)
 
static void test_saxreader_properties (void)
 
static void test_saxreader_features (void)
 
static void test_saxreader_encoding (void)
 
static void test_mxwriter_handlers (void)
 
static void test_mxwriter_default_properties (const struct mxwriter_props_t *table)
 
static void test_mxwriter_properties (void)
 
static void test_mxwriter_flush (void)
 
static void test_mxwriter_startenddocument (void)
 
static void get_class_support_data (struct msxmlsupported_data_t *table, REFIID riid)
 
static void test_mxwriter_startendelement_batch (const struct writer_startendelement_t *table)
 
static void test_mxwriter_startendelement_batch2 (const struct writer_startendelement2_t *table)
 
static void test_mxwriter_startendelement (void)
 
static void test_mxwriter_characters (void)
 
static void test_mxwriter_stream (void)
 
static void test_mxwriter_encoding (void)
 
static void test_obj_dispex (IUnknown *obj)
 
static void test_saxreader_dispex (void)
 
static void test_mxwriter_dispex (void)
 
static void test_mxwriter_comment (void)
 
static void test_mxwriter_cdata (void)
 
static void test_mxwriter_pi (void)
 
static void test_mxwriter_ignorablespaces (void)
 
static void test_mxwriter_dtd (void)
 
static void test_mxattr_addAttribute (void)
 
static void test_mxattr_clear (void)
 
static void test_mxattr_dispex (void)
 
static void test_mxattr_qi (void)
 
static void test_mxattr_localname (void)
 
static void test_mxwriter_indent (void)
 
 START_TEST (saxreader)
 

Variables

static const WCHAR emptyW [] = {0}
 
static BSTR alloced_bstrs [512]
 
static int alloced_bstrs_count
 
static const charevent_names [EVENT_LAST]
 
static struct call_sequencesequences [NUM_CALL_SEQUENCES]
 
static const WCHAR szSimpleXML []
 
static const WCHAR carriage_ret_test []
 
static const WCHAR szUtf16XML []
 
static const CHAR szUtf16BOM [] = {0xff, 0xfe}
 
static const CHAR szUtf8XML []
 
static const char utf8xml2 []
 
static const char testXML []
 
static const char test_attributes []
 
static const char test_cdata_xml []
 
static const char test2_cdata_xml []
 
static const char test3_cdata_xml []
 
static struct call_entry content_handler_test1 []
 
static struct call_entry content_handler_test1_alternate []
 
static struct call_entry content_handler_test2 []
 
static struct call_entry content_handler_test2_alternate []
 
static struct call_entry content_handler_testerror []
 
static struct call_entry content_handler_testerror_alternate []
 
static struct call_entry content_handler_test_callback_rets []
 
static struct call_entry content_handler_test_callback_rets_alt []
 
static struct attribute_entry ch_attributes1 []
 
static struct attribute_entry ch_attributes2 []
 
static struct call_entry content_handler_test_attributes []
 
static struct attribute_entry ch_attributes_alt_4 []
 
static struct call_entry content_handler_test_attributes_alternate_4 []
 
static struct attribute_entry ch_attributes_alt_no_ns []
 
static struct call_entry content_handler_test_attributes_alt_no_ns []
 
static struct attribute_entry ch_attributes_alt_6 []
 
static struct attribute_entry ch_attributes2_6 []
 
static struct call_entry content_handler_test_attributes_alternate_6 []
 
static struct attribute_entry ch_attributes_no_prefix []
 
static struct call_entry content_handler_test_attributes_alt_no_prefix []
 
static struct call_entry content_handler_test_attributes_no_prefix []
 
static struct attribute_entry xmlspace_attrs []
 
static struct call_entry xmlspaceattr_test []
 
static struct call_entry xmlspaceattr_test_alternate []
 
static const char attribute_normalize []
 
static struct attribute_entry attribute_norm_attrs []
 
static struct call_entry attribute_norm []
 
static struct call_entry attribute_norm_alt []
 
static struct call_entry cdata_test []
 
static struct call_entry cdata_test2 []
 
static struct call_entry cdata_test3 []
 
static struct call_entry cdata_test_alt []
 
static struct call_entry cdata_test2_alt []
 
static struct call_entry cdata_test3_alt []
 
static struct attribute_entry read_test_attrs []
 
static struct call_entry read_test_seq []
 
static const char xmlspace_attr []
 
static struct call_entryexpectCall
 
static ISAXLocator * locator
 
static ISAXXMLReader * g_reader
 
int msxml_version
 
static ISAXAttributes * test_attr_ptr
 
static const ISAXContentHandlerVtbl contentHandlerVtbl
 
static ISAXContentHandler contentHandler = { &contentHandlerVtbl }
 
static const ISAXErrorHandlerVtbl errorHandlerVtbl
 
static ISAXErrorHandler errorHandler = { &errorHandlerVtbl }
 
static const ISAXAttributesVtbl SAXAttributesVtbl
 
static ISAXAttributes saxattributes = { &SAXAttributesVtbl }
 
static const ISAXLexicalHandlerVtbl SAXLexicalHandlerVtbl
 
static const ISAXDeclHandlerVtbl SAXDeclHandlerVtbl
 
static const mxwriter_write_testcurrent_write_test
 
static DWORD current_stream_test_index
 
static const IStreamVtbl mxstreamVtbl
 
static IStream mxstream = { &mxstreamVtbl }
 
static int read_cnt
 
static const IStreamVtbl instreamVtbl
 
static IStream instream = { &instreamVtbl }
 
static struct msxmlsupported_data_t reader_support_data []
 
static struct saxlexicalhandler lexicalhandler
 
static struct saxdeclhandler declhandler
 
static const struct saxreader_props_test_t props_test_data []
 
static const struct feature_ns_entry_t feature_ns_entry_data []
 
static const charfeature_names []
 
static const CHAR UTF8BOMTest []
 
static const struct enc_test_entry_t encoding_test_data []
 
static struct msxmlsupported_data_t mxwriter_support_data []
 
static struct msxmlsupported_data_t mxattributes_support_data []
 
static const struct mxwriter_props_t mxwriter_default_props []
 
static const char startelement_xml [] = "<uri:local a:attr1=\"a1\" attr2=\"a2\" attr3=\"&lt;&amp;&quot;&gt;\'\">"
 
static const char startendelement_xml [] = "<uri:local a:attr1=\"a1\" attr2=\"a2\" attr3=\"&lt;&amp;&quot;&gt;\'\"/>"
 
static const char startendelement_noescape_xml [] = "<uri:local a:attr1=\"a1\" attr2=\"a2\" attr3=\"<&\">\'\"/>"
 
static const struct writer_startendelement_t writer_startendelement []
 
static const struct writer_startendelement2_t writer_startendelement2 []
 
static const struct writer_characters_t writer_characters []
 
static const mxwriter_stream_test mxwriter_stream_tests []
 
static const charencoding_names []
 
static const addattribute_test_t addattribute_data []
 
static struct msxmlsupported_data_t saxattr_support_data []
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file saxreader.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 24 of file saxreader.c.

◆ CONTENT_HANDLER_INDEX

#define CONTENT_HANDLER_INDEX   0

Definition at line 242 of file saxreader.c.

◆ EXPECT_HR

#define EXPECT_HR (   hr,
  hr_exp 
)    ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)

Definition at line 41 of file saxreader.c.

◆ EXPECT_REF

#define EXPECT_REF (   obj,
  ref 
)    _expect_ref((IUnknown*)obj, ref, __LINE__)

Definition at line 44 of file saxreader.c.

◆ NUM_CALL_SEQUENCES

#define NUM_CALL_SEQUENCES   1

Definition at line 243 of file saxreader.c.

◆ ok_sequence

#define ok_sequence (   seq,
  index,
  exp,
  contx,
  todo 
)    ok_sequence_(seq, index, (exp), (contx), (todo), __FILE__, __LINE__)

Definition at line 529 of file saxreader.c.

Typedef Documentation

◆ CH

typedef enum _CH CH

◆ mxwriter_stream_test

◆ mxwriter_write_test

Enumeration Type Documentation

◆ _CH

Enumerator
CH_ENDTEST 
CH_PUTDOCUMENTLOCATOR 
CH_STARTDOCUMENT 
CH_ENDDOCUMENT 
CH_STARTPREFIXMAPPING 
CH_ENDPREFIXMAPPING 
CH_STARTELEMENT 
CH_ENDELEMENT 
CH_CHARACTERS 
CH_IGNORABLEWHITESPACE 
CH_PROCESSINGINSTRUCTION 
CH_SKIPPEDENTITY 
LH_STARTCDATA 
LH_ENDCDATA 
EH_ERROR 
EH_FATALERROR 
EH_IGNORABLEWARNING 
EVENT_LAST 

Definition at line 162 of file saxreader.c.

◆ startendtype

Enumerator
StartElement 
EndElement 
StartEndElement 
DisableEscaping 

Definition at line 3524 of file saxreader.c.

3525 {
3526  StartElement = 0x001,
3527  EndElement = 0x010,
3528  StartEndElement = 0x011,
3529  DisableEscaping = 0x100
3530 };

Function Documentation

◆ _bstr_()

◆ _expect_ref()

static void _expect_ref ( IUnknown obj,
ULONG  ref,
int  line 
)
static

Definition at line 45 of file saxreader.c.

46 {
47  ULONG rc;
48  IUnknown_AddRef(obj);
49  rc = IUnknown_Release(obj);
50  ok_(__FILE__, line)(rc == ref, "expected refcount %d, got %d\n", ref, rc);
51 }
GLenum GLint ref
Definition: glext.h:6028
Definition: parser.c:48
unsigned int ULONG
Definition: retypes.h:1
#define ok_(x1, x2)
Definition: atltest.h:61

◆ add_call()

static void add_call ( struct call_sequence **  seq,
int  sequence_index,
const struct call_entry call 
)
static

Definition at line 253 of file saxreader.c.

255 {
256  struct call_sequence *call_seq = seq[sequence_index];
257 
258  if (!call_seq->sequence)
259  {
260  call_seq->size = 10;
261  call_seq->sequence = heap_alloc(call_seq->size * sizeof (struct call_entry));
262  }
263 
264  if (call_seq->count == call_seq->size)
265  {
266  call_seq->size *= 2;
267  call_seq->sequence = heap_realloc(call_seq->sequence, call_seq->size * sizeof (struct call_entry));
268  }
269 
270  assert(call_seq->sequence);
271 
272  call_seq->sequence[call_seq->count].id = call->id;
273  call_seq->sequence[call_seq->count].line = call->line;
274  call_seq->sequence[call_seq->count].column = call->column;
275  call_seq->sequence[call_seq->count].arg1W = call->arg1W;
276  call_seq->sequence[call_seq->count].arg2W = call->arg2W;
277  call_seq->sequence[call_seq->count].arg3W = call->arg3W;
278  call_seq->sequence[call_seq->count].ret = call->ret;
279  call_seq->sequence[call_seq->count].attr_count = call->attr_count;
280  call_seq->sequence[call_seq->count].attributes = call->attributes;
281 
282  call_seq->count++;
283 }
int line
Definition: saxreader.c:218
BSTR arg2W
Definition: saxreader.c:231
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define assert(x)
Definition: debug.h:53
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
Definition: saxreader.c:216
int column
Definition: saxreader.c:219
HRESULT ret
Definition: saxreader.c:220
struct attribute_entry * attributes
Definition: saxreader.c:226
BSTR arg1W
Definition: saxreader.c:230
BSTR arg3W
Definition: saxreader.c:232
int attr_count
Definition: saxreader.c:227
struct call_entry * sequence
Definition: saxreader.c:239
CH id
Definition: saxreader.c:217

Referenced by contentHandler_characters(), contentHandler_endDocument(), contentHandler_endElement(), contentHandler_endPrefixMapping(), contentHandler_ignorableWhitespace(), contentHandler_processingInstruction(), contentHandler_putDocumentLocator(), contentHandler_skippedEntity(), contentHandler_startDocument(), contentHandler_startElement(), contentHandler_startPrefixMapping(), isaxerrorHandler_fatalError(), isaxlexical_endCDATA(), isaxlexical_startCDATA(), and ok_sequence_().

◆ alloc_str_from_narrow()

static BSTR alloc_str_from_narrow ( const char str)
static

Definition at line 80 of file saxreader.c.

81 {
82  int len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
83  BSTR ret = SysAllocStringLen(NULL, len - 1); /* NUL character added automatically */
85  return ret;
86 }
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
#define CP_ACP
Definition: compat.h:99
OLECHAR * BSTR
Definition: compat.h:1943
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100

Referenced by _bstr_().

◆ compare_attributes()

static void compare_attributes ( const struct call_entry actual,
const struct call_entry expected,
const char context,
BOOL  todo,
const char file,
int  line,
int failcount 
)
static

Definition at line 320 of file saxreader.c.

322 {
323  int i, lenexp = 0;
324 
325  /* attribute count is not stored for expected data */
326  if (expected->attributes)
327  {
328  struct attribute_entry *ptr = expected->attributes;
329  while (ptr->uri) { lenexp++; ptr++; };
330  }
331 
332  /* check count first and exit earlier */
333  if (actual->attr_count != lenexp && todo)
334  {
335  (*failcount)++;
336  todo_wine
337  ok_(file, line) (FALSE, "%s: in event %s expecting attr count %d got %d\n",
338  context, get_event_name(actual->id), lenexp, actual->attr_count);
339  }
340  else
341  ok_(file, line) (actual->attr_count == lenexp, "%s: in event %s expecting attr count %d got %d\n",
342  context, get_event_name(actual->id), lenexp, actual->attr_count);
343 
344  if (actual->attr_count != lenexp) return;
345 
346  /* now compare all attributes strings */
347  for (i = 0; i < actual->attr_count; i++)
348  {
349  test_saxstr(file, line, actual->attributes[i].uriW, expected->attributes[i].uri, todo, failcount);
350  test_saxstr(file, line, actual->attributes[i].localW, expected->attributes[i].local, todo, failcount);
351  test_saxstr(file, line, actual->attributes[i].qnameW, expected->attributes[i].qname, todo, failcount);
352  test_saxstr(file, line, actual->attributes[i].valueW, expected->attributes[i].value, todo, failcount);
353  }
354 }
Definition: http.c:7094
BOOL todo
Definition: filedlg.c:313
static const char * get_event_name(CH event)
Definition: saxreader.c:315
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static PVOID ptr
Definition: dispmode.c:27
static void test_saxstr(const char *file, unsigned line, BSTR str, const char *expected, BOOL todo, int *failcount)
Definition: saxreader.c:106
Definition: parser.c:48
struct attribute_entry * attributes
Definition: saxreader.c:226
#define todo_wine
Definition: test.h:162
int attr_count
Definition: saxreader.c:227
Definition: saxreader.c:203
CH id
Definition: saxreader.c:217
BOOL expected
Definition: store.c:2063
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: fci.c:126

Referenced by ok_sequence_().

◆ contentHandler_AddRef()

static ULONG WINAPI contentHandler_AddRef ( ISAXContentHandler *  iface)
static

Definition at line 1073 of file saxreader.c.

1075 {
1076  return 2;
1077 }

◆ contentHandler_characters()

static HRESULT WINAPI contentHandler_characters ( ISAXContentHandler *  iface,
const WCHAR chars,
int  len 
)
static

Definition at line 1298 of file saxreader.c.

1302 {
1303  struct call_entry call;
1304 
1305  ok(chars != NULL, "chars == NULL\n");
1306 
1307  init_call_entry(locator, &call);
1308  call.id = CH_CHARACTERS;
1309  call.arg1W = SysAllocStringLen(chars, len);
1311 
1312  return get_expected_ret();
1313 }
static void init_call_entry(ISAXLocator *locator, struct call_entry *call)
Definition: saxreader.c:246
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
static struct call_sequence * sequences[NUM_CALL_SEQUENCES]
Definition: saxreader.c:244
Definition: saxreader.c:216
#define CONTENT_HANDLER_INDEX
Definition: saxreader.c:242
smooth NULL
Definition: ftsmooth.c:416
static void add_call(struct call_sequence **seq, int sequence_index, const struct call_entry *call)
Definition: saxreader.c:253
GLenum GLsizei len
Definition: glext.h:6722
#define ok(value,...)
Definition: atltest.h:57
static HRESULT get_expected_ret(void)
Definition: saxreader.c:1047

◆ contentHandler_endDocument()

static HRESULT WINAPI contentHandler_endDocument ( ISAXContentHandler *  iface)
static

Definition at line 1146 of file saxreader.c.

1148 {
1149  struct call_entry call;
1150 
1151  init_call_entry(locator, &call);
1152  call.id = CH_ENDDOCUMENT;
1154 
1155  return get_expected_ret();
1156 }
static void init_call_entry(ISAXLocator *locator, struct call_entry *call)
Definition: saxreader.c:246
static struct call_sequence * sequences[NUM_CALL_SEQUENCES]
Definition: saxreader.c:244
Definition: saxreader.c:216
#define CONTENT_HANDLER_INDEX
Definition: saxreader.c:242
static void add_call(struct call_sequence **seq, int sequence_index, const struct call_entry *call)
Definition: saxreader.c:253
static HRESULT get_expected_ret(void)
Definition: saxreader.c:1047

◆ contentHandler_endElement()

static HRESULT WINAPI contentHandler_endElement ( ISAXContentHandler *  iface,
const WCHAR uri,
int  uri_len,
const WCHAR localname,
int  local_len,
const WCHAR qname,
int  qname_len 
)
static

Definition at line 1276 of file saxreader.c.

1281 {
1282  struct call_entry call;
1283 
1284  ok(uri != NULL, "uri == NULL\n");
1285  ok(localname != NULL, "localname == NULL\n");
1286  ok(qname != NULL, "qname == NULL\n");
1287 
1288  init_call_entry(locator, &call);
1289  call.id = CH_ENDELEMENT;
1290  call.arg1W = SysAllocStringLen(uri, uri_len);
1291  call.arg2W = SysAllocStringLen(localname, local_len);
1292  call.arg3W = SysAllocStringLen(qname, qname_len);
1294 
1295  return get_expected_ret();
1296 }
static void init_call_entry(ISAXLocator *locator, struct call_entry *call)
Definition: saxreader.c:246
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
const char * uri
Definition: sec_mgr.c:1588
static struct call_sequence * sequences[NUM_CALL_SEQUENCES]
Definition: saxreader.c:244
Definition: saxreader.c:216
#define CONTENT_HANDLER_INDEX
Definition: saxreader.c:242
smooth NULL
Definition: ftsmooth.c:416
static void add_call(struct call_sequence **seq, int sequence_index, const struct call_entry *call)
Definition: saxreader.c:253
#define ok(value,...)
Definition: atltest.h:57
static HRESULT get_expected_ret(void)
Definition: saxreader.c:1047

◆ contentHandler_endPrefixMapping()

static HRESULT WINAPI contentHandler_endPrefixMapping ( ISAXContentHandler *  iface,
const WCHAR prefix,
int  len 
)
static

Definition at line 1177 of file saxreader.c.

1180 {
1181  struct call_entry call;
1182 
1183  ok(prefix != NULL, "prefix == NULL\n");
1184 
1185  init_call_entry(locator, &call);
1186  call.id = CH_ENDPREFIXMAPPING;
1187  call.arg1W = SysAllocStringLen(prefix, len);
1189 
1190  return get_expected_ret();
1191 }
static void init_call_entry(ISAXLocator *locator, struct call_entry *call)
Definition: saxreader.c:246
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
static struct call_sequence * sequences[NUM_CALL_SEQUENCES]
Definition: saxreader.c:244
Definition: saxreader.c:216
#define CONTENT_HANDLER_INDEX
Definition: saxreader.c:242
smooth NULL
Definition: ftsmooth.c:416
static void add_call(struct call_sequence **seq, int sequence_index, const struct call_entry *call)
Definition: saxreader.c:253
GLenum GLsizei len
Definition: glext.h:6722
#define ok(value,...)
Definition: atltest.h:57
static HRESULT get_expected_ret(void)
Definition: saxreader.c:1047

◆ contentHandler_ignorableWhitespace()

static HRESULT WINAPI contentHandler_ignorableWhitespace ( ISAXContentHandler *  iface,
const WCHAR chars,
int  len 
)
static

Definition at line 1315 of file saxreader.c.

1318 {
1319  struct call_entry call;
1320 
1321  ok(chars != NULL, "chars == NULL\n");
1322 
1323  init_call_entry(locator, &call);
1324  call.id = CH_IGNORABLEWHITESPACE;
1325  call.arg1W = SysAllocStringLen(chars, len);
1327 
1328  return get_expected_ret();
1329 }
static void init_call_entry(ISAXLocator *locator, struct call_entry *call)
Definition: saxreader.c:246
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
static struct call_sequence * sequences[NUM_CALL_SEQUENCES]
Definition: saxreader.c:244
Definition: saxreader.c:216
#define CONTENT_HANDLER_INDEX
Definition: saxreader.c:242
smooth NULL
Definition: ftsmooth.c:416
static void add_call(struct call_sequence **seq, int sequence_index, const struct call_entry *call)
Definition: saxreader.c:253
GLenum GLsizei len
Definition: glext.h:6722
#define ok(value,...)
Definition: atltest.h:57
static HRESULT get_expected_ret(void)
Definition: saxreader.c:1047

◆ contentHandler_processingInstruction()

static HRESULT WINAPI contentHandler_processingInstruction ( ISAXContentHandler *  iface,
const WCHAR target,
int  target_len,
const WCHAR data,
int  data_len 
)
static

Definition at line 1331 of file saxreader.c.

1335 {
1336  struct call_entry call;
1337 
1338  ok(target != NULL, "target == NULL\n");
1339  ok(data != NULL, "data == NULL\n");
1340 
1341  init_call_entry(locator, &call);
1342  call.id = CH_PROCESSINGINSTRUCTION;
1343  call.arg1W = SysAllocStringLen(target, target_len);
1344  call.arg2W = SysAllocStringLen(data, data_len);
1346 
1347  return get_expected_ret();
1348 }
static void init_call_entry(ISAXLocator *locator, struct call_entry *call)
Definition: saxreader.c:246
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
static struct call_sequence * sequences[NUM_CALL_SEQUENCES]
Definition: saxreader.c:244
Definition: saxreader.c:216
#define CONTENT_HANDLER_INDEX
Definition: saxreader.c:242
smooth NULL
Definition: ftsmooth.c:416
static void add_call(struct call_sequence **seq, int sequence_index, const struct call_entry *call)
Definition: saxreader.c:253
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define ok(value,...)
Definition: atltest.h:57
static HRESULT get_expected_ret(void)
Definition: saxreader.c:1047
GLenum target
Definition: glext.h:7315

◆ contentHandler_putDocumentLocator()

static HRESULT WINAPI contentHandler_putDocumentLocator ( ISAXContentHandler *  iface,
ISAXLocator *  pLocator 
)
static

Definition at line 1085 of file saxreader.c.

1088 {
1089  struct call_entry call;
1090  IUnknown *unk;
1091  HRESULT hr;
1092 
1093  locator = pLocator;
1094 
1095  init_call_entry(locator, &call);
1096  call.id = CH_PUTDOCUMENTLOCATOR;
1098 
1099  hr = ISAXLocator_QueryInterface(pLocator, &IID_IVBSAXLocator, (void**)&unk);
1101 
1102  if (msxml_version >= 6) {
1103  ISAXAttributes *attr, *attr1;
1104  IMXAttributes *mxattr;
1105 
1106  EXPECT_REF(pLocator, 1);
1107  hr = ISAXLocator_QueryInterface(pLocator, &IID_ISAXAttributes, (void**)&attr);
1108  EXPECT_HR(hr, S_OK);
1109  EXPECT_REF(pLocator, 2);
1110  hr = ISAXLocator_QueryInterface(pLocator, &IID_ISAXAttributes, (void**)&attr1);
1111  EXPECT_HR(hr, S_OK);
1112  EXPECT_REF(pLocator, 3);
1113  ok(attr == attr1, "got %p, %p\n", attr, attr1);
1114 
1115  hr = ISAXAttributes_QueryInterface(attr, &IID_IVBSAXAttributes, (void**)&unk);
1117 
1118  hr = ISAXLocator_QueryInterface(pLocator, &IID_IVBSAXAttributes, (void**)&unk);
1120 
1121  hr = ISAXAttributes_QueryInterface(attr, &IID_IMXAttributes, (void**)&mxattr);
1123 
1124  ISAXAttributes_Release(attr);
1125  ISAXAttributes_Release(attr1);
1126  }
1127 
1128  return get_expected_ret();
1129 }
static void init_call_entry(ISAXLocator *locator, struct call_entry *call)
Definition: saxreader.c:246
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
static struct call_sequence * sequences[NUM_CALL_SEQUENCES]
Definition: saxreader.c:244
#define EXPECT_HR(hr, hr_exp)
Definition: saxreader.c:41
Definition: saxreader.c:216
#define EXPECT_REF(obj, ref)
Definition: saxreader.c:44
#define CONTENT_HANDLER_INDEX
Definition: saxreader.c:242
static void add_call(struct call_sequence **seq, int sequence_index, const struct call_entry *call)
Definition: saxreader.c:253
LONG HRESULT
Definition: typedefs.h:78
Definition: cookie.c:201
__u8 attr
Definition: mkdosfs.c:359
int msxml_version
Definition: saxreader.c:1039
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static HRESULT get_expected_ret(void)
Definition: saxreader.c:1047

◆ contentHandler_QueryInterface()

static HRESULT WINAPI contentHandler_QueryInterface ( ISAXContentHandler *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1054 of file saxreader.c.

1058 {
1059  *ppvObject = NULL;
1060 
1061  if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ISAXContentHandler))
1062  {
1063  *ppvObject = iface;
1064  }
1065  else
1066  {
1067  return E_NOINTERFACE;
1068  }
1069 
1070  return S_OK;
1071 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ contentHandler_Release()

static ULONG WINAPI contentHandler_Release ( ISAXContentHandler *  iface)
static

Definition at line 1079 of file saxreader.c.

1081 {
1082  return 1;
1083 }

◆ contentHandler_skippedEntity()

static HRESULT WINAPI contentHandler_skippedEntity ( ISAXContentHandler *  iface,
const WCHAR name,
int  len 
)
static

Definition at line 1350 of file saxreader.c.

1353 {
1354  struct call_entry call;
1355 
1356  ok(name != NULL, "name == NULL\n");
1357 
1358  init_call_entry(locator, &call);
1359  call.id = CH_SKIPPEDENTITY;
1360  call.arg1W = SysAllocStringLen(name, len);
1362 
1363  return get_expected_ret();
1364 }
static void init_call_entry(ISAXLocator *locator, struct call_entry *call)
Definition: saxreader.c:246
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
static struct call_sequence * sequences[NUM_CALL_SEQUENCES]
Definition: saxreader.c:244
Definition: saxreader.c:216
#define CONTENT_HANDLER_INDEX
Definition: saxreader.c:242
smooth NULL
Definition: ftsmooth.c:416
static void add_call(struct call_sequence **seq, int sequence_index, const struct call_entry *call)
Definition: saxreader.c:253
GLenum GLsizei len
Definition: glext.h:6722
#define ok(value,...)
Definition: atltest.h:57
Definition: name.c:38
static HRESULT get_expected_ret(void)
Definition: saxreader.c:1047

◆ contentHandler_startDocument()

static HRESULT WINAPI contentHandler_startDocument ( ISAXContentHandler *  iface)
static

Definition at line 1132 of file saxreader.c.

1134 {
1135  struct call_entry call;
1136 
1137  init_call_entry(locator, &call);
1138  call.id = CH_STARTDOCUMENT;
1140 
1141  test_attr_ptr = NULL;
1142 
1143  return get_expected_ret();
1144 }
static void init_call_entry(ISAXLocator *locator, struct call_entry *call)
Definition: saxreader.c:246
static struct call_sequence * sequences[NUM_CALL_SEQUENCES]
Definition: saxreader.c:244
Definition: saxreader.c:216
#define CONTENT_HANDLER_INDEX
Definition: saxreader.c:242
smooth NULL
Definition: ftsmooth.c:416
static void add_call(struct call_sequence **seq, int sequence_index, const struct call_entry *call)
Definition: saxreader.c:253
static ISAXAttributes * test_attr_ptr
Definition: saxreader.c:1131
static HRESULT get_expected_ret(void)
Definition: saxreader.c:1047

◆ contentHandler_startElement()

static HRESULT WINAPI contentHandler_startElement ( ISAXContentHandler *  iface,
const WCHAR uri,
int  uri_len,
const WCHAR localname,
int  local_len,
const WCHAR qname,
int  qname_len,
ISAXAttributes *  saxattr 
)
static

Definition at line 1193 of file saxreader.c.

1199 {
1200  struct call_entry call;
1201  IMXAttributes *mxattr;
1202  HRESULT hr;
1203  int len;
1204 
1205  ok(uri != NULL, "uri == NULL\n");
1206  ok(localname != NULL, "localname == NULL\n");
1207  ok(qname != NULL, "qname == NULL\n");
1208 
1209  hr = ISAXAttributes_QueryInterface(saxattr, &IID_IMXAttributes, (void**)&mxattr);
1211 
1212  init_call_entry(locator, &call);
1213  call.id = CH_STARTELEMENT;
1214  call.arg1W = SysAllocStringLen(uri, uri_len);
1215  call.arg2W = SysAllocStringLen(localname, local_len);
1216  call.arg3W = SysAllocStringLen(qname, qname_len);
1217 
1218  if(!test_attr_ptr)
1219  test_attr_ptr = saxattr;
1220  ok(test_attr_ptr == saxattr, "Multiple ISAXAttributes instances are used (%p %p)\n", test_attr_ptr, saxattr);
1221 
1222  /* store actual attributes */
1223  len = 0;
1224  hr = ISAXAttributes_getLength(saxattr, &len);
1225  EXPECT_HR(hr, S_OK);
1226 
1227  if (len)
1228  {
1229  VARIANT_BOOL v;
1230  int i;
1231 
1232  struct attribute_entry *attr;
1233  attr = heap_alloc_zero(len * sizeof(*attr));
1234 
1235  v = VARIANT_TRUE;
1236  hr = ISAXXMLReader_getFeature(g_reader, _bstr_("http://xml.org/sax/features/namespaces"), &v);
1237  EXPECT_HR(hr, S_OK);
1238 
1239  for (i = 0; i < len; i++)
1240  {
1241  const WCHAR *value;
1242  int value_len;
1243 
1244  hr = ISAXAttributes_getName(saxattr, i, &uri, &uri_len,
1245  &localname, &local_len, &qname, &qname_len);
1246  EXPECT_HR(hr, S_OK);
1247 
1248  hr = ISAXAttributes_getValue(saxattr, i, &value, &value_len);
1249  EXPECT_HR(hr, S_OK);
1250 
1251  /* if 'namespaces' switched off uri and local name contains garbage */
1252  if (v == VARIANT_FALSE && msxml_version > 0)
1253  {
1254  attr[i].uriW = SysAllocStringLen(NULL, 0);
1255  attr[i].localW = SysAllocStringLen(NULL, 0);
1256  }
1257  else
1258  {
1259  attr[i].uriW = SysAllocStringLen(uri, uri_len);
1260  attr[i].localW = SysAllocStringLen(localname, local_len);
1261  }
1262 
1263  attr[i].qnameW = SysAllocStringLen(qname, qname_len);
1264  attr[i].valueW = SysAllocStringLen(value, value_len);
1265  }
1266 
1267  call.attributes = attr;
1268  call.attr_count = len;
1269  }
1270 
1272 
1273  return get_expected_ret();
1274 }
static void init_call_entry(ISAXLocator *locator, struct call_entry *call)
Definition: saxreader.c:246
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
const char * uri
Definition: sec_mgr.c:1588
static struct call_sequence * sequences[NUM_CALL_SEQUENCES]
Definition: saxreader.c:244
short VARIANT_BOOL
Definition: compat.h:1940
#define EXPECT_HR(hr, hr_exp)
Definition: saxreader.c:41
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: saxreader.c:216
#define CONTENT_HANDLER_INDEX
Definition: saxreader.c:242
smooth NULL
Definition: ftsmooth.c:416
static ISAXXMLReader * g_reader
Definition: saxreader.c:1038
static void add_call(struct call_sequence **seq, int sequence_index, const struct call_entry *call)
Definition: saxreader.c:253
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
const char * qname
Definition: saxreader.c:206
static ISAXAttributes * test_attr_ptr
Definition: saxreader.c:1131
Definition: cookie.c:201
__u8 attr
Definition: mkdosfs.c:359
int msxml_version
Definition: saxreader.c:1039
GLenum GLsizei len
Definition: glext.h:6722
GLsizei const GLfloat * value
Definition: glext.h:6069
#define S_OK
Definition: intsafe.h:59
const GLdouble * v
Definition: gl.h:2040
#define ok(value,...)
Definition: atltest.h:57
static HRESULT get_expected_ret(void)
Definition: saxreader.c:1047
Definition: saxreader.c:203
static BSTR _bstr_(const char *str)
Definition: saxreader.c:91

◆ contentHandler_startPrefixMapping()

static HRESULT WINAPI contentHandler_startPrefixMapping ( ISAXContentHandler *  iface,
const WCHAR prefix,
int  prefix_len,
const WCHAR uri,
int  uri_len 
)
static

Definition at line 1158 of file saxreader.c.

1162 {
1163  struct call_entry call;
1164 
1165  ok(prefix != NULL, "prefix == NULL\n");
1166  ok(uri != NULL, "uri == NULL\n");
1167 
1168  init_call_entry(locator, &call);
1169  call.id = CH_STARTPREFIXMAPPING;
1170  call.arg1W = SysAllocStringLen(prefix, prefix_len);
1171  call.arg2W = SysAllocStringLen(uri, uri_len);
1173 
1174  return get_expected_ret();
1175 }
static void init_call_entry(ISAXLocator *locator, struct call_entry *call)
Definition: saxreader.c:246
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
const char * uri
Definition: sec_mgr.c:1588
static struct call_sequence * sequences[NUM_CALL_SEQUENCES]
Definition: saxreader.c:244
Definition: saxreader.c:216
#define CONTENT_HANDLER_INDEX
Definition: saxreader.c:242
smooth NULL
Definition: ftsmooth.c:416
static void add_call(struct call_sequence **seq, int sequence_index, const struct call_entry *call)
Definition: saxreader.c:253
#define ok(value,...)
Definition: atltest.h:57
static HRESULT get_expected_ret(void)
Definition: saxreader.c:1047

◆ create_test_stream()

static IStream* create_test_stream ( const char data,
int  len 
)
static

Definition at line 2120 of file saxreader.c.

2121 {
2124  IStream *stream;
2125  ULONG written;
2126 
2127  if (len == -1) len = strlen(data);
2129  size.QuadPart = len;
2130  IStream_SetSize(stream, size);
2131  IStream_Write(stream, data, len, &written);
2132  pos.QuadPart = 0;
2133  IStream_Seek(stream, pos, STREAM_SEEK_SET, NULL);
2134 
2135  return stream;
2136 }
#define TRUE
Definition: types.h:120
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
GLenum GLsizei len
Definition: glext.h:6722
unsigned int ULONG
Definition: retypes.h:1

Referenced by test_saxreader().

◆ flush_sequence()

static void flush_sequence ( struct call_sequence **  seg,
int  sequence_index 
)
inlinestatic

Definition at line 285 of file saxreader.c.

286 {
287  int i;
288 
289  struct call_sequence *call_seq = seg[sequence_index];
290 
291  for (i = 0; i < call_seq->count; i++)
292  {
293  int j;
294 
295  for (j = 0; j < call_seq->sequence[i].attr_count; j++)
296  {
297  SysFreeString(call_seq->sequence[i].attributes[j].uriW);
298  SysFreeString(call_seq->sequence[i].attributes[j].localW);
299  SysFreeString(call_seq->sequence[i].attributes[j].qnameW);
300  SysFreeString(call_seq->sequence[i].attributes[j].valueW);
301  }
302  heap_free(call_seq->sequence[i].attributes);
303  call_seq->sequence[i].attr_count = 0;
304 
305  SysFreeString(call_seq->sequence[i].arg1W);
306  SysFreeString(call_seq->sequence[i].arg2W);
307  SysFreeString(call_seq->sequence[i].arg3W);
308  }
309 
310  heap_free(call_seq->sequence);
311  call_seq->sequence = NULL;
312  call_seq->count = call_seq->size = 0;
313 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
seg
Definition: i386-dis.c:3857
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
struct call_entry * sequence
Definition: saxreader.c:239
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by ok_sequence_().

◆ free_bstrs()

static void free_bstrs ( void  )
static

Definition at line 98 of file saxreader.c.

99 {
100  int i;
101  for (i = 0; i < alloced_bstrs_count; i++)
104 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static int alloced_bstrs_count
Definition: saxreader.c:89
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
static BSTR alloced_bstrs[512]
Definition: saxreader.c:88

Referenced by test_mxattr_addAttribute(), test_mxattr_clear(), test_mxattr_localname(), test_mxwriter_cdata(), test_mxwriter_characters(), test_mxwriter_comment(), test_mxwriter_dtd(), test_mxwriter_encoding(), test_mxwriter_flush(), test_mxwriter_indent(), test_mxwriter_properties(), test_mxwriter_startenddocument(), test_mxwriter_startendelement(), test_mxwriter_startendelement_batch(), test_mxwriter_startendelement_batch2(), test_mxwriter_stream(), test_saxreader(), test_saxreader_encoding(), and test_saxreader_properties().

◆ get_class_support_data()

static void get_class_support_data ( struct msxmlsupported_data_t table,
REFIID  riid 
)
static

Definition at line 3654 of file saxreader.c.

3655 {
3656  while (table->clsid)
3657  {
3658  IUnknown *unk;
3659  HRESULT hr;
3660 
3661  hr = CoCreateInstance(table->clsid, NULL, CLSCTX_INPROC_SERVER, riid, (void**)&unk);
3662  if (hr == S_OK) IUnknown_Release(unk);
3663 
3664  table->supported = hr == S_OK;
3665  if (hr != S_OK) win_skip("class %s not supported\n", table->name);
3666 
3667  table++;
3668  }
3669 }
const WCHAR * name
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:78
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:59
#define win_skip
Definition: test.h:149

Referenced by START_TEST().

◆ get_event_name()

static const char* get_event_name ( CH  event)
static

Definition at line 315 of file saxreader.c.

316 {
317  return event_names[event];
318 }
static const char * event_names[EVENT_LAST]
Definition: saxreader.c:183
struct _cl_event * event
Definition: glext.h:7739

Referenced by compare_attributes(), and ok_sequence_().

◆ get_expected_ret()

◆ get_refcount()

static LONG get_refcount ( void iface)
static

Definition at line 53 of file saxreader.c.

54 {
55  IUnknown *unk = iface;
56  LONG ref;
57 
58  ref = IUnknown_AddRef(unk);
59  IUnknown_Release(unk);
60  return ref-1;
61 }
Definition: send.c:48
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028

Referenced by test_mxwriter_flush(), and test_saxreader_properties().

◆ impl_from_ISAXDeclHandler()

static struct saxdeclhandler* impl_from_ISAXDeclHandler ( ISAXDeclHandler *  iface)
inlinestatic

Definition at line 1819 of file saxreader.c.

1820 {
1821  return CONTAINING_RECORD(iface, struct saxdeclhandler, ISAXDeclHandler_iface);
1822 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by isaxdecl_AddRef(), isaxdecl_QueryInterface(), and isaxdecl_Release().

◆ impl_from_ISAXLexicalHandler()

static struct saxlexicalhandler* impl_from_ISAXLexicalHandler ( ISAXLexicalHandler *  iface)
inlinestatic

Definition at line 1691 of file saxreader.c.

1692 {
1693  return CONTAINING_RECORD(iface, struct saxlexicalhandler, ISAXLexicalHandler_iface);
1694 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by isaxlexical_AddRef(), isaxlexical_QueryInterface(), and isaxlexical_Release().

◆ init_call_entry()

◆ init_call_sequences()

static void init_call_sequences ( struct call_sequence **  seq,
int  n 
)
static

Definition at line 532 of file saxreader.c.

533 {
534  int i;
535 
536  for (i = 0; i < n; i++)
537  seq[i] = heap_alloc_zero(sizeof(struct call_sequence));
538 }
GLdouble n
Definition: glext.h:7729
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

Referenced by START_TEST().

◆ init_saxdeclhandler()

static void init_saxdeclhandler ( struct saxdeclhandler handler,
HRESULT  hr 
)
static

Definition at line 1903 of file saxreader.c.

1904 {
1905  handler->ISAXDeclHandler_iface.lpVtbl = &SAXDeclHandlerVtbl;
1906  handler->ref = 1;
1907  handler->qi_hr = hr;
1908 }
HRESULT hr
Definition: shlfolder.c:183
static const ISAXDeclHandlerVtbl SAXDeclHandlerVtbl
Definition: saxreader.c:1892
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

Referenced by test_saxreader_properties().

◆ init_saxlexicalhandler()

static void init_saxlexicalhandler ( struct saxlexicalhandler handler,
HRESULT  hr 
)
static

Definition at line 1804 of file saxreader.c.

1805 {
1806  handler->ISAXLexicalHandler_iface.lpVtbl = &SAXLexicalHandlerVtbl;
1807  handler->ref = 1;
1808  handler->qi_hr = hr;
1809 }
HRESULT hr
Definition: shlfolder.c:183
static const ISAXLexicalHandlerVtbl SAXLexicalHandlerVtbl
Definition: saxreader.c:1790
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

Referenced by test_saxreader(), and test_saxreader_properties().

◆ instream_Read()

static HRESULT WINAPI instream_Read ( IStream iface,
void pv,
ULONG  cb,
ULONG pcbRead 
)
static

Definition at line 2070 of file saxreader.c.

2071 {
2072  static const char *ret_str;
2073 
2074  if(!read_cnt)
2075  ret_str = "<?xml version=\"1.0\" ?>\n<rootelem>";
2076  else if(read_cnt < 5)
2077  ret_str = "<elem attr=\"val\">text</elem>";
2078  else if(read_cnt == 5)
2079  ret_str = "</rootelem>\n";
2080  else
2081  ret_str = "";
2082 
2083  read_cnt++;
2084  strcpy(pv, ret_str);
2085  *pcbRead = strlen(ret_str);
2086  return S_OK;
2087 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define S_OK
Definition: intsafe.h:59
static int read_cnt
Definition: saxreader.c:2068
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388

◆ is_clsid_supported()

static BOOL is_clsid_supported ( const GUID clsid,
const struct msxmlsupported_data_t table 
)
static

◆ isaxattributes_AddRef()

static ULONG WINAPI isaxattributes_AddRef ( ISAXAttributes *  iface)
static

Definition at line 1486 of file saxreader.c.

1487 {
1488  return 2;
1489 }

◆ isaxattributes_getIndexFromName()

static HRESULT WINAPI isaxattributes_getIndexFromName ( ISAXAttributes *  iface,
const WCHAR pUri,
int  cUriLength,
const WCHAR pLocalName,
int  cocalNameLength,
int index 
)
static

Definition at line 1560 of file saxreader.c.

1567 {
1568  ok(0, "unexpected call\n");
1569  return E_NOTIMPL;
1570 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxattributes_getIndexFromQName()

static HRESULT WINAPI isaxattributes_getIndexFromQName ( ISAXAttributes *  iface,
const WCHAR pQName,
int  nQNameLength,
int index 
)
static

Definition at line 1572 of file saxreader.c.

1577 {
1578  ok(0, "unexpected call\n");
1579  return E_NOTIMPL;
1580 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxattributes_getLength()

static HRESULT WINAPI isaxattributes_getLength ( ISAXAttributes *  iface,
int length 
)
static

Definition at line 1496 of file saxreader.c.

1497 {
1498  *length = 3;
1499  return S_OK;
1500 }
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
#define S_OK
Definition: intsafe.h:59

◆ isaxattributes_getLocalName()

static HRESULT WINAPI isaxattributes_getLocalName ( ISAXAttributes *  iface,
int  nIndex,
const WCHAR **  pLocalName,
int pLocalNameLength 
)
static

Definition at line 1512 of file saxreader.c.

1517 {
1518  ok(0, "unexpected call\n");
1519  return E_NOTIMPL;
1520 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxattributes_getName()

static HRESULT WINAPI isaxattributes_getName ( ISAXAttributes *  iface,
int  nIndex,
const WCHAR **  pUri,
int pUriLength,
const WCHAR **  pLocalName,
int pLocalNameSize,
const WCHAR **  pQName,
int pQNameLength 
)
static

Definition at line 1546 of file saxreader.c.

1555 {
1556  ok(0, "unexpected call\n");
1557  return E_NOTIMPL;
1558 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxattributes_getQName()

static HRESULT WINAPI isaxattributes_getQName ( ISAXAttributes *  iface,
int  index,
const WCHAR **  QName,
int QNameLength 
)
static

Definition at line 1522 of file saxreader.c.

1527 {
1528  static const WCHAR attrqnamesW[][15] = {{'a',':','a','t','t','r','1','j','u','n','k',0},
1529  {'a','t','t','r','2','j','u','n','k',0},
1530  {'a','t','t','r','3',0}};
1531  static const int attrqnamelen[] = {7, 5, 5};
1532 
1533  ok(index >= 0 && index <= 2, "invalid index received %d\n", index);
1534 
1535  if (index >= 0 && index <= 2) {
1536  *QName = attrqnamesW[index];
1537  *QNameLength = attrqnamelen[index];
1538  } else {
1539  *QName = NULL;
1540  *QNameLength = 0;
1541  }
1542 
1543  return S_OK;
1544 }
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define index(s, c)
Definition: various.h:29
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ isaxattributes_getType()

static HRESULT WINAPI isaxattributes_getType ( ISAXAttributes *  iface,
int  nIndex,
const WCHAR **  pType,
int pTypeLength 
)
static

Definition at line 1582 of file saxreader.c.

1587 {
1588  ok(0, "unexpected call\n");
1589  return E_NOTIMPL;
1590 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxattributes_getTypeFromName()

static HRESULT WINAPI isaxattributes_getTypeFromName ( ISAXAttributes *  iface,
const WCHAR pUri,
int  nUri,
const WCHAR pLocalName,
int  nLocalName,
const WCHAR **  pType,
int nType 
)
static

Definition at line 1592 of file saxreader.c.

1600 {
1601  ok(0, "unexpected call\n");
1602  return E_NOTIMPL;
1603 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxattributes_getTypeFromQName()

static HRESULT WINAPI isaxattributes_getTypeFromQName ( ISAXAttributes *  iface,
const WCHAR pQName,
int  nQName,
const WCHAR **  pType,
int nType 
)
static

Definition at line 1605 of file saxreader.c.

1611 {
1612  ok(0, "unexpected call\n");
1613  return E_NOTIMPL;
1614 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxattributes_getURI()

static HRESULT WINAPI isaxattributes_getURI ( ISAXAttributes *  iface,
int  nIndex,
const WCHAR **  pUrl,
int pUriSize 
)
static

Definition at line 1502 of file saxreader.c.

1507 {
1508  ok(0, "unexpected call\n");
1509  return E_NOTIMPL;
1510 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxattributes_getValue()

static HRESULT WINAPI isaxattributes_getValue ( ISAXAttributes *  iface,
int  index,
const WCHAR **  value,
int nValue 
)
static

Definition at line 1616 of file saxreader.c.

1618 {
1619  static const WCHAR attrvaluesW[][10] = {{'a','1','j','u','n','k',0},
1620  {'a','2','j','u','n','k',0},
1621  {'<','&','"','>','\'',0}};
1622  static const int attrvalueslen[] = {2, 2, 5};
1623 
1624  ok(index >= 0 && index <= 2, "invalid index received %d\n", index);
1625 
1626  if (index >= 0 && index <= 2) {
1627  *value = attrvaluesW[index];
1628  *nValue = attrvalueslen[index];
1629  } else {
1630  *value = NULL;
1631  *nValue = 0;
1632  }
1633 
1634  return S_OK;
1635 }
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define index(s, c)
Definition: various.h:29
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ isaxattributes_getValueFromName()

static HRESULT WINAPI isaxattributes_getValueFromName ( ISAXAttributes *  iface,
const WCHAR pUri,
int  nUri,
const WCHAR pLocalName,
int  nLocalName,
const WCHAR **  pValue,
int nValue 
)
static

Definition at line 1637 of file saxreader.c.

1645 {
1646  ok(0, "unexpected call\n");
1647  return E_NOTIMPL;
1648 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxattributes_getValueFromQName()

static HRESULT WINAPI isaxattributes_getValueFromQName ( ISAXAttributes *  iface,
const WCHAR pQName,
int  nQName,
const WCHAR **  pValue,
int nValue 
)
static

Definition at line 1650 of file saxreader.c.

1656 {
1657  ok(0, "unexpected call\n");
1658  return E_NOTIMPL;
1659 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxattributes_QueryInterface()

static HRESULT WINAPI isaxattributes_QueryInterface ( ISAXAttributes *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1467 of file saxreader.c.

1471 {
1472  *ppvObject = NULL;
1473 
1474  if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ISAXAttributes))
1475  {
1476  *ppvObject = iface;
1477  }
1478  else
1479  {
1480  return E_NOINTERFACE;
1481  }
1482 
1483  return S_OK;
1484 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ isaxattributes_Release()

static ULONG WINAPI isaxattributes_Release ( ISAXAttributes *  iface)
static

Definition at line 1491 of file saxreader.c.

1492 {
1493  return 1;
1494 }

◆ isaxdecl_AddRef()

static ULONG WINAPI isaxdecl_AddRef ( ISAXDeclHandler *  iface)
static

Definition at line 1849 of file saxreader.c.

1850 {
1852  return InterlockedIncrement(&handler->ref);
1853 }
static struct saxdeclhandler * impl_from_ISAXDeclHandler(ISAXDeclHandler *iface)
Definition: saxreader.c:1819
#define InterlockedIncrement
Definition: armddk.h:53
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

◆ isaxdecl_attributeDecl()

static HRESULT WINAPI isaxdecl_attributeDecl ( ISAXDeclHandler *  iface,
const WCHAR pElementName,
int  nElementName,
const WCHAR pAttributeName,
int  nAttributeName,
const WCHAR pType,
int  nType,
const WCHAR pValueDefault,
int  nValueDefault,
const WCHAR pValue,
int  nValue 
)
static

Definition at line 1868 of file saxreader.c.

1872 {
1873  ok(0, "call not expected\n");
1874  return E_NOTIMPL;
1875 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxdecl_elementDecl()

static HRESULT WINAPI isaxdecl_elementDecl ( ISAXDeclHandler *  iface,
const WCHAR pName,
int  nName,
const WCHAR pModel,
int  nModel 
)
static

Definition at line 1861 of file saxreader.c.

1863 {
1864  ok(0, "call not expected\n");
1865  return E_NOTIMPL;
1866 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxdecl_externalEntityDecl()

static HRESULT WINAPI isaxdecl_externalEntityDecl ( ISAXDeclHandler *  iface,
const WCHAR pName,
int  nName,
const WCHAR pPublicId,
int  nPublicId,
const WCHAR pSystemId,
int  nSystemId 
)
static

Definition at line 1884 of file saxreader.c.

1887 {
1888  ok(0, "call not expected\n");
1889  return E_NOTIMPL;
1890 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxdecl_internalEntityDecl()

static HRESULT WINAPI isaxdecl_internalEntityDecl ( ISAXDeclHandler *  iface,
const WCHAR pName,
int  nName,
const WCHAR pValue,
int  nValue 
)
static

Definition at line 1877 of file saxreader.c.

1879 {
1880  ok(0, "call not expected\n");
1881  return E_NOTIMPL;
1882 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxdecl_QueryInterface()

static HRESULT WINAPI isaxdecl_QueryInterface ( ISAXDeclHandler *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 1824 of file saxreader.c.

1825 {
1827 
1828  *out = NULL;
1829 
1830  if (IsEqualGUID(riid, &IID_IUnknown))
1831  {
1832  *out = iface;
1833  ok(0, "got unexpected IID_IUnknown query\n");
1834  }
1835  else if (IsEqualGUID(riid, &IID_ISAXDeclHandler))
1836  {
1837  if (handler->qi_hr == E_NOINTERFACE) return handler->qi_hr;
1838  *out = iface;
1839  }
1840 
1841  if (*out)
1842  ISAXDeclHandler_AddRef(iface);
1843  else
1844  return E_NOINTERFACE;
1845 
1846  return S_OK;
1847 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
static struct saxdeclhandler * impl_from_ISAXDeclHandler(ISAXDeclHandler *iface)
Definition: saxreader.c:1819
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
static FILE * out
Definition: regtests2xml.c:44
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

◆ isaxdecl_Release()

static ULONG WINAPI isaxdecl_Release ( ISAXDeclHandler *  iface)
static

Definition at line 1855 of file saxreader.c.

1856 {
1858  return InterlockedDecrement(&handler->ref);
1859 }
static struct saxdeclhandler * impl_from_ISAXDeclHandler(ISAXDeclHandler *iface)
Definition: saxreader.c:1819
#define InterlockedDecrement
Definition: armddk.h:52
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

◆ isaxerrorHandler_AddRef()

static ULONG WINAPI isaxerrorHandler_AddRef ( ISAXErrorHandler *  iface)
static

Definition at line 1405 of file saxreader.c.

1407 {
1408  return 2;
1409 }

◆ isaxerrorHandler_error()

static HRESULT WINAPI isaxerrorHandler_error ( ISAXErrorHandler *  iface,
ISAXLocator *  pLocator,
const WCHAR pErrorMessage,
HRESULT  hrErrorCode 
)
static

Definition at line 1417 of file saxreader.c.

1422 {
1423  ok(0, "unexpected call\n");
1424  return S_OK;
1425 }
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ isaxerrorHandler_fatalError()

static HRESULT WINAPI isaxerrorHandler_fatalError ( ISAXErrorHandler *  iface,
ISAXLocator *  pLocator,
const WCHAR message,
HRESULT  hr 
)
static

Definition at line 1427 of file saxreader.c.

1432 {
1433  struct call_entry call;
1434 
1435  init_call_entry(locator, &call);
1436  call.id = EH_FATALERROR;
1437  call.ret = hr;
1438 
1440 
1441  get_expected_ret();
1442  return S_OK;
1443 }
static void init_call_entry(ISAXLocator *locator, struct call_entry *call)
Definition: saxreader.c:246
HRESULT hr
Definition: shlfolder.c:183
static struct call_sequence * sequences[NUM_CALL_SEQUENCES]
Definition: saxreader.c:244
Definition: saxreader.c:216
#define CONTENT_HANDLER_INDEX
Definition: saxreader.c:242
static void add_call(struct call_sequence **seq, int sequence_index, const struct call_entry *call)
Definition: saxreader.c:253
#define S_OK
Definition: intsafe.h:59
static HRESULT get_expected_ret(void)
Definition: saxreader.c:1047

◆ isaxerrorHandler_ignorableWarning()

static HRESULT WINAPI isaxerrorHandler_ignorableWarning ( ISAXErrorHandler *  iface,
ISAXLocator *  pLocator,
const WCHAR pErrorMessage,
HRESULT  hrErrorCode 
)
static

Definition at line 1445 of file saxreader.c.

1450 {
1451  ok(0, "unexpected call\n");
1452  return S_OK;
1453 }
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ isaxerrorHandler_QueryInterface()

static HRESULT WINAPI isaxerrorHandler_QueryInterface ( ISAXErrorHandler *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1386 of file saxreader.c.

1390 {
1391  *ppvObject = NULL;
1392 
1393  if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ISAXErrorHandler))
1394  {
1395  *ppvObject = iface;
1396  }
1397  else
1398  {
1399  return E_NOINTERFACE;
1400  }
1401 
1402  return S_OK;
1403 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ isaxerrorHandler_Release()

static ULONG WINAPI isaxerrorHandler_Release ( ISAXErrorHandler *  iface)
static

Definition at line 1411 of file saxreader.c.

1413 {
1414  return 1;
1415 }

◆ isaxlexical_AddRef()

static ULONG WINAPI isaxlexical_AddRef ( ISAXLexicalHandler *  iface)
static

Definition at line 1721 of file saxreader.c.

1722 {
1724  return InterlockedIncrement(&handler->ref);
1725 }
static struct saxlexicalhandler * impl_from_ISAXLexicalHandler(ISAXLexicalHandler *iface)
Definition: saxreader.c:1691
#define InterlockedIncrement
Definition: armddk.h:53
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

◆ isaxlexical_comment()

static HRESULT WINAPI isaxlexical_comment ( ISAXLexicalHandler *  iface,
const WCHAR pChars,
int  nChars 
)
static

Definition at line 1783 of file saxreader.c.

1785 {
1786  ok(0, "call not expected\n");
1787  return E_NOTIMPL;
1788 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxlexical_endCDATA()

static HRESULT WINAPI isaxlexical_endCDATA ( ISAXLexicalHandler *  iface)
static

Definition at line 1772 of file saxreader.c.

1773 {
1774  struct call_entry call;
1775 
1776  init_call_entry(locator, &call);
1777  call.id = LH_ENDCDATA;
1779 
1780  return get_expected_ret();
1781 }
static void init_call_entry(ISAXLocator *locator, struct call_entry *call)
Definition: saxreader.c:246
static struct call_sequence * sequences[NUM_CALL_SEQUENCES]
Definition: saxreader.c:244
Definition: saxreader.c:216
#define CONTENT_HANDLER_INDEX
Definition: saxreader.c:242
static void add_call(struct call_sequence **seq, int sequence_index, const struct call_entry *call)
Definition: saxreader.c:253
static HRESULT get_expected_ret(void)
Definition: saxreader.c:1047

◆ isaxlexical_endDTD()

static HRESULT WINAPI isaxlexical_endDTD ( ISAXLexicalHandler *  iface)
static

Definition at line 1741 of file saxreader.c.

1742 {
1743  ok(0, "call not expected\n");
1744  return E_NOTIMPL;
1745 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxlexical_endEntity()

static HRESULT WINAPI isaxlexical_endEntity ( ISAXLexicalHandler *  iface,
const WCHAR pName,
int  nName 
)
static

Definition at line 1754 of file saxreader.c.

1756 {
1757  ok(0, "call not expected\n");
1758  return E_NOTIMPL;
1759 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxlexical_QueryInterface()

static HRESULT WINAPI isaxlexical_QueryInterface ( ISAXLexicalHandler *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 1696 of file saxreader.c.

1697 {
1699 
1700  *out = NULL;
1701 
1702  if (IsEqualGUID(riid, &IID_IUnknown))
1703  {
1704  *out = iface;
1705  ok(0, "got unexpected IID_IUnknown query\n");
1706  }
1707  else if (IsEqualGUID(riid, &IID_ISAXLexicalHandler))
1708  {
1709  if (handler->qi_hr == E_NOINTERFACE) return handler->qi_hr;
1710  *out = iface;
1711  }
1712 
1713  if (*out)
1714  ISAXLexicalHandler_AddRef(iface);
1715  else
1716  return E_NOINTERFACE;
1717 
1718  return S_OK;
1719 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
static FILE * out
Definition: regtests2xml.c:44
static struct saxlexicalhandler * impl_from_ISAXLexicalHandler(ISAXLexicalHandler *iface)
Definition: saxreader.c:1691
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

◆ isaxlexical_Release()

static ULONG WINAPI isaxlexical_Release ( ISAXLexicalHandler *  iface)
static

Definition at line 1727 of file saxreader.c.

1728 {
1730  return InterlockedDecrement(&handler->ref);
1731 }
#define InterlockedDecrement
Definition: armddk.h:52
static struct saxlexicalhandler * impl_from_ISAXLexicalHandler(ISAXLexicalHandler *iface)
Definition: saxreader.c:1691
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

◆ isaxlexical_startCDATA()

static HRESULT WINAPI isaxlexical_startCDATA ( ISAXLexicalHandler *  iface)
static

Definition at line 1761 of file saxreader.c.

1762 {
1763  struct call_entry call;
1764 
1765  init_call_entry(locator, &call);
1766  call.id = LH_STARTCDATA;
1768 
1769  return get_expected_ret();
1770 }
static void init_call_entry(ISAXLocator *locator, struct call_entry *call)
Definition: saxreader.c:246
static struct call_sequence * sequences[NUM_CALL_SEQUENCES]
Definition: saxreader.c:244
Definition: saxreader.c:216
#define CONTENT_HANDLER_INDEX
Definition: saxreader.c:242
static void add_call(struct call_sequence **seq, int sequence_index, const struct call_entry *call)
Definition: saxreader.c:253
static HRESULT get_expected_ret(void)
Definition: saxreader.c:1047

◆ isaxlexical_startDTD()

static HRESULT WINAPI isaxlexical_startDTD ( ISAXLexicalHandler *  iface,
const WCHAR pName,
int  nName,
const WCHAR pPublicId,
int  nPublicId,
const WCHAR pSystemId,
int  nSystemId 
)
static

Definition at line 1733 of file saxreader.c.

1736 {
1737  ok(0, "call not expected\n");
1738  return E_NOTIMPL;
1739 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ isaxlexical_startEntity()

static HRESULT WINAPI isaxlexical_startEntity ( ISAXLexicalHandler *  iface,
const WCHAR pName,
int  nName 
)
static

Definition at line 1747 of file saxreader.c.

1749 {
1750  ok(0, "call not expected\n");
1751  return E_NOTIMPL;
1752 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ istream_AddRef()

static ULONG WINAPI istream_AddRef ( IStream iface)
static

Definition at line 1941 of file saxreader.c.

1942 {
1943  return 2;
1944 }

◆ istream_Clone()

static HRESULT WINAPI istream_Clone ( IStream iface,
IStream **  ppstm 
)
static

Definition at line 2014 of file saxreader.c.

2015 {
2016  ok(0, "unexpected call\n");
2017  return E_NOTIMPL;
2018 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ istream_Commit()

static HRESULT WINAPI istream_Commit ( IStream iface,
DWORD  grfCommitFlags 
)
static

Definition at line 1983 of file saxreader.c.

1984 {
1985  ok(0, "unexpected call\n");
1986  return E_NOTIMPL;
1987 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ istream_CopyTo()

static HRESULT WINAPI istream_CopyTo ( IStream iface,
IStream pstm,
ULARGE_INTEGER  cb,
ULARGE_INTEGER pcbRead,
ULARGE_INTEGER plibWritten 
)
static

Definition at line 1976 of file saxreader.c.

1978 {
1979  ok(0, "unexpected call\n");
1980  return E_NOTIMPL;
1981 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ istream_LockRegion()

static HRESULT WINAPI istream_LockRegion ( IStream iface,
ULARGE_INTEGER  libOffset,
ULARGE_INTEGER  cb,
DWORD  dwLockType 
)
static

Definition at line 1995 of file saxreader.c.

1997 {
1998  ok(0, "unexpected call\n");
1999  return E_NOTIMPL;
2000 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ istream_QueryInterface()

static HRESULT WINAPI istream_QueryInterface ( IStream iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1927 of file saxreader.c.

1928 {
1929  *ppvObject = NULL;
1930 
1931  ok(!IsEqualGUID(riid, &IID_IPersistStream), "Did not expect QI for IPersistStream\n");
1932 
1933  if(IsEqualGUID(riid, &IID_IStream) || IsEqualGUID(riid, &IID_IUnknown))
1934  *ppvObject = iface;
1935  else
1936  return E_NOINTERFACE;
1937 
1938  return S_OK;
1939 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
const GUID IID_IPersistStream
Definition: proxy.cpp:13
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ istream_Read()

static HRESULT WINAPI istream_Read ( IStream iface,
void pv,
ULONG  cb,
ULONG pcbRead 
)
static

Definition at line 1951 of file saxreader.c.

1952 {
1953  ok(0, "unexpected call\n");
1954  return E_NOTIMPL;
1955 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ istream_Release()

static ULONG WINAPI istream_Release ( IStream iface)
static

Definition at line 1946 of file saxreader.c.

1947 {
1948  return 1;
1949 }

◆ istream_Revert()

static HRESULT WINAPI istream_Revert ( IStream iface)
static

Definition at line 1989 of file saxreader.c.

1990 {
1991  ok(0, "unexpected call\n");
1992  return E_NOTIMPL;
1993 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ istream_Seek()

static HRESULT WINAPI istream_Seek ( IStream iface,
LARGE_INTEGER  dlibMove,
DWORD  dwOrigin,
ULARGE_INTEGER plibNewPosition 
)
static

Definition at line 1963 of file saxreader.c.

1965 {
1966  ok(0, "unexpected call\n");
1967  return E_NOTIMPL;
1968 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ istream_SetSize()

static HRESULT WINAPI istream_SetSize ( IStream iface,
ULARGE_INTEGER  libNewSize 
)
static

Definition at line 1970 of file saxreader.c.

1971 {
1972  ok(0, "unexpected call\n");
1973  return E_NOTIMPL;
1974 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ istream_Stat()

static HRESULT WINAPI istream_Stat ( IStream iface,
STATSTG *  pstatstg,
DWORD  grfStatFlag 
)
static

Definition at line 2009 of file saxreader.c.

2010 {
2011  return E_NOTIMPL;
2012 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ istream_UnlockRegion()

static HRESULT WINAPI istream_UnlockRegion ( IStream iface,
ULARGE_INTEGER  libOffset,
ULARGE_INTEGER  cb,
DWORD  dwLockType 
)
static

Definition at line 2002 of file saxreader.c.

2004 {
2005  ok(0, "unexpected call\n");
2006  return E_NOTIMPL;
2007 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ istream_Write()

static HRESULT WINAPI istream_Write ( IStream iface,
const void pv,
ULONG  cb,
ULONG pcbWritten 
)
static

Definition at line 1957 of file saxreader.c.

1958 {
1959  ok(0, "unexpected call\n");
1960  return E_NOTIMPL;
1961 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ mxstream_Write()

static HRESULT WINAPI mxstream_Write ( IStream iface,
const void pv,
ULONG  cb,
ULONG pcbWritten 
)
static

Definition at line 2020 of file saxreader.c.

2021 {
2022  BOOL fail = FALSE;
2023 
2024  ok(pv != NULL, "pv == NULL\n");
2025 
2026  if(current_write_test->last) {
2027  ok(0, "Too many Write calls made on test %d\n", current_stream_test_index);
2028  return E_FAIL;
2029  }
2030 
2032 
2033  ok(current_write_test->cb == cb, "Expected %d, but got %d on test %d\n",
2035 
2036  if(!pcbWritten)
2037  ok(current_write_test->null_written, "pcbWritten was NULL on test %d\n", current_stream_test_index);
2038  else
2039  ok(!memcmp(current_write_test->data, pv, cb), "Unexpected data on test %d\n", current_stream_test_index);
2040 
2042 
2043  if(pcbWritten)
2044  *pcbWritten = cb;
2045 
2046  return fail ? E_FAIL : S_OK;
2047 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define E_FAIL
Definition: ddrawi.h:102
unsigned int BOOL
Definition: ntddk_ex.h:94
const BYTE * data
Definition: saxreader.c:1912
smooth NULL
Definition: ftsmooth.c:416
static DWORD current_stream_test_index
Definition: saxreader.c:1925
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static const mxwriter_write_test * current_write_test
Definition: saxreader.c:1924
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32

◆ ok_sequence_()

static void ok_sequence_ ( struct call_sequence **  seq,
int  sequence_index,
const struct call_entry expected,
const char context,
BOOL  todo,
const char file,
int  line 
)
static

Definition at line 356 of file saxreader.c.

359 {
360  struct call_sequence *call_seq = seq[sequence_index];
361  static const struct call_entry end_of_sequence = { CH_ENDTEST };
362  const struct call_entry *actual, *sequence;
363  int failcount = 0;
364 
365  add_call(seq, sequence_index, &end_of_sequence);
366 
367  sequence = call_seq->sequence;
368  actual = sequence;
369 
370  while (expected->id != CH_ENDTEST && actual->id != CH_ENDTEST)
371  {
372  if (expected->id == actual->id)
373  {
374  if (expected->line != -1)
375  {
376  /* always test position data */
377  if (expected->line != actual->line && todo)
378  {
379  todo_wine
380  {
381  failcount++;
382  ok_(file, line) (FALSE,
383  "%s: in event %s expecting line %d got %d\n",
384  context, get_event_name(actual->id), expected->line, actual->line);
385  }
386  }
387  else
388  {
389  ok_(file, line) (expected->line == actual->line,
390  "%s: in event %s expecting line %d got %d\n",
391  context, get_event_name(actual->id), expected->line, actual->line);
392  }
393  }
394 
395 
396  if (expected->column != -1)
397  {
398  if (expected->column != actual->column && todo)
399  {
400  todo_wine
401  {
402  failcount++;
403  ok_(file, line) (FALSE,
404  "%s: in event %s expecting column %d got %d\n",
405  context, get_event_name(actual->id), expected->column, actual->column);
406  }
407  }
408  else
409  {
410  ok_(file, line) (expected->column == actual->column,
411  "%s: in event %s expecting column %d got %d\n",
412  context, get_event_name(actual->id), expected->column, actual->column);
413  }
414  }
415 
416  switch (actual->id)
417  {
419  case CH_STARTDOCUMENT:
420  case CH_ENDDOCUMENT:
421  case LH_STARTCDATA:
422  case LH_ENDCDATA:
423  break;
425  /* prefix, uri */
426  test_saxstr(file, line, actual->arg1W, expected->arg1, todo, &failcount);
427  test_saxstr(file, line, actual->arg2W, expected->arg2, todo, &failcount);
428  break;
429  case CH_ENDPREFIXMAPPING:
430  /* prefix */
431  test_saxstr(file, line, actual->arg1W, expected->arg1, todo, &failcount);
432  break;
433  case CH_STARTELEMENT:
434  /* compare attributes */
435  compare_attributes(actual, expected, context, todo, file, line, &failcount);
436  /* fallthrough */
437  case CH_ENDELEMENT:
438  /* uri, localname, qname */
439  test_saxstr(file, line, actual->arg1W, expected->arg1, todo, &failcount);
440  test_saxstr(file, line, actual->arg2W, expected->arg2, todo, &failcount);
441  test_saxstr(file, line, actual->arg3W, expected->arg3, todo, &failcount);
442  break;
443  case CH_CHARACTERS:
445  /* char data */
446  test_saxstr(file, line, actual->arg1W, expected->arg1, todo, &failcount);
447  break;
449  /* target, data */
450  test_saxstr(file, line, actual->arg1W, expected->arg1, todo, &failcount);
451  test_saxstr(file, line, actual->arg2W, expected->arg2, todo, &failcount);
452  break;
453  case CH_SKIPPEDENTITY:
454  /* name */
455  test_saxstr(file, line, actual->arg1W, expected->arg1, todo, &failcount);
456  break;
457  case EH_FATALERROR:
458  /* test return value only */
459  if (expected->ret != actual->ret && todo)
460  {
461  failcount++;
462  ok_(file, line) (FALSE,
463  "%s: in event %s expecting ret 0x%08x got 0x%08x\n",
464  context, get_event_name(actual->id), expected->ret, actual->ret);
465  }
466  else
467  ok_(file, line) (expected->ret == actual->ret,
468  "%s: in event %s expecting ret 0x%08x got 0x%08x\n",
469  context, get_event_name(actual->id), expected->ret, actual->ret);
470  break;
471  case EH_ERROR:
472  case EH_IGNORABLEWARNING:
473  default:
474  ok(0, "%s: callback not handled, %s\n", context, get_event_name(actual->id));
475  }
476  expected++;
477  actual++;
478  }
479  else if (todo)
480  {
481  failcount++;
482  todo_wine
483  {
484  ok_(file, line) (FALSE, "%s: call %s was expected, but got call %s instead\n",
486  }
487 
488  flush_sequence(seq, sequence_index);
489  return;
490  }
491  else
492  {
493  ok_(file, line) (FALSE, "%s: call %s was expected, but got call %s instead\n",
495  expected++;
496  actual++;
497  }
498  }
499 
500  if (todo)
501  {
502  todo_wine
503  {
504  if (expected->id != CH_ENDTEST || actual->id != CH_ENDTEST)
505  {
506  failcount++;
507  ok_(file, line) (FALSE, "%s: the call sequence is not complete: expected %s - actual %s\n",
509  }
510  }
511  }
512  else if (expected->id != CH_ENDTEST || actual->id != CH_ENDTEST)
513  {
514  ok_(file, line) (FALSE, "%s: the call sequence is not complete: expected %s - actual %s\n",
516  }
517 
518  if (todo && !failcount) /* succeeded yet marked todo */
519  {
520  todo_wine
521  {
522  ok_(file, line)(TRUE, "%s: marked \"todo_wine\" but succeeds\n", context);
523  }
524  }
525 
526  flush_sequence(seq, sequence_index);
527 }
int line
Definition: saxreader.c:218
BSTR arg2W
Definition: saxreader.c:231
#define TRUE
Definition: types.h:120
Definition: http.c:7094
BOOL todo
Definition: filedlg.c:313
static const char * get_event_name(CH event)
Definition: saxreader.c:315
Definition: saxreader.c:216
int column
Definition: saxreader.c:219
static void test_saxstr(const char *file, unsigned line, BSTR str, const char *expected, BOOL todo, int *failcount)
Definition: saxreader.c:106
static void flush_sequence(struct call_sequence **seg, int sequence_index)
Definition: saxreader.c:285
HRESULT ret
Definition: saxreader.c:220
Definition: parser.c:48
static void add_call(struct call_sequence **seq, int sequence_index, const struct call_entry *call)
Definition: saxreader.c:253
#define todo_wine
Definition: test.h:162
static struct message * sequence
Definition: subclass.c:46
static void compare_attributes(const struct call_entry *actual, const struct call_entry *expected, const char *context, BOOL todo, const char *file, int line, int *failcount)
Definition: saxreader.c:320
BSTR arg1W
Definition: saxreader.c:230
#define ok(value,...)
Definition: atltest.h:57
BSTR arg3W
Definition: saxreader.c:232
struct call_entry * sequence
Definition: saxreader.c:239
CH id
Definition: saxreader.c:217
BOOL expected
Definition: store.c:2063
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: fci.c:126

◆ set_expected_seq()

static void set_expected_seq ( struct call_entry expected)
static

Definition at line 1041 of file saxreader.c.

1042 {
1043  expectCall = expected;
1044 }
static struct call_entry * expectCall
Definition: saxreader.c:1036
BOOL expected
Definition: store.c:2063

Referenced by test_saxreader().

◆ START_TEST()

START_TEST ( saxreader  )

Definition at line 5754 of file saxreader.c.

5755 {
5756  ISAXXMLReader *reader;
5757  HRESULT hr;
5758 
5759  hr = CoInitialize(NULL);
5760  ok(hr == S_OK, "failed to init com\n");
5761 
5762  hr = CoCreateInstance(&CLSID_SAXXMLReader, NULL, CLSCTX_INPROC_SERVER,
5763  &IID_ISAXXMLReader, (void**)&reader);
5764 
5765  if(FAILED(hr))
5766  {
5767  win_skip("Failed to create SAXXMLReader instance\n");
5768  CoUninitialize();
5769  return;
5770  }
5771  ISAXXMLReader_Release(reader);
5772 
5774 
5775  get_class_support_data(reader_support_data, &IID_ISAXXMLReader);
5776 
5777  test_saxreader();
5782 
5783  /* MXXMLWriter tests */
5785  if (is_clsid_supported(&CLSID_MXXMLWriter, mxwriter_support_data))
5786  {
5793  test_mxwriter_pi();
5802  }
5803  else
5804  win_skip("MXXMLWriter not supported\n");
5805 
5806  /* SAXAttributes tests */
5808  if (is_clsid_supported(&CLSID_SAXAttributes, mxattributes_support_data))
5809  {
5810  test_mxattr_qi();
5815  }
5816  else
5817  win_skip("SAXAttributes not supported\n");
5818 
5819  CoUninitialize();
5820 }
HRESULT hr
Definition: shlfolder.c:183
static void test_saxreader_dispex(void)
Definition: saxreader.c:4592
static struct msxmlsupported_data_t mxwriter_support_data[]
Definition: saxreader.c:3000
static struct call_sequence * sequences[NUM_CALL_SEQUENCES]
Definition: saxreader.c:244
static BOOL is_clsid_supported(const GUID *clsid, const struct msxmlsupported_data_t *table)
Definition: saxreader.c:70
static void test_saxreader_features(void)
Definition: saxreader.c:2795
static void test_mxwriter_encoding(void)
Definition: saxreader.c:4395
static void test_mxwriter_indent(void)
Definition: saxreader.c:5697
static void test_saxreader_properties(void)
Definition: saxreader.c:2569
static void test_mxwriter_characters(void)
Definition: saxreader.c:3972
static void test_mxwriter_cdata(void)
Definition: saxreader.c:4752
smooth NULL
Definition: ftsmooth.c:416
static void test_saxreader(void)
Definition: saxreader.c:2138
static void test_mxattr_localname(void)
Definition: saxreader.c:5610
static void test_mxwriter_handlers(void)
Definition: saxreader.c:2951
static void test_mxwriter_properties(void)
Definition: saxreader.c:3099
LONG HRESULT
Definition: typedefs.h:78
static void init_call_sequences(struct call_sequence **seq, int n)
Definition: saxreader.c:532
static struct msxmlsupported_data_t reader_support_data[]
Definition: saxreader.c:2108
static void test_mxwriter_flush(void)
Definition: saxreader.c:3250
static void test_mxattr_dispex(void)
Definition: saxreader.c:5542
static void test_mxattr_qi(void)
Definition: saxreader.c:5563
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
static void test_mxwriter_dtd(void)
Definition: saxreader.c:4913
static void test_mxwriter_startendelement(void)
Definition: saxreader.c:3835
#define S_OK
Definition: intsafe.h:59
static void get_class_support_data(struct msxmlsupported_data_t *table, REFIID riid)
Definition: saxreader.c:3654
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define ok(value,...)
Definition: atltest.h:57
static void test_mxwriter_ignorablespaces(void)
Definition: saxreader.c:4875
static struct msxmlsupported_data_t mxattributes_support_data[]
Definition: saxreader.c:3009
Definition: reader.h:83
static void test_mxwriter_pi(void)
Definition: saxreader.c:4814
static void test_saxreader_encoding(void)
Definition: saxreader.c:2905
static void test_mxattr_clear(void)
Definition: saxreader.c:5473
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
static void test_mxattr_addAttribute(void)
Definition: saxreader.c:5231
static void test_mxwriter_dispex(void)
Definition: saxreader.c:4662
#define win_skip
Definition: test.h:149
static void test_mxwriter_startenddocument(void)
Definition: saxreader.c:3450
#define NUM_CALL_SEQUENCES
Definition: saxreader.c:243
static void test_mxwriter_comment(void)
Definition: saxreader.c:4690
static void test_mxwriter_stream(void)
Definition: saxreader.c:4252

◆ test_mxattr_addAttribute()

static void test_mxattr_addAttribute ( void  )
static

Definition at line 5231 of file saxreader.c.

5232 {
5234  int i = 0;
5235 
5236  while (table->clsid)
5237  {
5238  ISAXAttributes *saxattr;
5239  IMXAttributes *mxattr;
5240  const WCHAR *value;
5241  int len, index;
5242  HRESULT hr;
5243 
5245  {
5246  table++;
5247  i++;
5248  continue;
5249  }
5250 
5251  hr = CoCreateInstance(table->clsid, NULL, CLSCTX_INPROC_SERVER,
5252  &IID_IMXAttributes, (void**)&mxattr);
5253  EXPECT_HR(hr, S_OK);
5254 
5255  hr = IMXAttributes_QueryInterface(mxattr, &IID_ISAXAttributes, (void**)&saxattr);
5256  EXPECT_HR(hr, S_OK);
5257 
5258  /* SAXAttributes40 and SAXAttributes60 both crash on this test */
5259  if (IsEqualGUID(table->clsid, &CLSID_SAXAttributes) ||
5260  IsEqualGUID(table->clsid, &CLSID_SAXAttributes30))
5261  {
5262  hr = ISAXAttributes_getLength(saxattr, NULL);
5264  }
5265 
5266  len = -1;
5267  hr = ISAXAttributes_getLength(saxattr, &len);
5268  EXPECT_HR(hr, S_OK);
5269  ok(len == 0, "got %d\n", len);
5270 
5271  hr = ISAXAttributes_getValue(saxattr, 0, &value, &len);
5273 
5274  hr = ISAXAttributes_getValue(saxattr, 0, NULL, &len);
5275  ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr);
5276 
5277  hr = ISAXAttributes_getValue(saxattr, 0, &value, NULL);
5278  ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr);
5279 
5280  hr = ISAXAttributes_getValue(saxattr, 0, NULL, NULL);
5281  ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr);
5282 
5283  hr = ISAXAttributes_getType(saxattr, 0, &value, &len);
5285 
5286  hr = ISAXAttributes_getType(saxattr, 0, NULL, &len);
5287  ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr);
5288 
5289  hr = ISAXAttributes_getType(saxattr, 0, &value, NULL);
5290  ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr);
5291 
5292  hr = ISAXAttributes_getType(saxattr, 0, NULL, NULL);
5293  ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr);
5294 
5295  hr = IMXAttributes_addAttribute(mxattr, _bstr_(table->uri), _bstr_(table->local),
5296  _bstr_(table->qname), _bstr_(table->type), _bstr_(table->value));
5297  ok(hr == table->hr, "%d: got 0x%08x, expected 0x%08x\n", i, hr, table->hr);
5298 
5299  if (hr == S_OK)
5300  {
5301  /* SAXAttributes40 and SAXAttributes60 both crash on this test */
5302  if (IsEqualGUID(table->clsid, &CLSID_SAXAttributes) ||
5303  IsEqualGUID(table->clsid, &CLSID_SAXAttributes30))
5304  {
5305  hr = ISAXAttributes_getValue(saxattr, 0, NULL, &len);
5307 
5308  hr = ISAXAttributes_getValue(saxattr, 0, &value, NULL);
5310 
5311  hr = ISAXAttributes_getValue(saxattr, 0, NULL, NULL);
5313 
5314  hr = ISAXAttributes_getType(saxattr, 0, NULL, &len);
5316 
5317  hr = ISAXAttributes_getType(saxattr, 0, &value, NULL);
5319 
5320  hr = ISAXAttributes_getType(saxattr, 0, NULL, NULL);
5322  }
5323 
5324  len = -1;
5325  hr = ISAXAttributes_getValue(saxattr, 0, &value, &len);
5326  EXPECT_HR(hr, S_OK);
5327  ok(!lstrcmpW(_bstr_(table->value), value), "%d: got %s, expected %s\n", i, wine_dbgstr_w(value),
5328  table->value);
5329  ok(lstrlenW(value) == len, "%d: got wrong value length %d\n", i, len);
5330 
5331  len = -1;
5332  value = (void*)0xdeadbeef;
5333  hr = ISAXAttributes_getType(saxattr, 0, &value, &len);
5334  EXPECT_HR(hr, S_OK);
5335 
5336  if (table->type)
5337  {
5338  ok(!lstrcmpW(_bstr_(table->type), value), "%d: got %s, expected %s\n", i, wine_dbgstr_w(value),
5339  table->type);
5340  ok(lstrlenW(value) == len, "%d: got wrong type value length %d\n", i, len);
5341  }
5342  else
5343  {
5344  ok(*value == 0, "%d: got type value %s\n", i, wine_dbgstr_w(value));
5345  ok(len == 0, "%d: got wrong type value length %d\n", i, len);
5346  }
5347 
5348  hr = ISAXAttributes_getIndexFromQName(saxattr, NULL, 0, NULL);
5349  if (IsEqualGUID(table->clsid, &CLSID_SAXAttributes) ||
5350  IsEqualGUID(table->clsid, &CLSID_SAXAttributes30))
5351  {
5353  }
5354  else
5356 
5357  hr = ISAXAttributes_getIndexFromQName(saxattr, NULL, 0, &index);
5359 
5360  index = -1;
5361  hr = ISAXAttributes_getIndexFromQName(saxattr, _bstr_("nonexistent"), 11, &index);
5363  ok(index == -1, "%d: got wrong index %d\n", i, index);
5364 
5365  index = -1;
5366  hr = ISAXAttributes_getIndexFromQName(saxattr, _bstr_(table->qname), 0, &index);
5368  ok(index == -1, "%d: got wrong index %d\n", i, index);
5369 
5370  index = -1;
5371  hr = ISAXAttributes_getIndexFromQName(saxattr, _bstr_(table->qname), strlen(table->qname), &index);
5372  EXPECT_HR(hr, S_OK);
5373  ok(index == 0, "%d: got wrong index %d\n", i, index);
5374 
5375  index = -1;
5376  hr = ISAXAttributes_getIndexFromQName(saxattr, _bstr_(table->qname), strlen(table->qname)-1, &index);
5378  ok(index == -1, "%d: got wrong index %d\n", i, index);
5379 
5380  if (IsEqualGUID(table->clsid, &CLSID_SAXAttributes40) ||
5381  IsEqualGUID(table->clsid, &CLSID_SAXAttributes60))
5382  {
5383  hr = ISAXAttributes_getValueFromQName(saxattr, NULL, 0, NULL, NULL);
5384  ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr);
5385 
5386  hr = ISAXAttributes_getValueFromQName(saxattr, _bstr_(table->qname), 0, NULL, NULL);
5387  ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr);
5388 
5389  hr = ISAXAttributes_getValueFromQName(saxattr, _bstr_(table->qname), 0, &value, NULL);
5390  ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr);
5391 
5392  hr = ISAXAttributes_getValueFromName(saxattr, NULL, 0, NULL, 0, NULL, NULL);
5393  ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr);
5394 
5395  hr = ISAXAttributes_getValueFromName(saxattr, _bstr_(table->uri), 0, NULL, 0, NULL, NULL);
5396  ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr);
5397 
5398  hr = ISAXAttributes_getValueFromName(saxattr, _bstr_(table->uri), 0, NULL, 0, &value, NULL);
5399  ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr);
5400  }
5401  else
5402  {
5403  hr = ISAXAttributes_getValueFromQName(saxattr, NULL, 0, NULL, NULL);
5405 
5406  hr = ISAXAttributes_getValueFromQName(saxattr, _bstr_(table->qname), 0, NULL, NULL);
5408 
5409  hr = ISAXAttributes_getValueFromQName(saxattr, _bstr_(table->qname), 0, &value, NULL);
5411 
5412  /* versions 4 and 6 crash */
5413  hr = ISAXAttributes_getValueFromQName(saxattr, _bstr_(table->qname), strlen(table->qname), NULL, NULL);
5415 
5416  hr = ISAXAttributes_getValueFromQName(saxattr, _bstr_(table->qname), strlen(table->qname), NULL, &len);
5418 
5419  hr = ISAXAttributes_getValueFromName(saxattr, NULL, 0, NULL, 0, NULL, NULL);
5421 
5422  hr = ISAXAttributes_getValueFromName(saxattr, _bstr_(table->uri), 0, NULL, 0, NULL, NULL);
5424 
5425  hr = ISAXAttributes_getValueFromName(saxattr, _bstr_(table->uri), 0, NULL, 0, &value, NULL);
5427 
5428  hr = ISAXAttributes_getValueFromName(saxattr, _bstr_(table->uri), 0, _bstr_(table->local), 0, &value, NULL);
5430 
5431  hr = ISAXAttributes_getValueFromName(saxattr, _bstr_(table->uri), 0, _bstr_(table->local), 0, NULL, &len);
5433 
5434  hr = ISAXAttributes_getValueFromName(saxattr, _bstr_(table->uri), strlen(table->uri), _bstr_(table->local),
5435  strlen(table->local), NULL, NULL);
5437  }
5438 
5439  hr = ISAXAttributes_getValueFromQName(saxattr, _bstr_(table->qname), strlen(table->qname), &value, &len);
5440  EXPECT_HR(hr, S_OK);
5441  ok(!lstrcmpW(_bstr_(table->value), value), "%d: got %s, expected %s\n", i, wine_dbgstr_w(value),
5442  table->value);
5443  ok(lstrlenW(value) == len, "%d: got wrong value length %d\n", i, len);
5444 
5445  if (table->uri) {
5446  hr = ISAXAttributes_getValueFromName(saxattr, _bstr_(table->uri), strlen(table->uri),
5447  _bstr_(table->local), strlen(table->local), &value, &len);
5448  EXPECT_HR(hr, S_OK);
5449  ok(!lstrcmpW(_bstr_(table->value), value), "%d: got %s, expected %s\n", i, wine_dbgstr_w(value),
5450  table->value);
5451  ok(lstrlenW(value) == len, "%d: got wrong value length %d\n", i, len);
5452  }
5453  }
5454 
5455  len = -1;
5456  hr = ISAXAttributes_getLength(saxattr, &len);
5457  EXPECT_HR(hr, S_OK);
5458  if (table->hr == S_OK)
5459  ok(len == 1, "%d: got %d length, expected 1\n", i, len);
5460  else
5461  ok(len == 0, "%d: got %d length, expected 0\n", i, len);
5462 
5463  ISAXAttributes_Release(saxattr);
5464  IMXAttributes_Release(mxattr);
5465 
5466  table++;
5467  i++;
5468  }
5469 
5470  free_bstrs();
5471 }
HRESULT hr
Definition: shlfolder.c:183
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
static BOOL is_clsid_supported(const GUID *clsid, const struct msxmlsupported_data_t *table)
Definition: saxreader.c:70
#define lstrlenW
Definition: compat.h:416
#define EXPECT_HR(hr, hr_exp)
Definition: saxreader.c:41
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
static void free_bstrs(void)
Definition: saxreader.c:98
#define index(s, c)
Definition: various.h:29
GLenum GLsizei len
Definition: glext.h:6722
GLsizei const GLfloat * value
Definition: glext.h:6069
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static const addattribute_test_t addattribute_data[]
Definition: saxreader.c:5207
static struct msxmlsupported_data_t mxattributes_support_data[]
Definition: saxreader.c:3009
#define E_POINTER
Definition: winerror.h:2365
static BSTR _bstr_(const char *str)
Definition: saxreader.c:91

Referenced by START_TEST().

◆ test_mxattr_clear()

static void test_mxattr_clear ( void  )
static

Definition at line 5473 of file saxreader.c.

5474 {
5475  ISAXAttributes *saxattr;
5476  IMXAttributes *mxattr;
5477  const WCHAR *ptr;
5478  HRESULT hr;
5479  int len;
5480 
5481  hr = CoCreateInstance(&CLSID_SAXAttributes, NULL, CLSCTX_INPROC_SERVER,
5482  &IID_IMXAttributes, (void**)&mxattr);
5483  EXPECT_HR(hr, S_OK);
5484 
5485  hr = IMXAttributes_QueryInterface(mxattr, &IID_ISAXAttributes, (void**)&saxattr);
5486  EXPECT_HR(hr, S_OK);
5487 
5488  hr = ISAXAttributes_getQName(saxattr, 0, NULL, NULL);
5490 
5491  hr = ISAXAttributes_getQName(saxattr, 0, &ptr, &len);
5493 
5494  hr = IMXAttributes_clear(mxattr);
5495  EXPECT_HR(hr, S_OK);
5496 
5497  hr = IMXAttributes_addAttribute(mxattr, _bstr_("uri"), _bstr_("local"),
5498  _bstr_("qname"), _bstr_("type"), _bstr_("value"));
5499  EXPECT_HR(hr, S_OK);
5500 
5501  len = -1;
5502  hr = ISAXAttributes_getLength(saxattr, &len);
5503  EXPECT_HR(hr, S_OK);
5504  ok(len == 1, "got %d\n", len);
5505 
5506  len = -1;
5507  hr = ISAXAttributes_getQName(saxattr, 0, NULL, &len);
5509  ok(len == -1, "got %d\n", len);
5510 
5511  ptr = (void*)0xdeadbeef;
5512  hr = ISAXAttributes_getQName(saxattr, 0, &ptr, NULL);
5514  ok(ptr == (void*)0xdeadbeef, "got %p\n", ptr);
5515 
5516  len = 0;
5517  hr = ISAXAttributes_getQName(saxattr, 0, &ptr, &len);
5518  EXPECT_HR(hr, S_OK);
5519  ok(len == 5, "got %d\n", len);
5520  ok(!lstrcmpW(ptr, _bstr_("qname")), "got %s\n", wine_dbgstr_w(ptr));
5521 
5522  hr = IMXAttributes_clear(mxattr);
5523  EXPECT_HR(hr, S_OK);
5524 
5525  len = -1;
5526  hr = ISAXAttributes_getLength(saxattr, &len);
5527  EXPECT_HR(hr, S_OK);
5528  ok(len == 0, "got %d\n", len);
5529 
5530  len = -1;
5531  ptr = (void*)0xdeadbeef;
5532  hr = ISAXAttributes_getQName(saxattr, 0, &ptr, &len);
5534  ok(len == -1, "got %d\n", len);
5535  ok(ptr == (void*)0xdeadbeef, "got %p\n", ptr);
5536 
5537  IMXAttributes_Release(mxattr);
5538  ISAXAttributes_Release(saxattr);
5539  free_bstrs();
5540 }
HRESULT hr
Definition: shlfolder.c:183
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define EXPECT_HR(hr, hr_exp)
Definition: saxreader.c:41
static PVOID ptr
Definition: dispmode.c:27
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
static void free_bstrs(void)
Definition: saxreader.c:98
GLenum GLsizei len
Definition: glext.h:6722
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define E_POINTER
Definition: winerror.h:2365
static BSTR _bstr_(const char *str)
Definition: saxreader.c:91

Referenced by START_TEST().

◆ test_mxattr_dispex()

static void test_mxattr_dispex ( void  )
static

Definition at line 5542 of file saxreader.c.

5543 {
5544  IMXAttributes *mxattr;
5545  IDispatchEx *dispex;
5546  IUnknown *unk;
5547  HRESULT hr;
5548 
5549  hr = CoCreateInstance(&CLSID_SAXAttributes, NULL, CLSCTX_INPROC_SERVER,
5550  &IID_IMXAttributes, (void**)&mxattr);
5551  EXPECT_HR(hr, S_OK);
5552 
5553  hr = IMXAttributes_QueryInterface(mxattr, &IID_IDispatchEx, (void**)&dispex);
5554  EXPECT_HR(hr, S_OK);
5555  hr = IDispatchEx_QueryInterface(dispex, &IID_IUnknown, (void**)&unk);
5556  test_obj_dispex(unk);
5557  IUnknown_Release(unk);
5558  IDispatchEx_Release(dispex);
5559 
5560  IMXAttributes_Release(mxattr);
5561 }
HRESULT hr
Definition: shlfolder.c:183
#define EXPECT_HR(hr, hr_exp)
Definition: saxreader.c:41
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:78
const GUID IID_IUnknown
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:59
static void test_obj_dispex(IUnknown *obj)
Definition: saxreader.c:4537

Referenced by START_TEST().

◆ test_mxattr_localname()

static void test_mxattr_localname ( void  )
static

Definition at line 5610 of file saxreader.c.

5611 {
5612  static const WCHAR localname1W[] = {'l','o','c','a','l','n','a','m','e','1',0};
5613  static const WCHAR localnameW[] = {'l','o','c','a','l','n','a','m','e',0};
5614  static const WCHAR uri1W[] = {'u','r','i','1',0};
5615  static const WCHAR uriW[] = {'u','r','i',0};
5616 
5618 
5619  while (table->clsid)
5620  {
5621  ISAXAttributes *saxattr;
5622  IMXAttributes *mxattr;
5623  HRESULT hr;
5624  int index;
5625 
5627  {
5628  table++;
5629  continue;
5630  }
5631 
5632  hr = CoCreateInstance(table->clsid, NULL, CLSCTX_INPROC_SERVER,
5633  &IID_IMXAttributes, (void**)&mxattr);
5634  EXPECT_HR(hr, S_OK);
5635