ReactOS 0.4.16-dev-2206-gc56950d
mxwriter.c
Go to the documentation of this file.
1/*
2 * MXWriter implementation
3 *
4 * Copyright 2011-2014, 2016 Nikolay Sivov for CodeWeavers
5 * Copyright 2011 Thomas Mullaly
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#define COBJMACROS
23
24#include <stdarg.h>
25
26#include "windef.h"
27#include "winbase.h"
28#include "ole2.h"
29
30#include "msxml6.h"
31
32#include "wine/debug.h"
33
34#include "msxml_dispex.h"
35
37
38static const WCHAR emptyW[] = {0};
39static const WCHAR spaceW[] = {' '};
40static const WCHAR quotW[] = {'\"'};
41static const WCHAR closetagW[] = {'>','\r','\n'};
42static const WCHAR crlfW[] = {'\r','\n'};
43static const WCHAR entityW[] = {'<','!','E','N','T','I','T','Y',' '};
44static const WCHAR publicW[] = {'P','U','B','L','I','C',' '};
45static const WCHAR systemW[] = {'S','Y','S','T','E','M',' '};
46
47/* should be ordered as encoding names are sorted */
48typedef enum
49{
72
74{
78};
79
80static const WCHAR iso_8859_1W[] = {'i','s','o','-','8','8','5','9','-','1',0};
81static const WCHAR iso_8859_2W[] = {'i','s','o','-','8','8','5','9','-','2',0};
82static const WCHAR iso_8859_3W[] = {'i','s','o','-','8','8','5','9','-','3',0};
83static const WCHAR iso_8859_4W[] = {'i','s','o','-','8','8','5','9','-','4',0};
84static const WCHAR iso_8859_5W[] = {'i','s','o','-','8','8','5','9','-','5',0};
85static const WCHAR iso_8859_7W[] = {'i','s','o','-','8','8','5','9','-','7',0};
86static const WCHAR iso_8859_9W[] = {'i','s','o','-','8','8','5','9','-','9',0};
87static const WCHAR iso_8859_13W[] = {'i','s','o','-','8','8','5','9','-','1','3',0};
88static const WCHAR iso_8859_15W[] = {'i','s','o','-','8','8','5','9','-','1','5',0};
89static const WCHAR utf16W[] = {'U','T','F','-','1','6',0};
90static const WCHAR utf8W[] = {'U','T','F','-','8',0};
91static const WCHAR windows_1250W[] = {'w','i','n','d','o','w','s','-','1','2','5','0',0};
92static const WCHAR windows_1251W[] = {'w','i','n','d','o','w','s','-','1','2','5','1',0};
93static const WCHAR windows_1252W[] = {'w','i','n','d','o','w','s','-','1','2','5','2',0};
94static const WCHAR windows_1253W[] = {'w','i','n','d','o','w','s','-','1','2','5','3',0};
95static const WCHAR windows_1254W[] = {'w','i','n','d','o','w','s','-','1','2','5','4',0};
96static const WCHAR windows_1255W[] = {'w','i','n','d','o','w','s','-','1','2','5','5',0};
97static const WCHAR windows_1256W[] = {'w','i','n','d','o','w','s','-','1','2','5','6',0};
98static const WCHAR windows_1257W[] = {'w','i','n','d','o','w','s','-','1','2','5','7',0};
99static const WCHAR windows_1258W[] = {'w','i','n','d','o','w','s','-','1','2','5','8',0};
100
101static const struct xml_encoding_data xml_encoding_map[] = {
111 { utf16W, XmlEncoding_UTF16, ~0 },
122};
123
124typedef enum
125{
133
134typedef enum
135{
139
140typedef struct
141{
142 struct list entry;
143 char *data;
144 unsigned int allocated;
145 unsigned int written;
147
148typedef struct
149{
152 UINT utf16_total; /* total number of bytes written since last buffer reinitialization */
153 struct list blocks; /* only used when output was not set, for BSTR case */
155
156typedef struct
157{
161 ISAXLexicalHandler ISAXLexicalHandler_iface;
163 ISAXDTDHandler ISAXDTDHandler_iface;
164 ISAXErrorHandler ISAXErrorHandler_iface;
165 IVBSAXDeclHandler IVBSAXDeclHandler_iface;
166 IVBSAXLexicalHandler IVBSAXLexicalHandler_iface;
167 IVBSAXContentHandler IVBSAXContentHandler_iface;
168 IVBSAXDTDHandler IVBSAXDTDHandler_iface;
169 IVBSAXErrorHandler IVBSAXErrorHandler_iface;
170
173
177
178 BOOL text; /* last node was text node, so we shouldn't indent next node */
179 BOOL newline; /* newline was already added as a part of previous call */
180 UINT indent; /* indentation level for next node */
181
183
184 BSTR encoding; /* exact property value */
186
187 /* contains a pending (or not closed yet) element name or NULL if
188 we don't have to close */
190
192
194} mxwriter;
195
196typedef struct
197{
204
205typedef struct
206{
208 IMXAttributes IMXAttributes_iface;
210 IVBSAXAttributes IVBSAXAttributes_iface;
212
214
219
220static inline mxattributes *impl_from_IMXAttributes( IMXAttributes *iface )
221{
222 return CONTAINING_RECORD(iface, mxattributes, IMXAttributes_iface);
223}
224
226{
227 return CONTAINING_RECORD(iface, mxattributes, ISAXAttributes_iface);
228}
229
230static inline mxattributes *impl_from_IVBSAXAttributes( IVBSAXAttributes *iface )
231{
232 return CONTAINING_RECORD(iface, mxattributes, IVBSAXAttributes_iface);
233}
234
236{
237 if (This->length < This->allocated) return S_OK;
238
239 This->allocated *= 2;
240 This->attr = realloc(This->attr, This->allocated * sizeof(mxattribute));
241
242 return This->attr ? S_OK : E_OUTOFMEMORY;
243}
244
246{
247 int min, max, n, c;
248
249 min = 0;
251
252 while (min <= max)
253 {
254 n = (min+max)/2;
255
256 c = lstrcmpiW(xml_encoding_map[n].encoding, encoding);
257 if (!c)
258 return xml_encoding_map[n].enc;
259
260 if (c > 0)
261 max = n-1;
262 else
263 min = n+1;
264 }
265
266 return XmlEncoding_Unknown;
267}
268
270{
271 const int initial_len = 0x1000;
272 buffer->data = malloc(initial_len);
273 if (!buffer->data) return E_OUTOFMEMORY;
274
275 memset(buffer->data, 0, 4);
276 buffer->allocated = initial_len;
277 buffer->written = 0;
278
279 return S_OK;
280}
281
283{
284 free(buffer->data);
285}
286
288{
289 const struct xml_encoding_data *data;
290
292 {
293 FIXME("unsupported encoding %d\n", encoding);
294 return E_NOTIMPL;
295 }
296
298 *cp = data->cp;
299
300 return S_OK;
301}
302
304{
305 HRESULT hr;
306
307 hr = get_code_page(encoding, &buffer->code_page);
308 if (hr != S_OK)
309 return hr;
310
311 hr = init_encoded_buffer(&buffer->encoded);
312 if (hr != S_OK)
313 return hr;
314
315 list_init(&buffer->blocks);
316 buffer->utf16_total = 0;
317
318 return S_OK;
319}
320
322{
323 encoded_buffer *cur, *cur2;
324
325 free_encoded_buffer(&buffer->encoded);
326
328 {
329 list_remove(&cur->entry);
331 free(cur);
332 }
333}
334
335static HRESULT write_output_buffer(mxwriter *writer, const WCHAR *data, int len)
336{
337 output_buffer *buffer = &writer->buffer;
339 ULONG written;
340 int src_len;
341
342 if (!len || !*data)
343 return S_OK;
344
345 src_len = len == -1 ? lstrlenW(data) : len;
346 if (writer->dest)
347 {
348 buff = &buffer->encoded;
349
350 if (buffer->code_page == ~0)
351 {
352 unsigned int avail = buff->allocated - buff->written;
353
354 src_len *= sizeof(WCHAR);
355 written = min(avail, src_len);
356
357 /* fill internal buffer first */
358 if (avail)
359 {
360 memcpy(buff->data + buff->written, data, written);
361 data += written / sizeof(WCHAR);
362 buff->written += written;
363 avail -= written;
364 src_len -= written;
365 }
366
367 if (!avail)
368 {
369 IStream_Write(writer->dest, buff->data, buff->written, &written);
370 buff->written = 0;
371 if (src_len >= buff->allocated)
372 IStream_Write(writer->dest, data, src_len, &written);
373 else if (src_len)
374 {
375 memcpy(buff->data, data, src_len);
376 buff->written += src_len;
377 }
378 }
379 }
380 else
381 {
382 unsigned int avail = buff->allocated - buff->written;
383 int length;
384
385 length = WideCharToMultiByte(buffer->code_page, 0, data, src_len, NULL, 0, NULL, NULL);
386 if (avail >= length)
387 {
388 length = WideCharToMultiByte(buffer->code_page, 0, data, src_len, buff->data + buff->written, length, NULL, NULL);
389 buff->written += length;
390 }
391 else
392 {
393 /* drain what we go so far */
394 if (buff->written)
395 {
396 IStream_Write(writer->dest, buff->data, buff->written, &written);
397 buff->written = 0;
398 avail = buff->allocated;
399 }
400
401 if (avail >= length)
402 {
403 length = WideCharToMultiByte(buffer->code_page, 0, data, src_len, buff->data + buff->written, length, NULL, NULL);
404 buff->written += length;
405 }
406 else
407 {
408 char *mb;
409
410 /* if current chunk is larger than total buffer size, convert it at once using temporary allocated buffer */
411 mb = malloc(length);
412 if (!mb)
413 return E_OUTOFMEMORY;
414
415 length = WideCharToMultiByte(buffer->code_page, 0, data, src_len, mb, length, NULL, NULL);
416 IStream_Write(writer->dest, mb, length, &written);
417 free(mb);
418 }
419 }
420 }
421 }
422 /* When writer has no output set we have to accumulate everything to return it later in a form of BSTR.
423 To achieve that:
424
425 - fill a buffer already allocated as part of output buffer;
426 - when current buffer is full, allocate another one and switch to it; buffers themselves never grow,
427 but are linked together, with head pointing to first allocated buffer after initial one got filled;
428 - later during get_output() contents are concatenated by copying one after another to destination BSTR buffer,
429 that's returned to the client. */
430 else
431 {
432 /* select last used block */
433 if (list_empty(&buffer->blocks))
434 buff = &buffer->encoded;
435 else
437
438 src_len *= sizeof(WCHAR);
439 while (src_len)
440 {
441 unsigned int avail = buff->allocated - buff->written;
442 unsigned int written = min(avail, src_len);
443
444 if (avail)
445 {
446 memcpy(buff->data + buff->written, data, written);
447 buff->written += written;
448 buffer->utf16_total += written;
449 src_len -= written;
450 }
451
452 /* alloc new block if needed and retry */
453 if (src_len)
454 {
455 encoded_buffer *next = malloc(sizeof(*next));
456 HRESULT hr;
457
459 free(next);
460 return hr;
461 }
462
463 list_add_tail(&buffer->blocks, &next->entry);
464 buff = next;
465 }
466 }
467 }
468
469 return S_OK;
470}
471
473{
474 write_output_buffer(writer, quotW, 1);
475 write_output_buffer(writer, data, len);
476 write_output_buffer(writer, quotW, 1);
477
478 return S_OK;
479}
480
481/* frees buffer data, reallocates with a default lengths */
482static void close_output_buffer(mxwriter *writer)
483{
484 encoded_buffer *cur, *cur2;
485
486 free(writer->buffer.encoded.data);
487
489 {
490 list_remove(&cur->entry);
492 free(cur);
493 }
494
496 get_code_page(writer->xml_enc, &writer->buffer.code_page);
497 writer->buffer.utf16_total = 0;
498 list_init(&writer->buffer.blocks);
499}
500
501/* Escapes special characters like:
502 '<' -> "&lt;"
503 '&' -> "&amp;"
504 '"' -> "&quot;"
505 '>' -> "&gt;"
506
507 On call 'len' contains a length of 'str' in chars or -1 if it's null terminated.
508 After a call it's updated with actual new length if it wasn't -1 initially.
509*/
511{
512 static const WCHAR ltW[] = {'&','l','t',';'};
513 static const WCHAR ampW[] = {'&','a','m','p',';'};
514 static const WCHAR equotW[] = {'&','q','u','o','t',';'};
515 static const WCHAR gtW[] = {'&','g','t',';'};
516
517 const int default_alloc = 100;
518 const int grow_thresh = 10;
519 int p = *len, conv_len;
520 WCHAR *ptr, *ret;
521
522 /* default buffer size to something if length is unknown */
523 conv_len = max(2**len, default_alloc);
524 ptr = ret = malloc(conv_len * sizeof(WCHAR));
525
526 while (p)
527 {
528 if (ptr - ret > conv_len - grow_thresh)
529 {
530 int written = ptr - ret;
531 conv_len *= 2;
532 ptr = ret = realloc(ret, conv_len * sizeof(WCHAR));
533 ptr += written;
534 }
535
536 switch (*str)
537 {
538 case '<':
539 memcpy(ptr, ltW, sizeof(ltW));
540 ptr += ARRAY_SIZE(ltW);
541 break;
542 case '&':
543 memcpy(ptr, ampW, sizeof(ampW));
544 ptr += ARRAY_SIZE(ampW);
545 break;
546 case '>':
547 memcpy(ptr, gtW, sizeof(gtW));
548 ptr += ARRAY_SIZE(gtW);
549 break;
550 case '"':
551 if (mode == EscapeValue)
552 {
553 memcpy(ptr, equotW, sizeof(equotW));
554 ptr += ARRAY_SIZE(equotW);
555 break;
556 }
557 /* fallthrough for text mode */
558 default:
559 *ptr++ = *str;
560 break;
561 }
562
563 str++;
564 p--;
565 }
566
567 *len = ptr-ret;
568 *++ptr = 0;
569
570 return ret;
571}
572
573static void write_prolog_buffer(mxwriter *writer)
574{
575 static const WCHAR versionW[] = {'<','?','x','m','l',' ','v','e','r','s','i','o','n','='};
576 static const WCHAR encodingW[] = {' ','e','n','c','o','d','i','n','g','=','\"'};
577 static const WCHAR standaloneW[] = {' ','s','t','a','n','d','a','l','o','n','e','=','\"'};
578 static const WCHAR yesW[] = {'y','e','s','\"','?','>'};
579 static const WCHAR noW[] = {'n','o','\"','?','>'};
580
581 /* version */
583 write_output_buffer_quoted(writer, writer->version, -1);
584
585 /* encoding */
586 write_output_buffer(writer, encodingW, ARRAY_SIZE(encodingW));
587
588 if (writer->dest)
589 write_output_buffer(writer, writer->encoding, -1);
590 else
592 write_output_buffer(writer, quotW, 1);
593
594 /* standalone */
595 write_output_buffer(writer, standaloneW, ARRAY_SIZE(standaloneW));
596 if (writer->props[MXWriter_Standalone] == VARIANT_TRUE)
598 else
600
602 writer->newline = TRUE;
603}
604
605/* Attempts to the write data from the mxwriter's buffer to
606 * the destination stream (if there is one).
607 */
609{
611 ULONG written = 0;
612
613 if (!writer->dest)
614 return S_OK;
615
616 if (buffer->written == 0)
617 {
618 if (writer->xml_enc == XmlEncoding_UTF8)
619 IStream_Write(writer->dest, buffer->data, 0, &written);
620 }
621 else
622 {
623 IStream_Write(writer->dest, buffer->data, buffer->written, &written);
624 buffer->written = 0;
625 }
626
627 return S_OK;
628}
629
630/* Newly added element start tag left unclosed cause for empty elements
631 we have to close it differently. */
633{
634 static const WCHAR gtW[] = {'>'};
635 if (!writer->element) return;
636 write_output_buffer(writer, gtW, 1);
637}
638
639static void write_node_indent(mxwriter *writer)
640{
641 static const WCHAR tabW[] = {'\t'};
642 int indent = writer->indent;
643
644 if (!writer->props[MXWriter_Indent] || writer->text)
645 {
646 writer->text = FALSE;
647 return;
648 }
649
650 /* This is to workaround PI output logic that always puts newline chars,
651 document prolog PI does that too. */
652 if (!writer->newline)
654 while (indent--)
655 write_output_buffer(writer, tabW, 1);
656
657 writer->newline = FALSE;
658 writer->text = FALSE;
659}
660
661static inline void writer_inc_indent(mxwriter *This)
662{
663 This->indent++;
664}
665
666static inline void writer_dec_indent(mxwriter *This)
667{
668 if (This->indent) This->indent--;
669 /* depth is decreased only when element is closed, meaning it's not a text node
670 at this point */
671 This->text = FALSE;
672}
673
674static void set_element_name(mxwriter *This, const WCHAR *name, int len)
675{
676 SysFreeString(This->element);
677 if (name)
678 This->element = len != -1 ? SysAllocStringLen(name, len) : SysAllocString(name);
679 else
680 This->element = NULL;
681}
682
684{
687 This->cdata = FALSE;
689}
690
692{
693 writer->props[property] = value;
694 writer->prop_changed = TRUE;
695 return S_OK;
696}
697
699{
700 if (!value) return E_POINTER;
701 *value = writer->props[property];
702 return S_OK;
703}
704
705static inline mxwriter *impl_from_IMXWriter(IMXWriter *iface)
706{
707 return CONTAINING_RECORD(iface, mxwriter, IMXWriter_iface);
708}
709
711{
712 return CONTAINING_RECORD(iface, mxwriter, ISAXContentHandler_iface);
713}
714
715static inline mxwriter *impl_from_IVBSAXContentHandler(IVBSAXContentHandler *iface)
716{
717 return CONTAINING_RECORD(iface, mxwriter, IVBSAXContentHandler_iface);
718}
719
720static inline mxwriter *impl_from_ISAXLexicalHandler(ISAXLexicalHandler *iface)
721{
722 return CONTAINING_RECORD(iface, mxwriter, ISAXLexicalHandler_iface);
723}
724
725static inline mxwriter *impl_from_IVBSAXLexicalHandler(IVBSAXLexicalHandler *iface)
726{
727 return CONTAINING_RECORD(iface, mxwriter, IVBSAXLexicalHandler_iface);
728}
729
731{
732 return CONTAINING_RECORD(iface, mxwriter, ISAXDeclHandler_iface);
733}
734
735static inline mxwriter *impl_from_IVBSAXDeclHandler(IVBSAXDeclHandler *iface)
736{
737 return CONTAINING_RECORD(iface, mxwriter, IVBSAXDeclHandler_iface);
738}
739
740static inline mxwriter *impl_from_ISAXDTDHandler(ISAXDTDHandler *iface)
741{
742 return CONTAINING_RECORD(iface, mxwriter, ISAXDTDHandler_iface);
743}
744
745static inline mxwriter *impl_from_IVBSAXDTDHandler(IVBSAXDTDHandler *iface)
746{
747 return CONTAINING_RECORD(iface, mxwriter, IVBSAXDTDHandler_iface);
748}
749
750static inline mxwriter *impl_from_ISAXErrorHandler(ISAXErrorHandler *iface)
751{
752 return CONTAINING_RECORD(iface, mxwriter, ISAXErrorHandler_iface);
753}
754
755static inline mxwriter *impl_from_IVBSAXErrorHandler(IVBSAXErrorHandler *iface)
756{
757 return CONTAINING_RECORD(iface, mxwriter, IVBSAXErrorHandler_iface);
758}
759
760static HRESULT WINAPI mxwriter_QueryInterface(IMXWriter *iface, REFIID riid, void **obj)
761{
763
764 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
765
766 *obj = NULL;
767
768 if ( IsEqualGUID( riid, &IID_IMXWriter ) ||
771 {
772 *obj = &This->IMXWriter_iface;
773 }
774 else if ( IsEqualGUID( riid, &IID_ISAXContentHandler ) )
775 {
776 *obj = &This->ISAXContentHandler_iface;
777 }
778 else if ( IsEqualGUID( riid, &IID_ISAXLexicalHandler ) )
779 {
780 *obj = &This->ISAXLexicalHandler_iface;
781 }
782 else if ( IsEqualGUID( riid, &IID_ISAXDeclHandler ) )
783 {
784 *obj = &This->ISAXDeclHandler_iface;
785 }
786 else if ( IsEqualGUID( riid, &IID_ISAXDTDHandler ) )
787 {
788 *obj = &This->ISAXDTDHandler_iface;
789 }
790 else if ( IsEqualGUID( riid, &IID_ISAXErrorHandler ) )
791 {
792 *obj = &This->ISAXErrorHandler_iface;
793 }
794 else if ( IsEqualGUID( riid, &IID_IVBSAXDeclHandler ) )
795 {
796 *obj = &This->IVBSAXDeclHandler_iface;
797 }
798 else if ( IsEqualGUID( riid, &IID_IVBSAXLexicalHandler ) )
799 {
800 *obj = &This->IVBSAXLexicalHandler_iface;
801 }
802 else if ( IsEqualGUID( riid, &IID_IVBSAXContentHandler ) )
803 {
804 *obj = &This->IVBSAXContentHandler_iface;
805 }
806 else if ( IsEqualGUID( riid, &IID_IVBSAXDTDHandler ) )
807 {
808 *obj = &This->IVBSAXDTDHandler_iface;
809 }
810 else if ( IsEqualGUID( riid, &IID_IVBSAXErrorHandler ) )
811 {
812 *obj = &This->IVBSAXErrorHandler_iface;
813 }
814 else if (dispex_query_interface(&This->dispex, riid, obj))
815 {
816 return *obj ? S_OK : E_NOINTERFACE;
817 }
818 else
819 {
820 ERR("interface %s not implemented\n", debugstr_guid(riid));
821 *obj = NULL;
822 return E_NOINTERFACE;
823 }
824
825 IMXWriter_AddRef(iface);
826 return S_OK;
827}
828
829static ULONG WINAPI mxwriter_AddRef(IMXWriter *iface)
830{
831 mxwriter *writer = impl_from_IMXWriter(iface);
832 LONG ref = InterlockedIncrement(&writer->ref);
833
834 TRACE("%p, refcount %lu.\n", iface, ref);
835
836 return ref;
837}
838
839static ULONG WINAPI mxwriter_Release(IMXWriter *iface)
840{
843
844 TRACE("%p, refcount %lu.\n", iface, ref);
845
846 if (!ref)
847 {
848 /* Windows flushes the buffer when the interface is destroyed. */
850 free_output_buffer(&This->buffer);
851
852 if (This->dest) IStream_Release(This->dest);
853 SysFreeString(This->version);
854 SysFreeString(This->encoding);
855
856 SysFreeString(This->element);
857 free(This);
858 }
859
860 return ref;
861}
862
863static HRESULT WINAPI mxwriter_GetTypeInfoCount(IMXWriter *iface, UINT* pctinfo)
864{
866 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
867}
868
870 IMXWriter *iface,
871 UINT iTInfo, LCID lcid,
872 ITypeInfo** ppTInfo )
873{
875 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface,
876 iTInfo, lcid, ppTInfo);
877}
878
880 IMXWriter *iface,
881 REFIID riid, LPOLESTR* rgszNames,
882 UINT cNames, LCID lcid, DISPID* rgDispId )
883{
885 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface,
886 riid, rgszNames, cNames, lcid, rgDispId);
887}
888
890 IMXWriter *iface,
891 DISPID dispIdMember, REFIID riid, LCID lcid,
892 WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult,
893 EXCEPINFO* pExcepInfo, UINT* puArgErr )
894{
896 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface,
897 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
898}
899
901{
903 HRESULT hr;
904
905 TRACE("(%p)->(%s)\n", This, debugstr_variant(&dest));
906
908 if (FAILED(hr))
909 return hr;
910
911 switch (V_VT(&dest))
912 {
913 case VT_EMPTY:
914 {
915 if (This->dest) IStream_Release(This->dest);
916 This->dest = NULL;
918 break;
919 }
920 case VT_UNKNOWN:
921 {
923
924 hr = IUnknown_QueryInterface(V_UNKNOWN(&dest), &IID_IStream, (void**)&stream);
925 if (hr == S_OK)
926 {
927 /* Recreate the output buffer to make sure it's using the correct encoding. */
929
930 if (This->dest) IStream_Release(This->dest);
931 This->dest = stream;
932 break;
933 }
934
935 FIXME("unhandled interface type for VT_UNKNOWN destination\n");
936 return E_NOTIMPL;
937 }
938 default:
939 FIXME("unhandled destination type %s\n", debugstr_variant(&dest));
940 return E_NOTIMPL;
941 }
942
943 return S_OK;
944}
945
947{
949
950 TRACE("(%p)->(%p)\n", This, dest);
951
952 if (!dest) return E_POINTER;
953
954 if (This->dest)
955 {
956 /* we only support IStream output so far */
958 V_UNKNOWN(dest) = (IUnknown*)This->dest;
959 IStream_AddRef(This->dest);
960 }
961 else
962 {
964 char *dest_ptr;
965 HRESULT hr;
966
968 if (FAILED(hr))
969 return hr;
970
971 V_VT(dest) = VT_BSTR;
972 V_BSTR(dest) = SysAllocStringLen(NULL, This->buffer.utf16_total / sizeof(WCHAR));
973 if (!V_BSTR(dest))
974 return E_OUTOFMEMORY;
975
976 dest_ptr = (char*)V_BSTR(dest);
977 buff = &This->buffer.encoded;
978
979 if (buff->written)
980 {
981 memcpy(dest_ptr, buff->data, buff->written);
982 dest_ptr += buff->written;
983 }
984
986 {
987 memcpy(dest_ptr, buff->data, buff->written);
988 dest_ptr += buff->written;
989 }
990 }
991
992 return S_OK;
993}
994
996{
999 HRESULT hr;
1000
1001 TRACE("(%p)->(%s)\n", This, debugstr_w(encoding));
1002
1004 if (enc == XmlEncoding_Unknown)
1005 {
1006 FIXME("unsupported encoding %s\n", debugstr_w(encoding));
1007 return E_INVALIDARG;
1008 }
1009
1011 if (FAILED(hr))
1012 return hr;
1013
1014 SysReAllocString(&This->encoding, encoding);
1015 This->xml_enc = enc;
1016
1017 TRACE("got encoding %d\n", This->xml_enc);
1019 return S_OK;
1020}
1021
1023{
1024 mxwriter *This = impl_from_IMXWriter( iface );
1025
1026 TRACE("(%p)->(%p)\n", This, encoding);
1027
1028 if (!encoding) return E_POINTER;
1029
1030 *encoding = SysAllocString(This->encoding);
1031 if (!*encoding) return E_OUTOFMEMORY;
1032
1033 return S_OK;
1034}
1035
1037{
1038 mxwriter *This = impl_from_IMXWriter( iface );
1039
1040 TRACE("(%p)->(%d)\n", This, value);
1042}
1043
1045{
1046 mxwriter *This = impl_from_IMXWriter( iface );
1047
1048 TRACE("(%p)->(%p)\n", This, value);
1050}
1051
1053{
1054 mxwriter *This = impl_from_IMXWriter( iface );
1055
1056 TRACE("(%p)->(%d)\n", This, value);
1058}
1059
1061{
1062 mxwriter *This = impl_from_IMXWriter( iface );
1063
1064 TRACE("(%p)->(%p)\n", This, value);
1066}
1067
1069{
1070 mxwriter *This = impl_from_IMXWriter( iface );
1071
1072 TRACE("(%p)->(%d)\n", This, value);
1074}
1075
1077{
1078 mxwriter *This = impl_from_IMXWriter( iface );
1079
1080 TRACE("(%p)->(%p)\n", This, value);
1082}
1083
1085{
1086 mxwriter *This = impl_from_IMXWriter( iface );
1087
1088 TRACE("(%p)->(%d)\n", This, value);
1090}
1091
1093{
1094 mxwriter *This = impl_from_IMXWriter( iface );
1095
1096 TRACE("(%p)->(%p)\n", This, value);
1098}
1099
1101{
1102 mxwriter *This = impl_from_IMXWriter( iface );
1103
1104 TRACE("(%p)->(%s)\n", This, debugstr_w(version));
1105
1106 if (!version) return E_INVALIDARG;
1107
1108 SysFreeString(This->version);
1109 This->version = SysAllocString(version);
1110
1111 return S_OK;
1112}
1113
1115{
1116 mxwriter *This = impl_from_IMXWriter( iface );
1117
1118 TRACE("(%p)->(%p)\n", This, version);
1119
1120 if (!version) return E_POINTER;
1121
1122 return return_bstr(This->version, version);
1123}
1124
1126{
1127 mxwriter *This = impl_from_IMXWriter( iface );
1128
1129 TRACE("(%p)->(%d)\n", This, value);
1131}
1132
1134{
1135 mxwriter *This = impl_from_IMXWriter( iface );
1136
1137 TRACE("(%p)->(%p)\n", This, value);
1139}
1140
1141static HRESULT WINAPI mxwriter_flush(IMXWriter *iface)
1142{
1143 mxwriter *This = impl_from_IMXWriter( iface );
1144 TRACE("(%p)\n", This);
1145 return flush_output_buffer(This);
1146}
1147
1148static const struct IMXWriterVtbl MXWriterVtbl =
1149{
1174};
1175
1176/*** ISAXContentHandler ***/
1178 ISAXContentHandler *iface,
1179 REFIID riid,
1180 void **obj)
1181{
1183 return IMXWriter_QueryInterface(&This->IMXWriter_iface, riid, obj);
1184}
1185
1187{
1189 return IMXWriter_AddRef(&This->IMXWriter_iface);
1190}
1191
1193{
1195 return IMXWriter_Release(&This->IMXWriter_iface);
1196}
1197
1199 ISAXContentHandler *iface,
1200 ISAXLocator *locator)
1201{
1203 FIXME("(%p)->(%p)\n", This, locator);
1204 return E_NOTIMPL;
1205}
1206
1208{
1210
1211 TRACE("(%p)\n", This);
1212
1213 /* If properties have been changed since the last "endDocument" call
1214 * we need to reset the output buffer. If we don't the output buffer
1215 * could end up with multiple XML documents in it, plus this seems to
1216 * be how Windows works.
1217 */
1218 if (This->prop_changed) {
1220 This->prop_changed = FALSE;
1221 }
1222
1223 if (This->props[MXWriter_OmitXmlDecl] == VARIANT_TRUE) return S_OK;
1224
1226
1227 if (This->dest && This->xml_enc == XmlEncoding_UTF16) {
1228 static const char utf16BOM[] = {0xff,0xfe};
1229
1230 if (This->props[MXWriter_BOM] == VARIANT_TRUE)
1231 /* Windows passes a NULL pointer as the pcbWritten parameter and
1232 * ignores any error codes returned from this Write call.
1233 */
1234 IStream_Write(This->dest, utf16BOM, sizeof(utf16BOM), NULL);
1235 }
1236
1237 return S_OK;
1238}
1239
1241{
1243 TRACE("(%p)\n", This);
1244 This->prop_changed = FALSE;
1245 return flush_output_buffer(This);
1246}
1247
1249 ISAXContentHandler *iface,
1250 const WCHAR *prefix,
1251 int nprefix,
1252 const WCHAR *uri,
1253 int nuri)
1254{
1256 TRACE("(%p)->(%s %s)\n", This, debugstr_wn(prefix, nprefix), debugstr_wn(uri, nuri));
1257 return S_OK;
1258}
1259
1261 ISAXContentHandler *iface,
1262 const WCHAR *prefix,
1263 int nprefix)
1264{
1266 TRACE("(%p)->(%s)\n", This, debugstr_wn(prefix, nprefix));
1267 return S_OK;
1268}
1269
1270static void mxwriter_write_attribute(mxwriter *writer, const WCHAR *qname, int qname_len,
1271 const WCHAR *value, int value_len, BOOL escape)
1272{
1273 static const WCHAR eqW[] = {'='};
1274
1275 /* space separator in front of every attribute */
1276 write_output_buffer(writer, spaceW, 1);
1277 write_output_buffer(writer, qname, qname_len);
1278 write_output_buffer(writer, eqW, 1);
1279
1280 if (escape)
1281 {
1282 WCHAR *escaped = get_escaped_string(value, EscapeValue, &value_len);
1283 write_output_buffer_quoted(writer, escaped, value_len);
1284 free(escaped);
1285 }
1286 else
1287 write_output_buffer_quoted(writer, value, value_len);
1288}
1289
1290static void mxwriter_write_starttag(mxwriter *writer, const WCHAR *qname, int len)
1291{
1292 static const WCHAR ltW[] = {'<'};
1293
1294 close_element_starttag(writer);
1295 set_element_name(writer, qname ? qname : emptyW, qname ? len : 0);
1296
1297 write_node_indent(writer);
1298
1299 write_output_buffer(writer, ltW, 1);
1300 write_output_buffer(writer, qname ? qname : emptyW, qname ? len : 0);
1301 writer_inc_indent(writer);
1302}
1303
1305 ISAXContentHandler *iface,
1306 const WCHAR *namespaceUri,
1307 int nnamespaceUri,
1308 const WCHAR *local_name,
1309 int nlocal_name,
1310 const WCHAR *QName,
1311 int nQName,
1313{
1315
1316 TRACE("(%p)->(%s %s %s %p)\n", This, debugstr_wn(namespaceUri, nnamespaceUri),
1317 debugstr_wn(local_name, nlocal_name), debugstr_wn(QName, nQName), attr);
1318
1319 if (((!namespaceUri || !local_name || !QName) && This->class_version != MSXML6) ||
1320 (nQName == -1 && This->class_version == MSXML6))
1321 return E_INVALIDARG;
1322
1323 mxwriter_write_starttag(This, QName, nQName);
1324
1325 if (attr)
1326 {
1327 int length, i, escape;
1328 HRESULT hr;
1329
1330 hr = ISAXAttributes_getLength(attr, &length);
1331 if (FAILED(hr)) return hr;
1332
1333 escape = This->props[MXWriter_DisableEscaping] == VARIANT_FALSE ||
1334 (This->class_version == MSXML4 || This->class_version == MSXML6);
1335
1336 for (i = 0; i < length; i++)
1337 {
1338 int qname_len = 0, value_len = 0;
1339 const WCHAR *qname, *value;
1340
1341 hr = ISAXAttributes_getQName(attr, i, &qname, &qname_len);
1342 if (FAILED(hr)) return hr;
1343
1344 hr = ISAXAttributes_getValue(attr, i, &value, &value_len);
1345 if (FAILED(hr)) return hr;
1346
1347 mxwriter_write_attribute(This, qname, qname_len, value, value_len, escape);
1348 }
1349 }
1350
1351 return S_OK;
1352}
1353
1355 ISAXContentHandler *iface,
1356 const WCHAR *namespaceUri,
1357 int nnamespaceUri,
1358 const WCHAR * local_name,
1359 int nlocal_name,
1360 const WCHAR *QName,
1361 int nQName)
1362{
1364
1365 TRACE("(%p)->(%s:%d %s:%d %s:%d)\n", This, debugstr_wn(namespaceUri, nnamespaceUri), nnamespaceUri,
1366 debugstr_wn(local_name, nlocal_name), nlocal_name, debugstr_wn(QName, nQName), nQName);
1367
1368 if (((!namespaceUri || !local_name || !QName) && This->class_version != MSXML6) ||
1369 (nQName == -1 && This->class_version == MSXML6))
1370 return E_INVALIDARG;
1371
1373
1374 if (This->element)
1375 {
1376 static const WCHAR closeW[] = {'/','>'};
1377 write_output_buffer(This, closeW, 2);
1378 }
1379 else
1380 {
1381 static const WCHAR closetagW[] = {'<','/'};
1382 static const WCHAR gtW[] = {'>'};
1383
1386 write_output_buffer(This, QName, nQName);
1388 }
1389
1391
1392 return S_OK;
1393}
1394
1396 ISAXContentHandler *iface,
1397 const WCHAR *chars,
1398 int nchars)
1399{
1401
1402 TRACE("(%p)->(%s:%d)\n", This, debugstr_wn(chars, nchars), nchars);
1403
1404 if (!chars) return E_INVALIDARG;
1405
1408
1409 if (!This->cdata)
1410 This->text = TRUE;
1411
1412 if (nchars)
1413 {
1414 if (This->cdata || This->props[MXWriter_DisableEscaping] == VARIANT_TRUE)
1415 write_output_buffer(This, chars, nchars);
1416 else
1417 {
1418 int len = nchars;
1419 WCHAR *escaped;
1420
1421 escaped = get_escaped_string(chars, EscapeText, &len);
1422 write_output_buffer(This, escaped, len);
1423 free(escaped);
1424 }
1425 }
1426
1427 return S_OK;
1428}
1429
1431 ISAXContentHandler *iface,
1432 const WCHAR *chars,
1433 int nchars)
1434{
1436
1437 TRACE("(%p)->(%s)\n", This, debugstr_wn(chars, nchars));
1438
1439 if (!chars) return E_INVALIDARG;
1440
1441 write_output_buffer(This, chars, nchars);
1442
1443 return S_OK;
1444}
1445
1447 ISAXContentHandler *iface,
1448 const WCHAR *target,
1449 int ntarget,
1450 const WCHAR *data,
1451 int ndata)
1452{
1454 static const WCHAR openpiW[] = {'<','?'};
1455 static const WCHAR closepiW[] = {'?','>','\r','\n'};
1456
1457 TRACE("(%p)->(%s %s)\n", This, debugstr_wn(target, ntarget), debugstr_wn(data, ndata));
1458
1459 if (!target) return E_INVALIDARG;
1460
1462 write_output_buffer(This, openpiW, ARRAY_SIZE(openpiW));
1463
1464 if (*target)
1465 write_output_buffer(This, target, ntarget);
1466
1467 if (data && *data && ndata)
1468 {
1470 write_output_buffer(This, data, ndata);
1471 }
1472
1474 This->newline = TRUE;
1475
1476 return S_OK;
1477}
1478
1480 ISAXContentHandler *iface,
1481 const WCHAR *name,
1482 int nname)
1483{
1485 FIXME("(%p)->(%s)\n", This, debugstr_wn(name, nname));
1486 return E_NOTIMPL;
1487}
1488
1489static const struct ISAXContentHandlerVtbl SAXContentHandlerVtbl =
1490{
1505};
1506
1507/*** ISAXLexicalHandler ***/
1508static HRESULT WINAPI SAXLexicalHandler_QueryInterface(ISAXLexicalHandler *iface,
1509 REFIID riid, void **obj)
1510{
1512 return IMXWriter_QueryInterface(&This->IMXWriter_iface, riid, obj);
1513}
1514
1515static ULONG WINAPI SAXLexicalHandler_AddRef(ISAXLexicalHandler *iface)
1516{
1518 return IMXWriter_AddRef(&This->IMXWriter_iface);
1519}
1520
1521static ULONG WINAPI SAXLexicalHandler_Release(ISAXLexicalHandler *iface)
1522{
1524 return IMXWriter_Release(&This->IMXWriter_iface);
1525}
1526
1527static HRESULT WINAPI SAXLexicalHandler_startDTD(ISAXLexicalHandler *iface,
1528 const WCHAR *name, int name_len, const WCHAR *publicId, int publicId_len,
1529 const WCHAR *systemId, int systemId_len)
1530{
1531 static const WCHAR doctypeW[] = {'<','!','D','O','C','T','Y','P','E',' '};
1532 static const WCHAR openintW[] = {'[','\r','\n'};
1533
1535
1536 TRACE("(%p)->(%s %s %s)\n", This, debugstr_wn(name, name_len), debugstr_wn(publicId, publicId_len),
1537 debugstr_wn(systemId, systemId_len));
1538
1539 if (!name) return E_INVALIDARG;
1540
1541 write_output_buffer(This, doctypeW, ARRAY_SIZE(doctypeW));
1542
1543 if (*name)
1544 {
1545 write_output_buffer(This, name, name_len);
1547 }
1548
1549 if (publicId)
1550 {
1552 write_output_buffer_quoted(This, publicId, publicId_len);
1553
1554 if (!systemId) return E_INVALIDARG;
1555
1556 if (*publicId)
1558
1559 write_output_buffer_quoted(This, systemId, systemId_len);
1560
1561 if (*systemId)
1563 }
1564 else if (systemId)
1565 {
1567 write_output_buffer_quoted(This, systemId, systemId_len);
1568 if (*systemId)
1570 }
1571
1572 write_output_buffer(This, openintW, ARRAY_SIZE(openintW));
1573
1574 return S_OK;
1575}
1576
1577static HRESULT WINAPI SAXLexicalHandler_endDTD(ISAXLexicalHandler *iface)
1578{
1580 static const WCHAR closedtdW[] = {']','>','\r','\n'};
1581
1582 TRACE("(%p)\n", This);
1583
1584 write_output_buffer(This, closedtdW, ARRAY_SIZE(closedtdW));
1585
1586 return S_OK;
1587}
1588
1589static HRESULT WINAPI SAXLexicalHandler_startEntity(ISAXLexicalHandler *iface, const WCHAR *name, int len)
1590{
1592 FIXME("(%p)->(%s): stub\n", This, debugstr_wn(name, len));
1593 return E_NOTIMPL;
1594}
1595
1596static HRESULT WINAPI SAXLexicalHandler_endEntity(ISAXLexicalHandler *iface, const WCHAR *name, int len)
1597{
1599 FIXME("(%p)->(%s): stub\n", This, debugstr_wn(name, len));
1600 return E_NOTIMPL;
1601}
1602
1603static HRESULT WINAPI SAXLexicalHandler_startCDATA(ISAXLexicalHandler *iface)
1604{
1605 static const WCHAR scdataW[] = {'<','!','[','C','D','A','T','A','['};
1607
1608 TRACE("(%p)\n", This);
1609
1611 write_output_buffer(This, scdataW, ARRAY_SIZE(scdataW));
1612 This->cdata = TRUE;
1613
1614 return S_OK;
1615}
1616
1617static HRESULT WINAPI SAXLexicalHandler_endCDATA(ISAXLexicalHandler *iface)
1618{
1620 static const WCHAR ecdataW[] = {']',']','>'};
1621
1622 TRACE("(%p)\n", This);
1623
1624 write_output_buffer(This, ecdataW, ARRAY_SIZE(ecdataW));
1625 This->cdata = FALSE;
1626
1627 return S_OK;
1628}
1629
1630static HRESULT WINAPI SAXLexicalHandler_comment(ISAXLexicalHandler *iface, const WCHAR *chars, int nchars)
1631{
1633 static const WCHAR copenW[] = {'<','!','-','-'};
1634 static const WCHAR ccloseW[] = {'-','-','>','\r','\n'};
1635
1636 TRACE("(%p)->(%s:%d)\n", This, debugstr_wn(chars, nchars), nchars);
1637
1638 if (!chars) return E_INVALIDARG;
1639
1642
1643 write_output_buffer(This, copenW, ARRAY_SIZE(copenW));
1644 if (nchars)
1645 write_output_buffer(This, chars, nchars);
1646 write_output_buffer(This, ccloseW, ARRAY_SIZE(ccloseW));
1647
1648 return S_OK;
1649}
1650
1651static const struct ISAXLexicalHandlerVtbl SAXLexicalHandlerVtbl =
1652{
1663};
1664
1665/*** ISAXDeclHandler ***/
1667 REFIID riid, void **obj)
1668{
1670 return IMXWriter_QueryInterface(&This->IMXWriter_iface, riid, obj);
1671}
1672
1674{
1676 return IMXWriter_AddRef(&This->IMXWriter_iface);
1677}
1678
1680{
1682 return IMXWriter_Release(&This->IMXWriter_iface);
1683}
1684
1686 const WCHAR *name, int n_name, const WCHAR *model, int n_model)
1687{
1688 static const WCHAR elementW[] = {'<','!','E','L','E','M','E','N','T',' '};
1690
1691 TRACE("(%p)->(%s:%d %s:%d)\n", This, debugstr_wn(name, n_name), n_name,
1692 debugstr_wn(model, n_model), n_model);
1693
1694 if (!name || !model) return E_INVALIDARG;
1695
1696 write_output_buffer(This, elementW, ARRAY_SIZE(elementW));
1697 if (n_name) {
1698 write_output_buffer(This, name, n_name);
1700 }
1701 if (n_model)
1702 write_output_buffer(This, model, n_model);
1704
1705 return S_OK;
1706}
1707
1709 const WCHAR *element, int n_element, const WCHAR *attr, int n_attr,
1710 const WCHAR *type, int n_type, const WCHAR *Default, int n_default,
1711 const WCHAR *value, int n_value)
1712{
1714 static const WCHAR attlistW[] = {'<','!','A','T','T','L','I','S','T',' '};
1715 static const WCHAR closetagW[] = {'>','\r','\n'};
1716
1717 TRACE("(%p)->(%s:%d %s:%d %s:%d %s:%d %s:%d)\n", This, debugstr_wn(element, n_element), n_element,
1718 debugstr_wn(attr, n_attr), n_attr, debugstr_wn(type, n_type), n_type, debugstr_wn(Default, n_default), n_default,
1719 debugstr_wn(value, n_value), n_value);
1720
1721 write_output_buffer(This, attlistW, ARRAY_SIZE(attlistW));
1722 if (n_element) {
1723 write_output_buffer(This, element, n_element);
1725 }
1726
1727 if (n_attr) {
1728 write_output_buffer(This, attr, n_attr);
1730 }
1731
1732 if (n_type) {
1733 write_output_buffer(This, type, n_type);
1735 }
1736
1737 if (n_default) {
1738 write_output_buffer(This, Default, n_default);
1740 }
1741
1742 if (n_value)
1744
1746
1747 return S_OK;
1748}
1749
1751 const WCHAR *name, int n_name, const WCHAR *value, int n_value)
1752{
1754
1755 TRACE("(%p)->(%s:%d %s:%d)\n", This, debugstr_wn(name, n_name), n_name,
1756 debugstr_wn(value, n_value), n_value);
1757
1758 if (!name || !value) return E_INVALIDARG;
1759
1761 if (n_name) {
1762 write_output_buffer(This, name, n_name);
1764 }
1765
1766 if (n_value)
1768
1770
1771 return S_OK;
1772}
1773
1775 const WCHAR *name, int n_name, const WCHAR *publicId, int n_publicId,
1776 const WCHAR *systemId, int n_systemId)
1777{
1779
1780 TRACE("(%p)->(%s:%d %s:%d %s:%d)\n", This, debugstr_wn(name, n_name), n_name,
1781 debugstr_wn(publicId, n_publicId), n_publicId, debugstr_wn(systemId, n_systemId), n_systemId);
1782
1783 if (!name || !systemId) return E_INVALIDARG;
1784
1786 if (n_name) {
1787 write_output_buffer(This, name, n_name);
1789 }
1790
1791 if (publicId)
1792 {
1794 write_output_buffer_quoted(This, publicId, n_publicId);
1796 write_output_buffer_quoted(This, systemId, n_systemId);
1797 }
1798 else
1799 {
1801 write_output_buffer_quoted(This, systemId, n_systemId);
1802 }
1803
1805
1806 return S_OK;
1807}
1808
1809static const ISAXDeclHandlerVtbl SAXDeclHandlerVtbl = {
1817};
1818
1819/*** IVBSAXDeclHandler ***/
1820static HRESULT WINAPI VBSAXDeclHandler_QueryInterface(IVBSAXDeclHandler *iface,
1821 REFIID riid, void **obj)
1822{
1824 return IMXWriter_QueryInterface(&This->IMXWriter_iface, riid, obj);
1825}
1826
1827static ULONG WINAPI VBSAXDeclHandler_AddRef(IVBSAXDeclHandler *iface)
1828{
1830 return IMXWriter_AddRef(&This->IMXWriter_iface);
1831}
1832
1833static ULONG WINAPI VBSAXDeclHandler_Release(IVBSAXDeclHandler *iface)
1834{
1836 return IMXWriter_Release(&This->IMXWriter_iface);
1837}
1838
1839static HRESULT WINAPI VBSAXDeclHandler_GetTypeInfoCount(IVBSAXDeclHandler *iface, UINT* pctinfo)
1840{
1842 return IMXWriter_GetTypeInfoCount(&This->IMXWriter_iface, pctinfo);
1843}
1844
1845static HRESULT WINAPI VBSAXDeclHandler_GetTypeInfo(IVBSAXDeclHandler *iface, UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo)
1846{
1848 return IMXWriter_GetTypeInfo(&This->IMXWriter_iface, iTInfo, lcid, ppTInfo);
1849}
1850
1851static HRESULT WINAPI VBSAXDeclHandler_GetIDsOfNames(IVBSAXDeclHandler *iface, REFIID riid, LPOLESTR* rgszNames,
1852 UINT cNames, LCID lcid, DISPID* rgDispId )
1853{
1855 return IMXWriter_GetIDsOfNames(&This->IMXWriter_iface, riid, rgszNames, cNames, lcid, rgDispId);
1856}
1857
1858static HRESULT WINAPI VBSAXDeclHandler_Invoke(IVBSAXDeclHandler *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
1859 WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr )
1860{
1862 return IMXWriter_Invoke(&This->IMXWriter_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult,
1863 pExcepInfo, puArgErr);
1864}
1865
1866static HRESULT WINAPI VBSAXDeclHandler_elementDecl(IVBSAXDeclHandler *iface, BSTR *name, BSTR *model)
1867{
1869
1870 TRACE("(%p)->(%p %p)\n", This, name, model);
1871
1872 if (!name || !model)
1873 return E_POINTER;
1874
1875 return ISAXDeclHandler_elementDecl(&This->ISAXDeclHandler_iface, *name, -1, *model, -1);
1876}
1877
1878static HRESULT WINAPI VBSAXDeclHandler_attributeDecl(IVBSAXDeclHandler *iface,
1879 BSTR *element, BSTR *attr, BSTR *type, BSTR *default_value, BSTR *value)
1880{
1882
1883 TRACE("(%p)->(%p %p %p %p %p)\n", This, element, attr, type, default_value, value);
1884
1885 if (!element || !attr || !type || !default_value || !value)
1886 return E_POINTER;
1887
1888 return ISAXDeclHandler_attributeDecl(&This->ISAXDeclHandler_iface, *element, -1, *attr, -1, *type, -1,
1889 *default_value, -1, *value, -1);
1890}
1891
1893{
1895
1896 TRACE("(%p)->(%p %p)\n", This, name, value);
1897
1898 if (!name || !value)
1899 return E_POINTER;
1900
1901 return ISAXDeclHandler_internalEntityDecl(&This->ISAXDeclHandler_iface, *name, -1, *value, -1);
1902}
1903
1905 BSTR *name, BSTR *publicid, BSTR *systemid)
1906{
1908
1909 TRACE("(%p)->(%p %p %p)\n", This, name, publicid, systemid);
1910
1911 if (!name || !publicid || !systemid)
1912 return E_POINTER;
1913
1914 return ISAXDeclHandler_externalEntityDecl(&This->ISAXDeclHandler_iface, *name, -1, *publicid, -1, *systemid, -1);
1915}
1916
1917static const IVBSAXDeclHandlerVtbl VBSAXDeclHandlerVtbl = {
1929};
1930
1931/*** IVBSAXLexicalHandler ***/
1932static HRESULT WINAPI VBSAXLexicalHandler_QueryInterface(IVBSAXLexicalHandler *iface,
1933 REFIID riid, void **obj)
1934{
1936 return IMXWriter_QueryInterface(&This->IMXWriter_iface, riid, obj);
1937}
1938
1939static ULONG WINAPI VBSAXLexicalHandler_AddRef(IVBSAXLexicalHandler *iface)
1940{
1942 return IMXWriter_AddRef(&This->IMXWriter_iface);
1943}
1944
1945static ULONG WINAPI VBSAXLexicalHandler_Release(IVBSAXLexicalHandler *iface)
1946{
1948 return IMXWriter_Release(&This->IMXWriter_iface);
1949}
1950
1951static HRESULT WINAPI VBSAXLexicalHandler_GetTypeInfoCount(IVBSAXLexicalHandler *iface, UINT* pctinfo)
1952{
1954 return IMXWriter_GetTypeInfoCount(&This->IMXWriter_iface, pctinfo);
1955}
1956
1957static HRESULT WINAPI VBSAXLexicalHandler_GetTypeInfo(IVBSAXLexicalHandler *iface, UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo)
1958{
1960 return IMXWriter_GetTypeInfo(&This->IMXWriter_iface, iTInfo, lcid, ppTInfo);
1961}
1962
1963static HRESULT WINAPI VBSAXLexicalHandler_GetIDsOfNames(IVBSAXLexicalHandler *iface, REFIID riid, LPOLESTR* rgszNames,
1964 UINT cNames, LCID lcid, DISPID* rgDispId )
1965{
1967 return IMXWriter_GetIDsOfNames(&This->IMXWriter_iface, riid, rgszNames, cNames, lcid, rgDispId);
1968}
1969
1970static HRESULT WINAPI VBSAXLexicalHandler_Invoke(IVBSAXLexicalHandler *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
1971 WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr )
1972{
1974 return IMXWriter_Invoke(&This->IMXWriter_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult,
1975 pExcepInfo, puArgErr);
1976}
1977
1978static HRESULT WINAPI VBSAXLexicalHandler_startDTD(IVBSAXLexicalHandler *iface, BSTR *name, BSTR *publicId, BSTR *systemId)
1979{
1981
1982 TRACE("(%p)->(%p %p %p)\n", This, name, publicId, systemId);
1983
1984 if (!name || !publicId || !systemId)
1985 return E_POINTER;
1986
1987 return ISAXLexicalHandler_startDTD(&This->ISAXLexicalHandler_iface, *name, -1, *publicId, -1, *systemId, -1);
1988}
1989
1990static HRESULT WINAPI VBSAXLexicalHandler_endDTD(IVBSAXLexicalHandler *iface)
1991{
1993 return ISAXLexicalHandler_endDTD(&This->ISAXLexicalHandler_iface);
1994}
1995
1996static HRESULT WINAPI VBSAXLexicalHandler_startEntity(IVBSAXLexicalHandler *iface, BSTR *name)
1997{
1999
2000 TRACE("(%p)->(%p)\n", This, name);
2001
2002 if (!name)
2003 return E_POINTER;
2004
2005 return ISAXLexicalHandler_startEntity(&This->ISAXLexicalHandler_iface, *name, -1);
2006}
2007
2008static HRESULT WINAPI VBSAXLexicalHandler_endEntity(IVBSAXLexicalHandler *iface, BSTR *name)
2009{
2011
2012 TRACE("(%p)->(%p)\n", This, name);
2013
2014 if (!name)
2015 return E_POINTER;
2016
2017 return ISAXLexicalHandler_endEntity(&This->ISAXLexicalHandler_iface, *name, -1);
2018}
2019
2020static HRESULT WINAPI VBSAXLexicalHandler_startCDATA(IVBSAXLexicalHandler *iface)
2021{
2023 return ISAXLexicalHandler_startCDATA(&This->ISAXLexicalHandler_iface);
2024}
2025
2026static HRESULT WINAPI VBSAXLexicalHandler_endCDATA(IVBSAXLexicalHandler *iface)
2027{
2029 return ISAXLexicalHandler_endCDATA(&This->ISAXLexicalHandler_iface);
2030}
2031
2032static HRESULT WINAPI VBSAXLexicalHandler_comment(IVBSAXLexicalHandler *iface, BSTR *chars)
2033{
2035
2036 TRACE("(%p)->(%p)\n", This, chars);
2037
2038 if (!chars)
2039 return E_POINTER;
2040
2041 return ISAXLexicalHandler_comment(&This->ISAXLexicalHandler_iface, *chars, -1);
2042}
2043
2044static const IVBSAXLexicalHandlerVtbl VBSAXLexicalHandlerVtbl = {
2059};
2060
2061/*** IVBSAXContentHandler ***/
2062static HRESULT WINAPI VBSAXContentHandler_QueryInterface(IVBSAXContentHandler *iface, REFIID riid, void **obj)
2063{
2065 return IMXWriter_QueryInterface(&This->IMXWriter_iface, riid, obj);
2066}
2067
2068static ULONG WINAPI VBSAXContentHandler_AddRef(IVBSAXContentHandler *iface)
2069{
2071 return IMXWriter_AddRef(&This->IMXWriter_iface);
2072}
2073
2074static ULONG WINAPI VBSAXContentHandler_Release(IVBSAXContentHandler *iface)
2075{
2077 return IMXWriter_Release(&This->IMXWriter_iface);
2078}
2079
2080static HRESULT WINAPI VBSAXContentHandler_GetTypeInfoCount(IVBSAXContentHandler *iface, UINT* pctinfo)
2081{
2083 return IMXWriter_GetTypeInfoCount(&This->IMXWriter_iface, pctinfo);
2084}
2085
2086static HRESULT WINAPI VBSAXContentHandler_GetTypeInfo(IVBSAXContentHandler *iface, UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo)
2087{
2089 return IMXWriter_GetTypeInfo(&This->IMXWriter_iface, iTInfo, lcid, ppTInfo);
2090}
2091
2092static HRESULT WINAPI VBSAXContentHandler_GetIDsOfNames(IVBSAXContentHandler *iface, REFIID riid, LPOLESTR* rgszNames,
2093 UINT cNames, LCID lcid, DISPID* rgDispId )
2094{
2096 return IMXWriter_GetIDsOfNames(&This->IMXWriter_iface, riid, rgszNames, cNames, lcid, rgDispId);
2097}
2098
2099static HRESULT WINAPI VBSAXContentHandler_Invoke(IVBSAXContentHandler *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
2100 WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr )
2101{
2103 return IMXWriter_Invoke(&This->IMXWriter_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult,
2104 pExcepInfo, puArgErr);
2105}
2106
2107static HRESULT WINAPI VBSAXContentHandler_putref_documentLocator(IVBSAXContentHandler *iface, IVBSAXLocator *locator)
2108{
2110 TRACE("(%p)->(%p)\n", This, locator);
2111 return S_OK;
2112}
2113
2114static HRESULT WINAPI VBSAXContentHandler_startDocument(IVBSAXContentHandler *iface)
2115{
2117 return ISAXContentHandler_startDocument(&This->ISAXContentHandler_iface);
2118}
2119
2120static HRESULT WINAPI VBSAXContentHandler_endDocument(IVBSAXContentHandler *iface)
2121{
2123 return ISAXContentHandler_endDocument(&This->ISAXContentHandler_iface);
2124}
2125
2127{
2129
2130 TRACE("(%p)->(%p %p)\n", This, prefix, uri);
2131
2132 if (!prefix || !uri)
2133 return E_POINTER;
2134
2135 return ISAXContentHandler_startPrefixMapping(&This->ISAXContentHandler_iface, *prefix, -1, *uri, -1);
2136}
2137
2139{
2141
2142 TRACE("(%p)->(%p)\n", This, prefix);
2143
2144 if (!prefix)
2145 return E_POINTER;
2146
2147 return ISAXContentHandler_endPrefixMapping(&This->ISAXContentHandler_iface, *prefix, -1);
2148}
2149
2150static HRESULT WINAPI VBSAXContentHandler_startElement(IVBSAXContentHandler *iface,
2151 BSTR *namespaceURI, BSTR *localName, BSTR *QName, IVBSAXAttributes *attrs)
2152{
2154
2155 TRACE("(%p)->(%p %p %p %p)\n", This, namespaceURI, localName, QName, attrs);
2156
2157 if (!namespaceURI || !*namespaceURI || !localName || !QName)
2158 return E_INVALIDARG;
2159
2160 TRACE("(%s %s %s)\n", debugstr_w(*namespaceURI), debugstr_w(*localName), debugstr_w(*QName));
2161
2162 mxwriter_write_starttag(This, *QName, SysStringLen(*QName));
2163
2164 if (attrs)
2165 {
2166 int length, i, escape;
2167 HRESULT hr;
2168
2169 hr = IVBSAXAttributes_get_length(attrs, &length);
2170 if (FAILED(hr)) return hr;
2171
2172 escape = This->props[MXWriter_DisableEscaping] == VARIANT_FALSE ||
2173 (This->class_version == MSXML4 || This->class_version == MSXML6);
2174
2175 for (i = 0; i < length; i++)
2176 {
2177 BSTR qname, value;
2178
2179 hr = IVBSAXAttributes_getQName(attrs, i, &qname);
2180 if (FAILED(hr)) return hr;
2181
2182 hr = IVBSAXAttributes_getValue(attrs, i, &value);
2183 if (FAILED(hr))
2184 {
2185 SysFreeString(qname);
2186 return hr;
2187 }
2188
2190 SysFreeString(qname);
2192 }
2193 }
2194
2195 return S_OK;
2196}
2197
2198static HRESULT WINAPI VBSAXContentHandler_endElement(IVBSAXContentHandler *iface, BSTR *namespaceURI,
2199 BSTR *localName, BSTR *QName)
2200{
2202
2203 TRACE("(%p)->(%p %p %p)\n", This, namespaceURI, localName, QName);
2204
2205 if (!namespaceURI || !localName || !QName)
2206 return E_POINTER;
2207
2208 return ISAXContentHandler_endElement(&This->ISAXContentHandler_iface,
2209 *namespaceURI, SysStringLen(*namespaceURI),
2210 *localName, SysStringLen(*localName),
2211 *QName, SysStringLen(*QName));
2212}
2213
2214static HRESULT WINAPI VBSAXContentHandler_characters(IVBSAXContentHandler *iface, BSTR *chars)
2215{
2217
2218 TRACE("(%p)->(%p)\n", This, chars);
2219
2220 if (!chars)
2221 return E_POINTER;
2222
2223 return ISAXContentHandler_characters(&This->ISAXContentHandler_iface, *chars, SysStringLen(*chars));
2224}
2225
2226static HRESULT WINAPI VBSAXContentHandler_ignorableWhitespace(IVBSAXContentHandler *iface, BSTR *chars)
2227{
2229
2230 TRACE("(%p)->(%p)\n", This, chars);
2231
2232 if (!chars)
2233 return E_POINTER;
2234
2235 return ISAXContentHandler_ignorableWhitespace(&This->ISAXContentHandler_iface, *chars, -1);
2236}
2237
2239 BSTR *target, BSTR *data)
2240{
2242
2243 TRACE("(%p)->(%p %p)\n", This, target, data);
2244
2245 if (!target || !data)
2246 return E_POINTER;
2247
2248 return ISAXContentHandler_processingInstruction(&This->ISAXContentHandler_iface, *target, -1, *data, -1);
2249}
2250
2251static HRESULT WINAPI VBSAXContentHandler_skippedEntity(IVBSAXContentHandler *iface, BSTR *name)
2252{
2254
2255 TRACE("(%p)->(%p)\n", This, name);
2256
2257 if (!name)
2258 return E_POINTER;
2259
2260 return ISAXContentHandler_skippedEntity(&This->ISAXContentHandler_iface, *name, -1);
2261}
2262
2263static const IVBSAXContentHandlerVtbl VBSAXContentHandlerVtbl = {
2282};
2283
2284static HRESULT WINAPI SAXDTDHandler_QueryInterface(ISAXDTDHandler *iface, REFIID riid, void **obj)
2285{
2287 return IMXWriter_QueryInterface(&This->IMXWriter_iface, riid, obj);
2288}
2289
2290static ULONG WINAPI SAXDTDHandler_AddRef(ISAXDTDHandler *iface)
2291{
2293 return IMXWriter_AddRef(&This->IMXWriter_iface);
2294}
2295
2296static ULONG WINAPI SAXDTDHandler_Release(ISAXDTDHandler *iface)
2297{
2299 return IMXWriter_Release(&This->IMXWriter_iface);
2300}
2301
2302static HRESULT WINAPI SAXDTDHandler_notationDecl(ISAXDTDHandler *iface,
2303 const WCHAR *name, INT n_name,
2304 const WCHAR *publicid, INT n_publicid,
2305 const WCHAR *systemid, INT n_systemid)
2306{
2307 static const WCHAR notationW[] = {'<','!','N','O','T','A','T','I','O','N',' '};
2309
2310 TRACE("(%p)->(%s:%d, %s:%d, %s:%d)\n", This, debugstr_wn(name, n_name), n_name,
2311 debugstr_wn(publicid, n_publicid), n_publicid, debugstr_wn(systemid, n_systemid), n_systemid);
2312
2313 if (!name || !n_name)
2314 return E_INVALIDARG;
2315
2316 write_output_buffer(This, notationW, ARRAY_SIZE(notationW));
2317 write_output_buffer(This, name, n_name);
2318
2319 if (!publicid && !systemid)
2320 return E_INVALIDARG;
2321
2323 if (publicid)
2324 {
2326 write_output_buffer_quoted(This, publicid, n_publicid);
2327 if (systemid)
2328 {
2330 write_output_buffer_quoted(This, systemid, n_systemid);
2331 }
2332 }
2333 else
2334 {
2336 write_output_buffer_quoted(This, systemid, n_systemid);
2337 }
2338
2340
2341 return S_OK;
2342}
2343
2345 const WCHAR *name, INT nname,
2346 const WCHAR *publicid, INT npublicid,
2347 const WCHAR *systemid, INT nsystemid,
2348 const WCHAR *notation, INT nnotation)
2349{
2351 FIXME("(%p)->(%s:%d, %s:%d, %s:%d, %s:%d): stub\n", This, debugstr_wn(name, nname), nname,
2352 debugstr_wn(publicid, npublicid), npublicid, debugstr_wn(systemid, nsystemid), nsystemid,
2353 debugstr_wn(notation, nnotation), nnotation);
2354 return E_NOTIMPL;
2355}
2356
2357static const ISAXDTDHandlerVtbl SAXDTDHandlerVtbl = {
2363};
2364
2365/*** IVBSAXDTDHandler ***/
2366static HRESULT WINAPI VBSAXDTDHandler_QueryInterface(IVBSAXDTDHandler *iface, REFIID riid, void **obj)
2367{
2369 return IMXWriter_QueryInterface(&This->IMXWriter_iface, riid, obj);
2370}
2371
2372static ULONG WINAPI VBSAXDTDHandler_AddRef(IVBSAXDTDHandler *iface)
2373{
2375 return IMXWriter_AddRef(&This->IMXWriter_iface);
2376}
2377
2378static ULONG WINAPI VBSAXDTDHandler_Release(IVBSAXDTDHandler *iface)
2379{
2381 return IMXWriter_Release(&This->IMXWriter_iface);
2382}
2383
2384static HRESULT WINAPI VBSAXDTDHandler_GetTypeInfoCount(IVBSAXDTDHandler *iface, UINT* pctinfo)
2385{
2387 return IMXWriter_GetTypeInfoCount(&This->IMXWriter_iface, pctinfo);
2388}
2389
2390static HRESULT WINAPI VBSAXDTDHandler_GetTypeInfo(IVBSAXDTDHandler *iface, UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo)
2391{
2393 return IMXWriter_GetTypeInfo(&This->IMXWriter_iface, iTInfo, lcid, ppTInfo);
2394}
2395
2396static HRESULT WINAPI VBSAXDTDHandler_GetIDsOfNames(IVBSAXDTDHandler *iface, REFIID riid, LPOLESTR* rgszNames,
2397 UINT cNames, LCID lcid, DISPID* rgDispId )
2398{
2400 return IMXWriter_GetIDsOfNames(&This->IMXWriter_iface, riid, rgszNames, cNames, lcid, rgDispId);
2401}
2402
2403static HRESULT WINAPI VBSAXDTDHandler_Invoke(IVBSAXDTDHandler *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
2404 WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr )
2405{
2407 return IMXWriter_Invoke(&This->IMXWriter_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult,
2408 pExcepInfo, puArgErr);
2409}
2410
2411static HRESULT WINAPI VBSAXDTDHandler_notationDecl(IVBSAXDTDHandler *iface, BSTR *name, BSTR *publicId, BSTR *systemId)
2412{
2414
2415 TRACE("(%p)->(%p %p %p)\n", This, name, publicId, systemId);
2416
2417 if (!name || !publicId || !systemId)
2418 return E_POINTER;
2419
2420 return ISAXDTDHandler_notationDecl(&This->ISAXDTDHandler_iface, *name, -1, *publicId, -1, *systemId, -1);
2421}
2422
2423static HRESULT WINAPI VBSAXDTDHandler_unparsedEntityDecl(IVBSAXDTDHandler *iface, BSTR *name, BSTR *publicId,
2424 BSTR *systemId, BSTR *notation)
2425{
2427
2428 TRACE("(%p)->(%p %p %p %p)\n", This, name, publicId, systemId, notation);
2429
2430 if (!name || !publicId || !systemId || !notation)
2431 return E_POINTER;
2432
2433 return ISAXDTDHandler_unparsedEntityDecl(&This->ISAXDTDHandler_iface, *name, -1, *publicId, -1,
2434 *systemId, -1, *notation, -1);
2435}
2436
2437static const IVBSAXDTDHandlerVtbl VBSAXDTDHandlerVtbl = {
2447};
2448
2449/* ISAXErrorHandler */
2450static HRESULT WINAPI SAXErrorHandler_QueryInterface(ISAXErrorHandler *iface, REFIID riid, void **obj)
2451{
2453 return IMXWriter_QueryInterface(&This->IMXWriter_iface, riid, obj);
2454}
2455
2456static ULONG WINAPI SAXErrorHandler_AddRef(ISAXErrorHandler *iface)
2457{
2459 return IMXWriter_AddRef(&This->IMXWriter_iface);
2460}
2461
2462static ULONG WINAPI SAXErrorHandler_Release(ISAXErrorHandler *iface)
2463{
2465 return IMXWriter_Release(&This->IMXWriter_iface);
2466}
2467
2468static HRESULT WINAPI SAXErrorHandler_error(ISAXErrorHandler *iface,
2469 ISAXLocator *locator, const WCHAR *message, HRESULT hr)
2470{
2471 FIXME("%p, %p, %s, %#lx.\n", iface, locator, debugstr_w(message), hr);
2472
2473 return E_NOTIMPL;
2474}
2475
2476static HRESULT WINAPI SAXErrorHandler_fatalError(ISAXErrorHandler *iface,
2477 ISAXLocator *locator, const WCHAR *message, HRESULT hr)
2478{
2479 FIXME("%p, %p, %s, %#lx.\n", iface, locator, debugstr_w(message), hr);
2480
2481 return E_NOTIMPL;
2482}
2483
2484static HRESULT WINAPI SAXErrorHandler_ignorableWarning(ISAXErrorHandler *iface,
2485 ISAXLocator *locator, const WCHAR *message, HRESULT hr)
2486{
2487 FIXME("%p, %p, %s, %#lx.\n", iface, locator, debugstr_w(message), hr);
2488
2489 return E_NOTIMPL;
2490}
2491
2492static const ISAXErrorHandlerVtbl SAXErrorHandlerVtbl = {
2499};
2500
2501/*** IVBSAXErrorHandler ***/
2502static HRESULT WINAPI VBSAXErrorHandler_QueryInterface(IVBSAXErrorHandler *iface, REFIID riid, void **obj)
2503{
2505 return IMXWriter_QueryInterface(&This->IMXWriter_iface, riid, obj);
2506}
2507
2508static ULONG WINAPI VBSAXErrorHandler_AddRef(IVBSAXErrorHandler *iface)
2509{
2511 return IMXWriter_AddRef(&This->IMXWriter_iface);
2512}
2513
2514static ULONG WINAPI VBSAXErrorHandler_Release(IVBSAXErrorHandler *iface)
2515{
2517 return IMXWriter_Release(&This->IMXWriter_iface);
2518}
2519
2520static HRESULT WINAPI VBSAXErrorHandler_GetTypeInfoCount(IVBSAXErrorHandler *iface, UINT* pctinfo)
2521{
2523 return IMXWriter_GetTypeInfoCount(&This->IMXWriter_iface, pctinfo);
2524}
2525
2526static HRESULT WINAPI VBSAXErrorHandler_GetTypeInfo(IVBSAXErrorHandler *iface, UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo)
2527{
2529 return IMXWriter_GetTypeInfo(&This->IMXWriter_iface, iTInfo, lcid, ppTInfo);
2530}
2531
2532static HRESULT WINAPI VBSAXErrorHandler_GetIDsOfNames(IVBSAXErrorHandler *iface, REFIID riid, LPOLESTR* rgszNames,
2533 UINT cNames, LCID lcid, DISPID* rgDispId )
2534{
2536 return IMXWriter_GetIDsOfNames(&This->IMXWriter_iface, riid, rgszNames, cNames, lcid, rgDispId);
2537}
2538
2539static HRESULT WINAPI VBSAXErrorHandler_Invoke(IVBSAXErrorHandler *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
2540 WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr )
2541{
2543 return IMXWriter_Invoke(&This->IMXWriter_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult,
2544 pExcepInfo, puArgErr);
2545}
2546
2547static HRESULT WINAPI VBSAXErrorHandler_error(IVBSAXErrorHandler *iface, IVBSAXLocator *locator, BSTR *message, LONG code)
2548{
2549 FIXME("%p, %p, %p, %lx: stub\n", iface, locator, message, code);
2550 return E_NOTIMPL;
2551}
2552
2553static HRESULT WINAPI VBSAXErrorHandler_fatalError(IVBSAXErrorHandler *iface, IVBSAXLocator *locator, BSTR *message, LONG code)
2554{
2555 FIXME("%p, %p, %p, %lx: stub\n", iface, locator, message, code);
2556 return E_NOTIMPL;
2557}
2558
2559static HRESULT WINAPI VBSAXErrorHandler_ignorableWarning(IVBSAXErrorHandler *iface, IVBSAXLocator *locator, BSTR *message, LONG code)
2560{
2561 FIXME("%p, %p, %p, %lx: stub\n", iface, locator, message, code);
2562 return E_NOTIMPL;
2563}
2564
2565static const IVBSAXErrorHandlerVtbl VBSAXErrorHandlerVtbl = {
2576};
2577
2578static const tid_t mxwriter_iface_tids[] = {
2580 0
2581};
2582
2584 NULL,
2586 NULL,
2588};
2589
2591{
2592 static const WCHAR version10W[] = {'1','.','0',0};
2593 mxwriter *This;
2594 HRESULT hr;
2595
2596 TRACE("(%p)\n", ppObj);
2597
2598 This = malloc(sizeof(*This));
2599 if(!This)
2600 return E_OUTOFMEMORY;
2601
2602 This->IMXWriter_iface.lpVtbl = &MXWriterVtbl;
2603 This->ISAXContentHandler_iface.lpVtbl = &SAXContentHandlerVtbl;
2604 This->ISAXLexicalHandler_iface.lpVtbl = &SAXLexicalHandlerVtbl;
2605 This->ISAXDeclHandler_iface.lpVtbl = &SAXDeclHandlerVtbl;
2606 This->ISAXDTDHandler_iface.lpVtbl = &SAXDTDHandlerVtbl;
2607 This->ISAXErrorHandler_iface.lpVtbl = &SAXErrorHandlerVtbl;
2608 This->IVBSAXDeclHandler_iface.lpVtbl = &VBSAXDeclHandlerVtbl;
2609 This->IVBSAXLexicalHandler_iface.lpVtbl = &VBSAXLexicalHandlerVtbl;
2610 This->IVBSAXContentHandler_iface.lpVtbl = &VBSAXContentHandlerVtbl;
2611 This->IVBSAXDTDHandler_iface.lpVtbl = &VBSAXDTDHandlerVtbl;
2612 This->IVBSAXErrorHandler_iface.lpVtbl = &VBSAXErrorHandlerVtbl;
2613 This->ref = 1;
2614 This->class_version = version;
2615
2616 This->props[MXWriter_BOM] = VARIANT_TRUE;
2617 This->props[MXWriter_DisableEscaping] = VARIANT_FALSE;
2618 This->props[MXWriter_Indent] = VARIANT_FALSE;
2619 This->props[MXWriter_OmitXmlDecl] = VARIANT_FALSE;
2620 This->props[MXWriter_Standalone] = VARIANT_FALSE;
2621 This->prop_changed = FALSE;
2622 This->encoding = SysAllocString(utf16W);
2623 This->version = SysAllocString(version10W);
2624 This->xml_enc = XmlEncoding_UTF16;
2625
2626 This->element = NULL;
2627 This->cdata = FALSE;
2628 This->indent = 0;
2629 This->text = FALSE;
2630 This->newline = FALSE;
2631
2632 This->dest = NULL;
2633
2634 hr = init_output_buffer(This->xml_enc, &This->buffer);
2635 if (hr != S_OK) {
2636 SysFreeString(This->encoding);
2637 SysFreeString(This->version);
2638 free(This);
2639 return hr;
2640 }
2641
2642 init_dispex(&This->dispex, (IUnknown*)&This->IMXWriter_iface, &mxwriter_dispex);
2643
2644 *ppObj = &This->IMXWriter_iface;
2645
2646 TRACE("returning iface %p\n", *ppObj);
2647
2648 return S_OK;
2649}
2650
2651static HRESULT WINAPI MXAttributes_QueryInterface(IMXAttributes *iface, REFIID riid, void **ppObj)
2652{
2654
2655 TRACE("(%p)->(%s %p)\n", This, debugstr_guid( riid ), ppObj);
2656
2657 *ppObj = NULL;
2658
2659 if ( IsEqualGUID( riid, &IID_IUnknown ) ||
2661 IsEqualGUID( riid, &IID_IMXAttributes ))
2662 {
2663 *ppObj = iface;
2664 }
2665 else if ( IsEqualGUID( riid, &IID_ISAXAttributes ))
2666 {
2667 *ppObj = &This->ISAXAttributes_iface;
2668 }
2669 else if ( IsEqualGUID( riid, &IID_IVBSAXAttributes ))
2670 {
2671 *ppObj = &This->IVBSAXAttributes_iface;
2672 }
2673 else if (dispex_query_interface(&This->dispex, riid, ppObj))
2674 {
2675 return *ppObj ? S_OK : E_NOINTERFACE;
2676 }
2677 else
2678 {
2679 FIXME("interface %s not implemented\n", debugstr_guid(riid));
2680 return E_NOINTERFACE;
2681 }
2682
2683 IMXAttributes_AddRef( iface );
2684
2685 return S_OK;
2686}
2687
2688static ULONG WINAPI MXAttributes_AddRef(IMXAttributes *iface)
2689{
2692 TRACE("%p, refcount %lu.\n", iface, ref );
2693 return ref;
2694}
2695
2696static ULONG WINAPI MXAttributes_Release(IMXAttributes *iface)
2697{
2700
2701 TRACE("%p, refcount %lu.\n", iface, ref);
2702
2703 if (!ref)
2704 {
2705 int i;
2706
2707 for (i = 0; i < This->length; i++)
2708 {
2709 SysFreeString(This->attr[i].qname);
2710 SysFreeString(This->attr[i].local);
2711 SysFreeString(This->attr[i].uri);
2712 SysFreeString(This->attr[i].type);
2713 SysFreeString(This->attr[i].value);
2714 }
2715
2716 free(This->attr);
2717 free(This);
2718 }
2719
2720 return ref;
2721}
2722
2723static HRESULT WINAPI MXAttributes_GetTypeInfoCount(IMXAttributes *iface, UINT* pctinfo)
2724{
2726 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
2727}
2728
2729static HRESULT WINAPI MXAttributes_GetTypeInfo(IMXAttributes *iface, UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo)
2730{
2732 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
2733}
2734
2736 IMXAttributes *iface,
2737 REFIID riid,
2738 LPOLESTR* rgszNames,
2739 UINT cNames,
2740 LCID lcid,
2741 DISPID* rgDispId)
2742{
2744 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface,
2745 riid, rgszNames, cNames, lcid, rgDispId);
2746}
2747
2749 IMXAttributes *iface,
2750 DISPID dispIdMember,
2751 REFIID riid,
2752 LCID lcid,
2753 WORD wFlags,
2754 DISPPARAMS* pDispParams,
2755 VARIANT* pVarResult,
2756 EXCEPINFO* pExcepInfo,
2757 UINT* puArgErr)
2758{
2760 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface,
2761 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2762}
2763
2764static HRESULT WINAPI MXAttributes_addAttribute(IMXAttributes *iface,
2765 BSTR uri, BSTR localName, BSTR QName, BSTR type, BSTR value)
2766{
2769 HRESULT hr;
2770
2771 TRACE("(%p)->(%s %s %s %s %s)\n", This, debugstr_w(uri), debugstr_w(localName),
2773
2774 if ((!uri || !localName || !QName || !type || !value) && This->class_version != MSXML6)
2775 return E_INVALIDARG;
2776
2777 /* ensure array is large enough */
2779 if (hr != S_OK) return hr;
2780
2781 attr = &This->attr[This->length];
2782
2783 attr->qname = SysAllocString(QName);
2784 attr->local = SysAllocString(localName);
2785 attr->uri = SysAllocString(uri);
2786 attr->type = SysAllocString(type ? type : emptyW);
2788 This->length++;
2789
2790 return S_OK;
2791}
2792
2794 VARIANT atts, int index)
2795{
2797 FIXME("(%p)->(%s %d): stub\n", This, debugstr_variant(&atts), index);
2798 return E_NOTIMPL;
2799}
2800
2801static HRESULT WINAPI MXAttributes_clear(IMXAttributes *iface)
2802{
2804 int i;
2805
2806 TRACE("(%p)\n", This);
2807
2808 for (i = 0; i < This->length; i++)
2809 {
2810 SysFreeString(This->attr[i].qname);
2811 SysFreeString(This->attr[i].local);
2812 SysFreeString(This->attr[i].uri);
2813 SysFreeString(This->attr[i].type);
2814 SysFreeString(This->attr[i].value);
2815 memset(&This->attr[i], 0, sizeof(mxattribute));
2816 }
2817
2818 This->length = 0;
2819
2820 return S_OK;
2821}
2822
2824{
2825 if (index < 0 || index >= attrs->length) return NULL;
2826 return &attrs->attr[index];
2827}
2828
2829static HRESULT WINAPI MXAttributes_removeAttribute(IMXAttributes *iface, int index)
2830{
2833
2834 TRACE("(%p)->(%d)\n", This, index);
2835
2836 if (!(dst = get_attribute_byindex(This, index))) return E_INVALIDARG;
2837
2838 /* no need to remove last attribute, just make it inaccessible */
2839 if (index + 1 == This->length)
2840 {
2841 This->length--;
2842 return S_OK;
2843 }
2844
2845 memmove(dst, dst + 1, (This->length-index-1)*sizeof(*dst));
2846 This->length--;
2847
2848 return S_OK;
2849}
2850
2851static HRESULT WINAPI MXAttributes_setAttribute(IMXAttributes *iface, int index,
2852 BSTR uri, BSTR localName, BSTR QName, BSTR type, BSTR value)
2853{
2855 FIXME("(%p)->(%d %s %s %s %s %s): stub\n", This, index, debugstr_w(uri),
2856 debugstr_w(localName), debugstr_w(QName), debugstr_w(type), debugstr_w(value));
2857 return E_NOTIMPL;
2858}
2859
2861{
2863 FIXME("(%p)->(%s): stub\n", This, debugstr_variant(&atts));
2864 return E_NOTIMPL;
2865}
2866
2867static HRESULT WINAPI MXAttributes_setLocalName(IMXAttributes *iface, int index,
2868 BSTR localName)
2869{
2872
2873 TRACE("(%p)->(%d %s)\n", This, index, debugstr_w(localName));
2874
2876
2877 SysFreeString(attr->local);
2878 attr->local = SysAllocString(localName);
2879
2880 return S_OK;
2881}
2882
2883static HRESULT WINAPI MXAttributes_setQName(IMXAttributes *iface, int index, BSTR QName)
2884{
2887
2888 TRACE("(%p)->(%d %s)\n", This, index, debugstr_w(QName));
2889
2891
2892 SysFreeString(attr->qname);
2893 attr->qname = SysAllocString(QName);
2894
2895 return S_OK;
2896}
2897
2898static HRESULT WINAPI MXAttributes_setURI(IMXAttributes *iface, int index, BSTR uri)
2899{
2902
2903 TRACE("(%p)->(%d %s)\n", This, index, debugstr_w(uri));
2904
2906
2907 SysFreeString(attr->uri);
2908 attr->uri = SysAllocString(uri);
2909
2910 return S_OK;
2911}
2912
2913static HRESULT WINAPI MXAttributes_setValue(IMXAttributes *iface, int index, BSTR value)
2914{
2917
2918 TRACE("(%p)->(%d %s)\n", This, index, debugstr_w(value));
2919
2921
2924
2925 return S_OK;
2926}
2927
2928static const IMXAttributesVtbl MXAttributesVtbl = {
2946};
2947
2949{
2951 return IMXAttributes_QueryInterface(&This->IMXAttributes_iface, riid, ppObj);
2952}
2953
2955{
2957 return IMXAttributes_AddRef(&This->IMXAttributes_iface);
2958}
2959
2961{
2963 return IMXAttributes_Release(&This->IMXAttributes_iface);
2964}
2965
2967{
2969 TRACE("(%p)->(%p)\n", This, length);
2970
2971 if (!length && (This->class_version == MSXML_DEFAULT || This->class_version == MSXML3))
2972 return E_POINTER;
2973
2974 *length = This->length;
2975
2976 return S_OK;
2977}
2978
2980 int *len)
2981{
2983
2984 TRACE("(%p)->(%d %p %p)\n", This, index, uri, len);
2985
2986 if (index >= This->length || index < 0) return E_INVALIDARG;
2987 if (!uri || !len) return E_POINTER;
2988
2989 *len = SysStringLen(This->attr[index].uri);
2990 *uri = This->attr[index].uri;
2991
2992 return S_OK;
2993}
2994
2996 int *len)
2997{
2999
3000 TRACE("(%p)->(%d %p %p)\n", This, index, name, len);
3001
3002 if (index >= This->length || index < 0) return E_INVALIDARG;
3003 if (!name || !len) return E_POINTER;
3004
3005 *len = SysStringLen(This->attr[index].local);
3006 *name = This->attr[index].local;
3007
3008 return S_OK;
3009}
3010
3011static HRESULT WINAPI SAXAttributes_getQName(ISAXAttributes *iface, int index, const WCHAR **qname, int *length)
3012{
3014
3015 TRACE("(%p)->(%d %p %p)\n", This, index, qname, length);
3016
3017 if (index >= This->length) return E_INVALIDARG;
3018 if (!qname || !length) return E_POINTER;
3019
3020 *qname = This->attr[index].qname;
3021 *length = SysStringLen(This->attr[index].qname);
3022
3023 return S_OK;
3024}
3025
3026static HRESULT WINAPI SAXAttributes_getName(ISAXAttributes *iface, int index, const WCHAR **uri, int *uri_len,
3027 const WCHAR **local, int *local_len, const WCHAR **qname, int *qname_len)
3028{
3030
3031 TRACE("(%p)->(%d %p %p %p %p %p %p)\n", This, index, uri, uri_len, local, local_len, qname, qname_len);
3032
3033 if (index >= This->length || index < 0)
3034 return E_INVALIDARG;
3035
3036 if (!uri || !uri_len || !local || !local_len || !qname || !qname_len)
3037 return E_POINTER;
3038
3039 *uri_len = SysStringLen(This->attr[index].uri);
3040 *uri = This->attr[index].uri;
3041
3042 *local_len = SysStringLen(This->attr[index].local);
3043 *local = This->attr[index].local;
3044
3045 *qname_len = SysStringLen(This->attr[index].qname);
3046 *qname = This->attr[index].qname;
3047
3048 TRACE("(%s, %s, %s)\n", debugstr_w(*uri), debugstr_w(*local), debugstr_w(*qname));
3049
3050 return S_OK;
3051}
3052
3054 const WCHAR *name, int len, int *index)
3055{
3057 int i;
3058
3059 TRACE("(%p)->(%s:%d %s:%d %p)\n", This, debugstr_wn(uri, uri_len), uri_len,
3061
3062 if (!index && (This->class_version == MSXML_DEFAULT || This->class_version == MSXML3))
3063 return E_POINTER;
3064
3065 if (!uri || !name || !index) return E_INVALIDARG;
3066
3067 for (i = 0; i < This->length; i++)
3068 {
3069 if (uri_len != SysStringLen(This->attr[i].uri)) continue;
3070 if (wcsncmp(uri, This->attr[i].uri, uri_len)) continue;
3071
3072 if (len != SysStringLen(This->attr[i].local)) continue;
3073 if (wcsncmp(name, This->attr[i].local, len)) continue;
3074
3075 *index = i;
3076 return S_OK;
3077 }
3078
3079 return E_INVALIDARG;
3080}
3081
3083 int len, int *index)
3084{
3086 int i;
3087
3088 TRACE("(%p)->(%s:%d %p)\n", This, debugstr_wn(qname, len), len, index);
3089
3090 if (!index && (This->class_version == MSXML_DEFAULT || This->class_version == MSXML3))
3091 return E_POINTER;
3092
3093 if (!qname || !index || !len) return E_INVALIDARG;
3094
3095 for (i = 0; i < This->length; i++)
3096 {
3097 if (len != SysStringLen(This->attr[i].qname)) continue;
3098 if (wcsncmp(qname, This->attr[i].qname, len)) continue;
3099
3100 *index = i;
3101 return S_OK;
3102 }
3103
3104 return E_INVALIDARG;
3105}
3106
3108 int *len)
3109{
3111
3112 TRACE("(%p)->(%d %p %p)\n", This, index, type, len);
3113
3114 if (index >= This->length) return E_INVALIDARG;
3115
3116 if ((!type || !len) && (This->class_version == MSXML_DEFAULT || This->class_version == MSXML3))
3117 return E_POINTER;
3118
3119 *type = This->attr[index].type;
3120 *len = SysStringLen(This->attr[index].type);
3121
3122 return S_OK;
3123}
3124
3126 const WCHAR * pLocalName, int nLocalName, const WCHAR ** pType, int * nType)
3127{
3129 FIXME("(%p)->(%s:%d %s:%d %p %p): stub\n", This, debugstr_wn(pUri, nUri), nUri,
3130 debugstr_wn(pLocalName, nLocalName), nLocalName, pType, nType);
3131 return E_NOTIMPL;
3132}
3133
3135 int nQName, const WCHAR ** pType, int * nType)
3136{
3138 FIXME("(%p)->(%s:%d %p %p): stub\n", This, debugstr_wn(pQName, nQName), nQName, pType, nType);
3139 return E_NOTIMPL;
3140}
3141
3143 int *len)
3144{
3146
3147 TRACE("(%p)->(%d %p %p)\n", This, index, value, len);
3148
3149 if (index >= This->length) return E_INVALIDARG;
3150
3151 if ((!value || !len) && (This->class_version == MSXML_DEFAULT || This->class_version == MSXML3))
3152 return E_POINTER;
3153
3154 *value = This->attr[index].value;
3155 *len = SysStringLen(This->attr[index].value);
3156
3157 return S_OK;
3158}
3159
3161 int uri_len, const WCHAR *name, int name_len, const WCHAR **value, int *value_len)
3162{
3164 HRESULT hr;
3165 int index;
3166
3167 TRACE("(%p)->(%s:%d %s:%d %p %p)\n", This, debugstr_wn(uri, uri_len), uri_len,
3168 debugstr_wn(name, name_len), name_len, value, value_len);
3169
3170 if (!uri || !name || !value || !value_len)
3171 return (This->class_version == MSXML_DEFAULT || This->class_version == MSXML3) ? E_POINTER : E_INVALIDARG;
3172
3173 hr = ISAXAttributes_getIndexFromName(iface, uri, uri_len, name, name_len, &index);
3174 if (hr == S_OK)
3175 hr = ISAXAttributes_getValue(iface, index, value, value_len);
3176
3177 return hr;
3178}
3179
3181 int qname_len, const WCHAR **value, int *value_len)
3182{
3184 HRESULT hr;
3185 int index;
3186
3187 TRACE("(%p)->(%s:%d %p %p)\n", This, debugstr_wn(qname, qname_len), qname_len, value, value_len);
3188
3189 if (!qname || !value || !value_len)
3190 return (This->class_version == MSXML_DEFAULT || This->class_version == MSXML3) ? E_POINTER : E_INVALIDARG;
3191
3192 hr = ISAXAttributes_getIndexFromQName(iface, qname, qname_len, &index);
3193 if (hr == S_OK)
3194 hr = ISAXAttributes_getValue(iface, index, value, value_len);
3195
3196 return hr;
3197}
3198
3199static const ISAXAttributesVtbl SAXAttributesVtbl = {
3216};
3217
3219 IVBSAXAttributes* iface,
3220 REFIID riid,
3221 void **ppvObject)
3222{
3224 TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
3225 return ISAXAttributes_QueryInterface(&This->ISAXAttributes_iface, riid, ppvObject);
3226}
3227
3228static ULONG WINAPI VBSAXAttributes_AddRef(IVBSAXAttributes* iface)
3229{
3231 return ISAXAttributes_AddRef(&This->ISAXAttributes_iface);
3232}
3233
3234static ULONG WINAPI VBSAXAttributes_Release(IVBSAXAttributes* iface)
3235{
3237 return ISAXAttributes_Release(&This->ISAXAttributes_iface);
3238}
3239
3240static HRESULT WINAPI VBSAXAttributes_GetTypeInfoCount( IVBSAXAttributes *iface, UINT* pctinfo )
3241{
3243
3244 TRACE("(%p)->(%p)\n", This, pctinfo);
3245
3246 *pctinfo = 1;
3247
3248 return S_OK;
3249}
3250
3252 IVBSAXAttributes *iface,
3253 UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo )
3254{
3255 TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo);
3256
3257 return get_typeinfo(IVBSAXAttributes_tid, ppTInfo);
3258}
3259
3261 IVBSAXAttributes *iface,
3262 REFIID riid,
3263 LPOLESTR* rgszNames,
3264 UINT cNames,
3265 LCID lcid,
3266 DISPID* rgDispId)
3267{
3269 HRESULT hr;
3270
3271 TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames,
3272 lcid, rgDispId);
3273
3274 if(!rgszNames || cNames == 0 || !rgDispId)
3275 return E_INVALIDARG;
3276
3278 if(SUCCEEDED(hr))
3279 {
3280 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
3281 ITypeInfo_Release(typeinfo);
3282 }
3283
3284 return hr;
3285}
3286
3288 IVBSAXAttributes *iface,
3289 DISPID dispIdMember,
3290 REFIID riid,
3291 LCID lcid,
3292 WORD wFlags,
3293 DISPPARAMS* pDispParams,
3294 VARIANT* pVarResult,
3295 EXCEPINFO* pExcepInfo,
3296 UINT* puArgErr)
3297{
3299 HRESULT hr;
3300
3301 TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid),
3302 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
3303
3305 if(SUCCEEDED(hr))
3306 {
3307 hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
3308 ITypeInfo_Release(typeinfo);
3309 }
3310
3311 return hr;
3312}
3313
3314static HRESULT WINAPI VBSAXAttributes_get_length(IVBSAXAttributes* iface, int *len)
3315{
3317 return ISAXAttributes_getLength(&This->ISAXAttributes_iface, len);
3318}
3319
3320static HRESULT WINAPI VBSAXAttributes_getURI(IVBSAXAttributes* iface, int index, BSTR *uri)
3321{
3323 const WCHAR *uriW;
3324 HRESULT hr;
3325 int len;
3326
3327 TRACE("(%p)->(%d %p)\n", This, index, uri);
3328
3329 if (!uri)
3330 return E_POINTER;
3331
3332 *uri = NULL;
3333 hr = ISAXAttributes_getURI(&This->ISAXAttributes_iface, index, &uriW, &len);
3334 if (FAILED(hr))
3335 return hr;
3336
3337 return return_bstrn(uriW, len, uri);
3338}
3339
3340static HRESULT WINAPI VBSAXAttributes_getLocalName(IVBSAXAttributes* iface, int index, BSTR *name)
3341{
3343 const WCHAR *nameW;
3344 HRESULT hr;
3345 int len;
3346
3347 TRACE("(%p)->(%d %p)\n", This, index, name);
3348
3349 if (!name)
3350 return E_POINTER;
3351
3352 *name = NULL;
3353 hr = ISAXAttributes_getLocalName(&This->ISAXAttributes_iface, index, &nameW, &len);
3354 if (FAILED(hr))
3355 return hr;
3356
3357 return return_bstrn(nameW, len, name);
3358}
3359
3360static HRESULT WINAPI VBSAXAttributes_getQName(IVBSAXAttributes* iface, int index, BSTR *qname)
3361{
3363 const WCHAR *qnameW;
3364 HRESULT hr;
3365 int len;
3366
3367 TRACE("(%p)->(%d %p)\n", This, index, qname);
3368
3369 if (!qname)
3370 return E_POINTER;
3371
3372 *qname = NULL;
3373 hr = ISAXAttributes_getQName(&This->ISAXAttributes_iface, index, &qnameW, &len);
3374 if (FAILED(hr))
3375 return hr;
3376
3377 return return_bstrn(qnameW, len, qname);
3378}
3379
3380static HRESULT WINAPI VBSAXAttributes_getIndexFromName(IVBSAXAttributes* iface, BSTR uri, BSTR name, int *index)
3381{
3383 return ISAXAttributes_getIndexFromName(&This->ISAXAttributes_iface, uri, SysStringLen(uri),
3385}
3386
3387static HRESULT WINAPI VBSAXAttributes_getIndexFromQName(IVBSAXAttributes* iface, BSTR qname, int *index)
3388{
3390 return ISAXAttributes_getIndexFromQName(&This->ISAXAttributes_iface, qname,
3391 SysStringLen(qname), index);
3392}
3393
3394static HRESULT WINAPI VBSAXAttributes_getType(IVBSAXAttributes* iface, int index, BSTR *type)
3395{
3397 const WCHAR *typeW;
3398 HRESULT hr;
3399 int len;
3400
3401 TRACE("(%p)->(%d %p)\n", This, index, type);
3402
3403 if (!type)
3404 return E_POINTER;
3405
3406 *type = NULL;
3407 hr = ISAXAttributes_getType(&This->ISAXAttributes_iface, index, &typeW, &len);
3408 if (FAILED(hr))
3409 return hr;
3410
3411 return return_bstrn(typeW, len, type);
3412}
3413
3415 BSTR name, BSTR *type)
3416{
3418 const WCHAR *typeW;
3419 HRESULT hr;
3420 int len;
3421
3422 TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(uri), debugstr_w(name), type);
3423
3424 if (!type)
3425 return E_POINTER;
3426
3427 *type = NULL;
3428 hr = ISAXAttributes_getTypeFromName(&This->ISAXAttributes_iface, uri, SysStringLen(uri),
3430 if (FAILED(hr))
3431 return hr;
3432
3433 return return_bstrn(typeW, len, type);
3434}
3435
3436static HRESULT WINAPI VBSAXAttributes_getTypeFromQName(IVBSAXAttributes* iface, BSTR qname, BSTR *type)
3437{
3439 const WCHAR *typeW;
3440 HRESULT hr;
3441 int len;
3442
3443 TRACE("(%p)->(%s %p)\n", This, debugstr_w(qname), type);
3444
3445 if (!type)
3446 return E_POINTER;
3447
3448 *type = NULL;
3449 hr = ISAXAttributes_getTypeFromQName(&This->ISAXAttributes_iface, qname, SysStringLen(qname),
3450 &typeW, &len);
3451 if (FAILED(hr))
3452 return hr;
3453
3454 return return_bstrn(typeW, len, type);
3455}
3456
3457static HRESULT WINAPI VBSAXAttributes_getValue(IVBSAXAttributes* iface, int index, BSTR *value)
3458{
3460 const WCHAR *valueW;
3461 HRESULT hr;
3462 int len;
3463
3464 TRACE("(%p)->(%d %p)\n", This, index, value);
3465
3466 if (!value)
3467 return E_POINTER;
3468
3469 *value = NULL;
3470 hr = ISAXAttributes_getValue(&This->ISAXAttributes_iface, index, &valueW, &len);
3471 if (FAILED(hr))
3472 return hr;
3473
3474 return return_bstrn(valueW, len, value);
3475}
3476
3478 BSTR *value)
3479{
3481 const WCHAR *valueW;
3482 HRESULT hr;
3483 int len;
3484
3485 TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(uri), debugstr_w(name), value);
3486
3487 if (!value)
3488 return E_POINTER;
3489
3490 *value = NULL;
3491 hr = ISAXAttributes_getValueFromName(&This->ISAXAttributes_iface, uri, SysStringLen(uri),
3493 if (FAILED(hr))
3494 return hr;
3495
3496 return return_bstrn(valueW, len, value);
3497}
3498
3499static HRESULT WINAPI VBSAXAttributes_getValueFromQName(IVBSAXAttributes* iface, BSTR qname, BSTR *value)
3500{
3502 const WCHAR *valueW;
3503 HRESULT hr;
3504 int len;
3505
3506 TRACE("(%p)->(%s %p)\n", This, debugstr_w(qname), value);
3507
3508 if (!value)
3509 return E_POINTER;
3510
3511 *value = NULL;
3512 hr = ISAXAttributes_getValueFromQName(&This->ISAXAttributes_iface, qname, SysStringLen(qname),
3513 &valueW, &len);
3514 if (FAILED(hr))
3515 return hr;
3516
3517 return return_bstrn(valueW, len, value);
3518}
3519
3520static const struct IVBSAXAttributesVtbl VBSAXAttributesVtbl =
3521{
3541};
3542
3543static const tid_t mxattrs_iface_tids[] = {
3545 0
3546};
3547
3549 NULL,
3551 NULL,
3553};
3554
3556{
3557 static const int default_count = 10;
3559
3560 TRACE("(%p)\n", ppObj);
3561
3562 This = malloc(sizeof(*This));
3563 if( !This )
3564 return E_OUTOFMEMORY;
3565
3566 This->IMXAttributes_iface.lpVtbl = &MXAttributesVtbl;
3567 This->ISAXAttributes_iface.lpVtbl = &SAXAttributesVtbl;
3568 This->IVBSAXAttributes_iface.lpVtbl = &VBSAXAttributesVtbl;
3569 This->ref = 1;
3570
3571 This->class_version = version;
3572
3573 This->attr = malloc(default_count * sizeof(mxattribute));
3574 This->length = 0;
3575 This->allocated = default_count;
3576
3577 *ppObj = &This->IMXAttributes_iface;
3578
3579 init_dispex(&This->dispex, (IUnknown*)&This->IMXAttributes_iface, &mxattrs_dispex);
3580
3581 TRACE("returning iface %p\n", *ppObj);
3582
3583 return S_OK;
3584}
static int avail
Definition: adh-main.c:39
HRESULT get_typeinfo(enum type_id tid, ITypeInfo **ret)
Definition: apps.c:124
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
static const WCHAR nameW[]
Definition: main.c:49
#define index(s, c)
Definition: various.h:29
#define ARRAY_SIZE(A)
Definition: main.h:20
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static int list_empty(struct list_entry *head)
Definition: list.h:58
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
_In_ uint16_t _Out_ ULONG * atts
Definition: btrfs_drv.h:1107
Definition: list.h:37
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define realloc
Definition: debug_ros.c:6
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static const WCHAR indent[]
Definition: object.c:1156
OLECHAR * BSTR
Definition: compat.h:2293
#define WideCharToMultiByte
Definition: compat.h:111
short VARIANT_BOOL
Definition: compat.h:2290
@ VT_BSTR
Definition: compat.h:2303
@ VT_UNKNOWN
Definition: compat.h:2308
@ VT_EMPTY
Definition: compat.h:2295
#define lstrlenW
Definition: compat.h:750
static const WCHAR version[]
Definition: asmname.c:66
static const WCHAR valueW[]
Definition: object.c:48
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4265
LCID lcid
Definition: locale.c:5656
_ACRTIMP int __cdecl wcsncmp(const wchar_t *, const wchar_t *, size_t)
Definition: wcs.c:518
static const WCHAR typeW[]
Definition: name.c:51
static const WCHAR versionW[]
Definition: name.c:52
static const WCHAR gtW[]
Definition: reader.c:96
static const WCHAR ltW[]
Definition: reader.c:95
static const WCHAR closepiW[]
Definition: writer.c:47
return ret
Definition: mutex.c:146
static BSTR local_name(call_frame_t *frame, int ref)
Definition: engine.c:187
static unsigned char buff[32768]
Definition: fatten.c:17
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
#define local
Definition: zutil.h:30
FxCollectionEntry * cur
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble n
Definition: glext.h:7729
GLuint buffer
Definition: glext.h:5915
const GLubyte * c
Definition: glext.h:8905
GLuint index
Definition: glext.h:6031
GLenum mode
Definition: glext.h:6217
GLenum GLenum dst
Definition: glext.h:6340
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
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 const WCHAR yesW[]
Definition: htmlbody.c:594
static const WCHAR noW[]
Definition: htmlbody.c:595
tid_t
Definition: ieframe.h:311
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
uint32_t entry
Definition: isohybrid.c:63
HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype)
Definition: dispex.c:919
#define c
Definition: ke_i.h:80
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_wn
Definition: kernel32.h:33
#define debugstr_w
Definition: kernel32.h:32
POINT cp
Definition: magnifier.c:59
static int blocks
Definition: mkdosfs.c:527
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static PVOID ptr
Definition: dispmode.c:27
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
static char * dest
Definition: rtl.c:135
static LPOLESTR
Definition: stg_prop.c:27
static VARIANTARG static DISPID
Definition: ordinal.c:49
const char * uri
Definition: sec_mgr.c:1588
static WCHAR escape[]
Definition: url.c:36
#define min(a, b)
Definition: monoChain.cc:55
BOOL dispex_query_interface(DispatchEx *This, REFIID riid, void **ppv)
Definition: dispex.c:1656
MSXML_VERSION
Definition: msxml_dispex.h:27
@ MSXML_DEFAULT
Definition: msxml_dispex.h:28
@ MSXML4
Definition: msxml_dispex.h:32
@ MSXML6
Definition: msxml_dispex.h:33
@ MSXML3
Definition: msxml_dispex.h:31
@ IMXWriter_tid
Definition: msxml_dispex.h:76
@ IMXAttributes_tid
Definition: msxml_dispex.h:74
@ IVBSAXAttributes_tid
Definition: msxml_dispex.h:64
static HRESULT return_bstrn(const WCHAR *value, int len, BSTR *p)
Definition: msxml_dispex.h:132
static HRESULT return_bstr(const WCHAR *value, BSTR *p)
Definition: msxml_dispex.h:115
static HRESULT WINAPI SAXErrorHandler_fatalError(ISAXErrorHandler *iface, ISAXLocator *locator, const WCHAR *message, HRESULT hr)
Definition: mxwriter.c:2476
static ULONG WINAPI SAXDeclHandler_Release(ISAXDeclHandler *iface)
Definition: mxwriter.c:1679
static HRESULT WINAPI SAXLexicalHandler_comment(ISAXLexicalHandler *iface, const WCHAR *chars, int nchars)
Definition: mxwriter.c:1630
static HRESULT WINAPI mxwriter_get_indent(IMXWriter *iface, VARIANT_BOOL *value)
Definition: mxwriter.c:1060
static HRESULT WINAPI SAXAttributes_getValue(ISAXAttributes *iface, int index, const WCHAR **value, int *len)
Definition: mxwriter.c:3142
static HRESULT WINAPI MXAttributes_GetTypeInfoCount(IMXAttributes *iface, UINT *pctinfo)
Definition: mxwriter.c:2723
static const IVBSAXErrorHandlerVtbl VBSAXErrorHandlerVtbl
Definition: mxwriter.c:2565
static HRESULT WINAPI SAXContentHandler_endElement(ISAXContentHandler *iface, const WCHAR *namespaceUri, int nnamespaceUri, const WCHAR *local_name, int nlocal_name, const WCHAR *QName, int nQName)
Definition: mxwriter.c:1354
static const WCHAR iso_8859_9W[]
Definition: mxwriter.c:86
static ULONG WINAPI SAXAttributes_AddRef(ISAXAttributes *iface)
Definition: mxwriter.c:2954
static HRESULT WINAPI VBSAXErrorHandler_GetTypeInfo(IVBSAXErrorHandler *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: mxwriter.c:2526
static HRESULT WINAPI VBSAXAttributes_getIndexFromQName(IVBSAXAttributes *iface, BSTR qname, int *index)
Definition: mxwriter.c:3387
static const WCHAR windows_1258W[]
Definition: mxwriter.c:99
static HRESULT WINAPI VBSAXLexicalHandler_GetTypeInfoCount(IVBSAXLexicalHandler *iface, UINT *pctinfo)
Definition: mxwriter.c:1951
static HRESULT WINAPI VBSAXAttributes_QueryInterface(IVBSAXAttributes *iface, REFIID riid, void **ppvObject)
Definition: mxwriter.c:3218
static HRESULT WINAPI mxwriter_GetIDsOfNames(IMXWriter *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: mxwriter.c:879
static ULONG WINAPI VBSAXLexicalHandler_AddRef(IVBSAXLexicalHandler *iface)
Definition: mxwriter.c:1939
static HRESULT WINAPI VBSAXContentHandler_ignorableWhitespace(IVBSAXContentHandler *iface, BSTR *chars)
Definition: mxwriter.c:2226
static const IVBSAXDeclHandlerVtbl VBSAXDeclHandlerVtbl
Definition: mxwriter.c:1917
static HRESULT WINAPI VBSAXLexicalHandler_endDTD(IVBSAXLexicalHandler *iface)
Definition: mxwriter.c:1990
static HRESULT WINAPI VBSAXContentHandler_GetTypeInfoCount(IVBSAXContentHandler *iface, UINT *pctinfo)
Definition: mxwriter.c:2080
static HRESULT WINAPI VBSAXAttributes_getQName(IVBSAXAttributes *iface, int index, BSTR *qname)
Definition: mxwriter.c:3360
static void write_node_indent(mxwriter *writer)
Definition: mxwriter.c:639
static HRESULT WINAPI VBSAXLexicalHandler_GetTypeInfo(IVBSAXLexicalHandler *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: mxwriter.c:1957
static HRESULT WINAPI VBSAXErrorHandler_GetTypeInfoCount(IVBSAXErrorHandler *iface, UINT *pctinfo)
Definition: mxwriter.c:2520
static HRESULT WINAPI VBSAXContentHandler_endPrefixMapping(IVBSAXContentHandler *iface, BSTR *prefix)
Definition: mxwriter.c:2138
static HRESULT WINAPI SAXDeclHandler_internalEntityDecl(ISAXDeclHandler *iface, const WCHAR *name, int n_name, const WCHAR *value, int n_value)
Definition: mxwriter.c:1750
static HRESULT WINAPI SAXAttributes_getName(ISAXAttributes *iface, int index, const WCHAR **uri, int *uri_len, const WCHAR **local, int *local_len, const WCHAR **qname, int *qname_len)
Definition: mxwriter.c:3026
static const IVBSAXDTDHandlerVtbl VBSAXDTDHandlerVtbl
Definition: mxwriter.c:2437
static HRESULT WINAPI mxwriter_get_standalone(IMXWriter *iface, VARIANT_BOOL *value)
Definition: mxwriter.c:1076
static ULONG WINAPI VBSAXErrorHandler_AddRef(IVBSAXErrorHandler *iface)
Definition: mxwriter.c:2508
static HRESULT WINAPI SAXAttributes_getIndexFromQName(ISAXAttributes *iface, const WCHAR *qname, int len, int *index)
Definition: mxwriter.c:3082
static const struct IVBSAXAttributesVtbl VBSAXAttributesVtbl
Definition: mxwriter.c:3520
static HRESULT WINAPI MXAttributes_QueryInterface(IMXAttributes *iface, REFIID riid, void **ppObj)
Definition: mxwriter.c:2651
static WCHAR * get_escaped_string(const WCHAR *str, escape_mode mode, int *len)
Definition: mxwriter.c:510
static mxwriter * impl_from_ISAXDeclHandler(ISAXDeclHandler *iface)
Definition: mxwriter.c:730
static HRESULT WINAPI mxwriter_get_output(IMXWriter *iface, VARIANT *dest)
Definition: mxwriter.c:946
static ULONG WINAPI VBSAXContentHandler_Release(IVBSAXContentHandler *iface)
Definition: mxwriter.c:2074
static const WCHAR windows_1256W[]
Definition: mxwriter.c:97
static HRESULT WINAPI SAXContentHandler_startPrefixMapping(ISAXContentHandler *iface, const WCHAR *prefix, int nprefix, const WCHAR *uri, int nuri)
Definition: mxwriter.c:1248
static HRESULT WINAPI mxwriter_QueryInterface(IMXWriter *iface, REFIID riid, void **obj)
Definition: mxwriter.c:760
static ULONG WINAPI VBSAXDeclHandler_AddRef(IVBSAXDeclHandler *iface)
Definition: mxwriter.c:1827
static HRESULT WINAPI MXAttributes_clear(IMXAttributes *iface)
Definition: mxwriter.c:2801
static dispex_static_data_t mxwriter_dispex
Definition: mxwriter.c:2583
static HRESULT WINAPI VBSAXDeclHandler_elementDecl(IVBSAXDeclHandler *iface, BSTR *name, BSTR *model)
Definition: mxwriter.c:1866
static HRESULT WINAPI VBSAXLexicalHandler_comment(IVBSAXLexicalHandler *iface, BSTR *chars)
Definition: mxwriter.c:2032
static mxwriter * impl_from_IVBSAXErrorHandler(IVBSAXErrorHandler *iface)
Definition: mxwriter.c:755
static const WCHAR iso_8859_3W[]
Definition: mxwriter.c:82
static const WCHAR windows_1255W[]
Definition: mxwriter.c:96
static HRESULT WINAPI SAXLexicalHandler_startDTD(ISAXLexicalHandler *iface, const WCHAR *name, int name_len, const WCHAR *publicId, int publicId_len, const WCHAR *systemId, int systemId_len)
Definition: mxwriter.c:1527
static mxattributes * impl_from_IVBSAXAttributes(IVBSAXAttributes *iface)
Definition: mxwriter.c:230
static HRESULT WINAPI VBSAXContentHandler_endDocument(IVBSAXContentHandler *iface)
Definition: mxwriter.c:2120
static HRESULT WINAPI SAXContentHandler_skippedEntity(ISAXContentHandler *iface, const WCHAR *name, int nname)
Definition: mxwriter.c:1479
static HRESULT write_data_to_stream(mxwriter *writer)
Definition: mxwriter.c:608
static HRESULT WINAPI MXAttributes_setQName(IMXAttributes *iface, int index, BSTR QName)
Definition: mxwriter.c:2883
static HRESULT WINAPI mxwriter_put_byteOrderMark(IMXWriter *iface, VARIANT_BOOL value)
Definition: mxwriter.c:1036
static HRESULT WINAPI VBSAXDeclHandler_GetTypeInfoCount(IVBSAXDeclHandler *iface, UINT *pctinfo)
Definition: mxwriter.c:1839
static void free_output_buffer(output_buffer *buffer)
Definition: mxwriter.c:321
static HRESULT WINAPI SAXErrorHandler_QueryInterface(ISAXErrorHandler *iface, REFIID riid, void **obj)
Definition: mxwriter.c:2450
static mxattributes * impl_from_ISAXAttributes(ISAXAttributes *iface)
Definition: mxwriter.c:225
static HRESULT WINAPI SAXLexicalHandler_endDTD(ISAXLexicalHandler *iface)
Definition: mxwriter.c:1577
static const struct ISAXContentHandlerVtbl SAXContentHandlerVtbl
Definition: mxwriter.c:1489
static HRESULT WINAPI VBSAXContentHandler_startElement(IVBSAXContentHandler *iface, BSTR *namespaceURI, BSTR *localName, BSTR *QName, IVBSAXAttributes *attrs)
Definition: mxwriter.c:2150
static ULONG WINAPI VBSAXDTDHandler_Release(IVBSAXDTDHandler *iface)
Definition: mxwriter.c:2378
static ULONG WINAPI SAXLexicalHandler_Release(ISAXLexicalHandler *iface)
Definition: mxwriter.c:1521
static HRESULT WINAPI VBSAXContentHandler_Invoke(IVBSAXContentHandler *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: mxwriter.c:2099
static HRESULT WINAPI VBSAXErrorHandler_GetIDsOfNames(IVBSAXErrorHandler *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: mxwriter.c:2532
mxwriter_prop
Definition: mxwriter.c:125
@ MXWriter_Standalone
Definition: mxwriter.c:130
@ MXWriter_DisableEscaping
Definition: mxwriter.c:127
@ MXWriter_LastProp
Definition: mxwriter.c:131
@ MXWriter_OmitXmlDecl
Definition: mxwriter.c:129
@ MXWriter_BOM
Definition: mxwriter.c:126
@ MXWriter_Indent
Definition: mxwriter.c:128
static ULONG WINAPI mxwriter_AddRef(IMXWriter *iface)
Definition: mxwriter.c:829
static const WCHAR iso_8859_15W[]
Definition: mxwriter.c:88
static HRESULT WINAPI VBSAXErrorHandler_error(IVBSAXErrorHandler *iface, IVBSAXLocator *locator, BSTR *message, LONG code)
Definition: mxwriter.c:2547
static HRESULT WINAPI VBSAXDeclHandler_QueryInterface(IVBSAXDeclHandler *iface, REFIID riid, void **obj)
Definition: mxwriter.c:1820
static HRESULT WINAPI mxwriter_GetTypeInfoCount(IMXWriter *iface, UINT *pctinfo)
Definition: mxwriter.c:863
static HRESULT WINAPI SAXContentHandler_ignorableWhitespace(ISAXContentHandler *iface, const WCHAR *chars, int nchars)
Definition: mxwriter.c:1430
static const WCHAR utf8W[]
Definition: mxwriter.c:90
static HRESULT WINAPI mxwriter_put_standalone(IMXWriter *iface, VARIANT_BOOL value)
Definition: mxwriter.c:1068
static HRESULT WINAPI MXAttributes_addAttributeFromIndex(IMXAttributes *iface, VARIANT atts, int index)
Definition: mxwriter.c:2793
static HRESULT WINAPI mxwriter_put_disableOutputEscaping(IMXWriter *iface, VARIANT_BOOL value)
Definition: mxwriter.c:1125
static HRESULT WINAPI VBSAXDeclHandler_internalEntityDecl(IVBSAXDeclHandler *iface, BSTR *name, BSTR *value)
Definition: mxwriter.c:1892
static const WCHAR iso_8859_13W[]
Definition: mxwriter.c:87
static mxwriter * impl_from_ISAXLexicalHandler(ISAXLexicalHandler *iface)
Definition: mxwriter.c:720
static void set_element_name(mxwriter *This, const WCHAR *name, int len)
Definition: mxwriter.c:674
static HRESULT WINAPI SAXDeclHandler_QueryInterface(ISAXDeclHandler *iface, REFIID riid, void **obj)
Definition: mxwriter.c:1666
static const WCHAR windows_1254W[]
Definition: mxwriter.c:95
static HRESULT WINAPI VBSAXDTDHandler_Invoke(IVBSAXDTDHandler *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: mxwriter.c:2403
static HRESULT WINAPI MXAttributes_setValue(IMXAttributes *iface, int index, BSTR value)
Definition: mxwriter.c:2913
static const WCHAR iso_8859_5W[]
Definition: mxwriter.c:84
static mxwriter * impl_from_ISAXContentHandler(ISAXContentHandler *iface)
Definition: mxwriter.c:710
static HRESULT WINAPI mxwriter_put_omitXMLDeclaration(IMXWriter *iface, VARIANT_BOOL value)
Definition: mxwriter.c:1084
static const WCHAR iso_8859_7W[]
Definition: mxwriter.c:85
static HRESULT WINAPI MXAttributes_GetTypeInfo(IMXAttributes *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: mxwriter.c:2729
static ULONG WINAPI SAXContentHandler_AddRef(ISAXContentHandler *iface)
Definition: mxwriter.c:1186
static const WCHAR windows_1250W[]
Definition: mxwriter.c:91
static HRESULT WINAPI VBSAXContentHandler_startDocument(IVBSAXContentHandler *iface)
Definition: mxwriter.c:2114
static HRESULT WINAPI SAXContentHandler_processingInstruction(ISAXContentHandler *iface, const WCHAR *target, int ntarget, const WCHAR *data, int ndata)
Definition: mxwriter.c:1446
static const WCHAR crlfW[]
Definition: mxwriter.c:42
static const IVBSAXLexicalHandlerVtbl VBSAXLexicalHandlerVtbl
Definition: mxwriter.c:2044
static const WCHAR entityW[]
Definition: mxwriter.c:43
static HRESULT WINAPI VBSAXDTDHandler_GetTypeInfo(IVBSAXDTDHandler *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: mxwriter.c:2390
static HRESULT WINAPI SAXAttributes_getURI(ISAXAttributes *iface, int index, const WCHAR **uri, int *len)
Definition: mxwriter.c:2979
static ULONG WINAPI SAXDTDHandler_Release(ISAXDTDHandler *iface)
Definition: mxwriter.c:2296
static HRESULT WINAPI mxwriter_put_version(IMXWriter *iface, BSTR version)
Definition: mxwriter.c:1100
static HRESULT WINAPI VBSAXContentHandler_endElement(IVBSAXContentHandler *iface, BSTR *namespaceURI, BSTR *localName, BSTR *QName)
Definition: mxwriter.c:2198
static mxwriter * impl_from_ISAXDTDHandler(ISAXDTDHandler *iface)
Definition: mxwriter.c:740
static HRESULT WINAPI mxwriter_get_version(IMXWriter *iface, BSTR *version)
Definition: mxwriter.c:1114
static HRESULT WINAPI VBSAXAttributes_getTypeFromQName(IVBSAXAttributes *iface, BSTR qname, BSTR *type)
Definition: mxwriter.c:3436
static HRESULT WINAPI SAXAttributes_getIndexFromName(ISAXAttributes *iface, const WCHAR *uri, int uri_len, const WCHAR *name, int len, int *index)
Definition: mxwriter.c:3053
static HRESULT WINAPI SAXLexicalHandler_endCDATA(ISAXLexicalHandler *iface)
Definition: mxwriter.c:1617
static ULONG WINAPI SAXContentHandler_Release(ISAXContentHandler *iface)
Definition: mxwriter.c:1192
static HRESULT WINAPI mxwriter_get_disableOutputEscaping(IMXWriter *iface, VARIANT_BOOL *value)
Definition: mxwriter.c:1133
static HRESULT WINAPI VBSAXErrorHandler_ignorableWarning(IVBSAXErrorHandler *iface, IVBSAXLocator *locator, BSTR *message, LONG code)
Definition: mxwriter.c:2559
static const ISAXDTDHandlerVtbl SAXDTDHandlerVtbl
Definition: mxwriter.c:2357
static ULONG WINAPI SAXLexicalHandler_AddRef(ISAXLexicalHandler *iface)
Definition: mxwriter.c:1515
static const WCHAR windows_1252W[]
Definition: mxwriter.c:93
static HRESULT WINAPI VBSAXContentHandler_GetTypeInfo(IVBSAXContentHandler *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: mxwriter.c:2086
static HRESULT WINAPI SAXLexicalHandler_startEntity(ISAXLexicalHandler *iface, const WCHAR *name, int len)
Definition: mxwriter.c:1589
static HRESULT WINAPI VBSAXContentHandler_processingInstruction(IVBSAXContentHandler *iface, BSTR *target, BSTR *data)
Definition: mxwriter.c:2238
static HRESULT WINAPI VBSAXLexicalHandler_endCDATA(IVBSAXLexicalHandler *iface)
Definition: mxwriter.c:2026
static HRESULT WINAPI VBSAXLexicalHandler_QueryInterface(IVBSAXLexicalHandler *iface, REFIID riid, void **obj)
Definition: mxwriter.c:1932
static HRESULT WINAPI SAXAttributes_getLocalName(ISAXAttributes *iface, int index, const WCHAR **name, int *len)
Definition: mxwriter.c:2995
static HRESULT WINAPI VBSAXDTDHandler_notationDecl(IVBSAXDTDHandler *iface, BSTR *name, BSTR *publicId, BSTR *systemId)
Definition: mxwriter.c:2411
static HRESULT WINAPI mxwriter_flush(IMXWriter *iface)
Definition: mxwriter.c:1141
static HRESULT WINAPI SAXAttributes_QueryInterface(ISAXAttributes *iface, REFIID riid, void **ppObj)
Definition: mxwriter.c:2948
static HRESULT WINAPI VBSAXAttributes_GetIDsOfNames(IVBSAXAttributes *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: mxwriter.c:3260
static HRESULT WINAPI VBSAXAttributes_getValue(IVBSAXAttributes *iface, int index, BSTR *value)
Definition: mxwriter.c:3457
static HRESULT WINAPI VBSAXDTDHandler_QueryInterface(IVBSAXDTDHandler *iface, REFIID riid, void **obj)
Definition: mxwriter.c:2366
static HRESULT WINAPI VBSAXDeclHandler_attributeDecl(IVBSAXDeclHandler *iface, BSTR *element, BSTR *attr, BSTR *type, BSTR *default_value, BSTR *value)
Definition: mxwriter.c:1878
static HRESULT WINAPI SAXContentHandler_endDocument(ISAXContentHandler *iface)
Definition: mxwriter.c:1240
static HRESULT WINAPI SAXAttributes_getTypeFromName(ISAXAttributes *iface, const WCHAR *pUri, int nUri, const WCHAR *pLocalName, int nLocalName, const WCHAR **pType, int *nType)
Definition: mxwriter.c:3125
static void writer_dec_indent(mxwriter *This)
Definition: mxwriter.c:666
static HRESULT WINAPI MXAttributes_Invoke(IMXAttributes *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: mxwriter.c:2748
static const WCHAR spaceW[]
Definition: mxwriter.c:39
static void writer_inc_indent(mxwriter *This)
Definition: mxwriter.c:661
static const struct xml_encoding_data xml_encoding_map[]
Definition: mxwriter.c:101
static HRESULT WINAPI mxwriter_GetTypeInfo(IMXWriter *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: mxwriter.c:869
static dispex_static_data_t mxattrs_dispex
Definition: mxwriter.c:3548
static HRESULT WINAPI VBSAXAttributes_getTypeFromName(IVBSAXAttributes *iface, BSTR uri, BSTR name, BSTR *type)
Definition: mxwriter.c:3414
static HRESULT WINAPI MXAttributes_GetIDsOfNames(IMXAttributes *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: mxwriter.c:2735
static HRESULT WINAPI SAXDeclHandler_externalEntityDecl(ISAXDeclHandler *iface, const WCHAR *name, int n_name, const WCHAR *publicId, int n_publicId, const WCHAR *systemId, int n_systemId)
Definition: mxwriter.c:1774
static HRESULT WINAPI VBSAXAttributes_GetTypeInfoCount(IVBSAXAttributes *iface, UINT *pctinfo)
Definition: mxwriter.c:3240
static HRESULT WINAPI VBSAXContentHandler_characters(IVBSAXContentHandler *iface, BSTR *chars)
Definition: mxwriter.c:2214
static HRESULT WINAPI VBSAXErrorHandler_Invoke(IVBSAXErrorHandler *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: mxwriter.c:2539
static void mxwriter_write_attribute(mxwriter *writer, const WCHAR *qname, int qname_len, const WCHAR *value, int value_len, BOOL escape)
Definition: mxwriter.c:1270
escape_mode
Definition: mxwriter.c:135
@ EscapeText
Definition: mxwriter.c:137
@ EscapeValue
Definition: mxwriter.c:136
static const struct ISAXLexicalHandlerVtbl SAXLexicalHandlerVtbl
Definition: mxwriter.c:1651
static ULONG WINAPI VBSAXContentHandler_AddRef(IVBSAXContentHandler *iface)
Definition: mxwriter.c:2068
static const WCHAR iso_8859_2W[]
Definition: mxwriter.c:81
static const WCHAR windows_1257W[]
Definition: mxwriter.c:98
static const ISAXErrorHandlerVtbl SAXErrorHandlerVtbl
Definition: mxwriter.c:2492
static const WCHAR quotW[]
Definition: mxwriter.c:40
static HRESULT WINAPI VBSAXDTDHandler_unparsedEntityDecl(IVBSAXDTDHandler *iface, BSTR *name, BSTR *publicId, BSTR *systemId, BSTR *notation)
Definition: mxwriter.c:2423
static ULONG WINAPI VBSAXAttributes_AddRef(IVBSAXAttributes *iface)
Definition: mxwriter.c:3228
static HRESULT WINAPI SAXDeclHandler_attributeDecl(ISAXDeclHandler *iface, const WCHAR *element, int n_element, const WCHAR *attr, int n_attr, const WCHAR *type, int n_type, const WCHAR *Default, int n_default, const WCHAR *value, int n_value)
Definition: mxwriter.c:1708
static HRESULT WINAPI SAXDTDHandler_unparsedEntityDecl(ISAXDTDHandler *iface, const WCHAR *name, INT nname, const WCHAR *publicid, INT npublicid, const WCHAR *systemid, INT nsystemid, const WCHAR *notation, INT nnotation)
Definition: mxwriter.c:2344
static HRESULT writer_get_property(const mxwriter *writer, mxwriter_prop property, VARIANT_BOOL *value)
Definition: mxwriter.c:698
static HRESULT WINAPI VBSAXContentHandler_startPrefixMapping(IVBSAXContentHandler *iface, BSTR *prefix, BSTR *uri)
Definition: mxwriter.c:2126
static void free_encoded_buffer(encoded_buffer *buffer)
Definition: mxwriter.c:282
static HRESULT write_output_buffer_quoted(mxwriter *writer, const WCHAR *data, int len)
Definition: mxwriter.c:472
static mxwriter * impl_from_IVBSAXContentHandler(IVBSAXContentHandler *iface)
Definition: mxwriter.c:715
static HRESULT WINAPI VBSAXLexicalHandler_GetIDsOfNames(IVBSAXLexicalHandler *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: mxwriter.c:1963
static HRESULT WINAPI VBSAXAttributes_get_length(IVBSAXAttributes *iface, int *len)
Definition: mxwriter.c:3314
static HRESULT WINAPI SAXAttributes_getType(ISAXAttributes *iface, int index, const WCHAR **type, int *len)
Definition: mxwriter.c:3107
static HRESULT WINAPI mxwriter_get_encoding(IMXWriter *iface, BSTR *encoding)
Definition: mxwriter.c:1022
static HRESULT WINAPI mxwriter_put_encoding(IMXWriter *iface, BSTR encoding)
Definition: mxwriter.c:995
static HRESULT WINAPI VBSAXLexicalHandler_endEntity(IVBSAXLexicalHandler *iface, BSTR *name)
Definition: mxwriter.c:2008
static void write_prolog_buffer(mxwriter *writer)
Definition: mxwriter.c:573
static const WCHAR emptyW[]
Definition: mxwriter.c:38
static ULONG WINAPI SAXDeclHandler_AddRef(ISAXDeclHandler *iface)
Definition: mxwriter.c:1673
static ULONG WINAPI VBSAXErrorHandler_Release(IVBSAXErrorHandler *iface)
Definition: mxwriter.c:2514
static void close_element_starttag(mxwriter *writer)
Definition: mxwriter.c:632
HRESULT SAXAttributes_create(MSXML_VERSION version, void **ppObj)
Definition: mxwriter.c:3555
static HRESULT WINAPI VBSAXAttributes_getURI(IVBSAXAttributes *iface, int index, BSTR *uri)
Definition: mxwriter.c:3320
static HRESULT get_code_page(xml_encoding encoding, UINT *cp)
Definition: mxwriter.c:287
static HRESULT flush_output_buffer(mxwriter *This)
Definition: mxwriter.c:683
static HRESULT WINAPI VBSAXAttributes_getValueFromQName(IVBSAXAttributes *iface, BSTR qname, BSTR *value)
Definition: mxwriter.c:3499
static const WCHAR iso_8859_4W[]
Definition: mxwriter.c:83
static HRESULT WINAPI SAXErrorHandler_error(ISAXErrorHandler *iface, ISAXLocator *locator, const WCHAR *message, HRESULT hr)
Definition: mxwriter.c:2468
static HRESULT WINAPI SAXAttributes_getValueFromName(ISAXAttributes *iface, const WCHAR *uri, int uri_len, const WCHAR *name, int name_len, const WCHAR **value, int *value_len)
Definition: mxwriter.c:3160
static HRESULT WINAPI SAXContentHandler_startElement(ISAXContentHandler *iface, const WCHAR *namespaceUri, int nnamespaceUri, const WCHAR *local_name, int nlocal_name, const WCHAR *QName, int nQName, ISAXAttributes *attr)
Definition: mxwriter.c:1304
static HRESULT WINAPI mxwriter_get_omitXMLDeclaration(IMXWriter *iface, VARIANT_BOOL *value)
Definition: mxwriter.c:1092
static HRESULT WINAPI VBSAXContentHandler_putref_documentLocator(IVBSAXContentHandler *iface, IVBSAXLocator *locator)
Definition: mxwriter.c:2107
static const WCHAR utf16W[]
Definition: mxwriter.c:89
static const tid_t mxwriter_iface_tids[]
Definition: mxwriter.c:2578
static mxattribute * get_attribute_byindex(mxattributes *attrs, int index)
Definition: mxwriter.c:2823
static HRESULT WINAPI SAXAttributes_getTypeFromQName(ISAXAttributes *iface, const WCHAR *pQName, int nQName, const WCHAR **pType, int *nType)
Definition: mxwriter.c:3134
static ULONG WINAPI VBSAXLexicalHandler_Release(IVBSAXLexicalHandler *iface)
Definition: mxwriter.c:1945
static HRESULT WINAPI mxwriter_put_output(IMXWriter *iface, VARIANT dest)
Definition: mxwriter.c:900
static HRESULT WINAPI VBSAXDeclHandler_externalEntityDecl(IVBSAXDeclHandler *iface, BSTR *name, BSTR *publicid, BSTR *systemid)
Definition: mxwriter.c:1904
static mxwriter * impl_from_ISAXErrorHandler(ISAXErrorHandler *iface)
Definition: mxwriter.c:750
static HRESULT WINAPI VBSAXAttributes_Invoke(IVBSAXAttributes *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: mxwriter.c:3287
static HRESULT WINAPI VBSAXErrorHandler_fatalError(IVBSAXErrorHandler *iface, IVBSAXLocator *locator, BSTR *message, LONG code)
Definition: mxwriter.c:2553
static HRESULT WINAPI VBSAXErrorHandler_QueryInterface(IVBSAXErrorHandler *iface, REFIID riid, void **obj)
Definition: mxwriter.c:2502
static HRESULT WINAPI SAXDTDHandler_notationDecl(ISAXDTDHandler *iface, const WCHAR *name, INT n_name, const WCHAR *publicid, INT n_publicid, const WCHAR *systemid, INT n_systemid)
Definition: mxwriter.c:2302
static HRESULT WINAPI SAXAttributes_getValueFromQName(ISAXAttributes *iface, const WCHAR *qname, int qname_len, const WCHAR **value, int *value_len)
Definition: mxwriter.c:3180
static HRESULT WINAPI VBSAXLexicalHandler_startDTD(IVBSAXLexicalHandler *iface, BSTR *name, BSTR *publicId, BSTR *systemId)
Definition: mxwriter.c:1978
static void mxwriter_write_starttag(mxwriter *writer, const WCHAR *qname, int len)
Definition: mxwriter.c:1290
static mxattributes * impl_from_IMXAttributes(IMXAttributes *iface)
Definition: mxwriter.c:220
static ULONG WINAPI VBSAXAttributes_Release(IVBSAXAttributes *iface)
Definition: mxwriter.c:3234
static HRESULT WINAPI SAXContentHandler_QueryInterface(ISAXContentHandler *iface, REFIID riid, void **obj)
Definition: mxwriter.c:1177
static ULONG WINAPI SAXDTDHandler_AddRef(ISAXDTDHandler *iface)
Definition: mxwriter.c:2290
static HRESULT WINAPI mxwriter_Invoke(IMXWriter *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: mxwriter.c:889
static const WCHAR windows_1253W[]
Definition: mxwriter.c:94
static HRESULT WINAPI MXAttributes_setAttribute(IMXAttributes *iface, int index, BSTR uri, BSTR localName, BSTR QName, BSTR type, BSTR value)
Definition: mxwriter.c:2851
static HRESULT WINAPI VBSAXDeclHandler_Invoke(IVBSAXDeclHandler *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: mxwriter.c:1858
static HRESULT WINAPI VBSAXDeclHandler_GetTypeInfo(IVBSAXDeclHandler *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: mxwriter.c:1845
static HRESULT WINAPI VBSAXAttributes_getType(IVBSAXAttributes *iface, int index, BSTR *type)
Definition: mxwriter.c:3394
static ULONG WINAPI VBSAXDTDHandler_AddRef(IVBSAXDTDHandler *iface)
Definition: mxwriter.c:2372
static HRESULT writer_set_property(mxwriter *writer, mxwriter_prop property, VARIANT_BOOL value)
Definition: mxwriter.c:691
static HRESULT WINAPI SAXContentHandler_characters(ISAXContentHandler *iface, const WCHAR *chars, int nchars)
Definition: mxwriter.c:1395
static HRESULT WINAPI mxwriter_put_indent(IMXWriter *iface, VARIANT_BOOL value)
Definition: mxwriter.c:1052
static HRESULT WINAPI MXAttributes_setAttributes(IMXAttributes *iface, VARIANT atts)
Definition: mxwriter.c:2860
static HRESULT mxattributes_grow(mxattributes *This)
Definition: mxwriter.c:235
static mxwriter * impl_from_IMXWriter(IMXWriter *iface)
Definition: mxwriter.c:705
static HRESULT WINAPI MXAttributes_setURI(IMXAttributes *iface, int index, BSTR uri)
Definition: mxwriter.c:2898
static HRESULT WINAPI VBSAXContentHandler_GetIDsOfNames(IVBSAXContentHandler *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: mxwriter.c:2092
static HRESULT WINAPI VBSAXLexicalHandler_Invoke(IVBSAXLexicalHandler *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: mxwriter.c:1970
static ULONG WINAPI VBSAXDeclHandler_Release(IVBSAXDeclHandler *iface)
Definition: mxwriter.c:1833
static HRESULT write_output_buffer(mxwriter *writer, const WCHAR *data, int len)
Definition: mxwriter.c:335
static mxwriter * impl_from_IVBSAXLexicalHandler(IVBSAXLexicalHandler *iface)
Definition: mxwriter.c:725
static HRESULT WINAPI mxwriter_get_byteOrderMark(IMXWriter *iface, VARIANT_BOOL *value)
Definition: mxwriter.c:1044
static const struct IMXWriterVtbl MXWriterVtbl
Definition: mxwriter.c:1148
static xml_encoding parse_encoding_name(const WCHAR *encoding)
Definition: mxwriter.c:245
static HRESULT WINAPI VBSAXDTDHandler_GetTypeInfoCount(IVBSAXDTDHandler *iface, UINT *pctinfo)
Definition: mxwriter.c:2384
static HRESULT WINAPI SAXContentHandler_startDocument(ISAXContentHandler *iface)
Definition: mxwriter.c:1207
static HRESULT WINAPI VBSAXLexicalHandler_startEntity(IVBSAXLexicalHandler *iface, BSTR *name)
Definition: mxwriter.c:1996
static const WCHAR closetagW[]
Definition: mxwriter.c:41
static HRESULT WINAPI SAXDeclHandler_elementDecl(ISAXDeclHandler *iface, const WCHAR *name, int n_name, const WCHAR *model, int n_model)
Definition: mxwriter.c:1685
static ULONG WINAPI MXAttributes_AddRef(IMXAttributes *iface)
Definition: mxwriter.c:2688
static const WCHAR iso_8859_1W[]
Definition: mxwriter.c:80
static HRESULT WINAPI SAXDTDHandler_QueryInterface(ISAXDTDHandler *iface, REFIID riid, void **obj)
Definition: mxwriter.c:2284
static HRESULT WINAPI MXAttributes_removeAttribute(IMXAttributes *iface, int index)
Definition: mxwriter.c:2829
static const tid_t mxattrs_iface_tids[]
Definition: mxwriter.c:3543
static ULONG WINAPI SAXErrorHandler_AddRef(ISAXErrorHandler *iface)
Definition: mxwriter.c:2456
static HRESULT WINAPI VBSAXContentHandler_QueryInterface(IVBSAXContentHandler *iface, REFIID riid, void **obj)
Definition: mxwriter.c:2062
static const WCHAR publicW[]
Definition: mxwriter.c:44
static const WCHAR systemW[]
Definition: mxwriter.c:45
static HRESULT WINAPI SAXAttributes_getQName(ISAXAttributes *iface, int index, const WCHAR **qname, int *length)
Definition: mxwriter.c:3011
static mxwriter * impl_from_IVBSAXDeclHandler(IVBSAXDeclHandler *iface)
Definition: mxwriter.c:735
static HRESULT WINAPI SAXLexicalHandler_QueryInterface(ISAXLexicalHandler *iface, REFIID riid, void **obj)
Definition: mxwriter.c:1508
static void close_output_buffer(mxwriter *writer)
Definition: mxwriter.c:482
static mxwriter * impl_from_IVBSAXDTDHandler(IVBSAXDTDHandler *iface)
Definition: mxwriter.c:745
static HRESULT WINAPI VBSAXLexicalHandler_startCDATA(IVBSAXLexicalHandler *iface)
Definition: mxwriter.c:2020
static HRESULT WINAPI VBSAXContentHandler_skippedEntity(IVBSAXContentHandler *iface, BSTR *name)
Definition: mxwriter.c:2251
static HRESULT WINAPI VBSAXAttributes_getValueFromName(IVBSAXAttributes *iface, BSTR uri, BSTR name, BSTR *value)
Definition: mxwriter.c:3477
static ULONG WINAPI SAXErrorHandler_Release(ISAXErrorHandler *iface)
Definition: mxwriter.c:2462
static HRESULT WINAPI SAXAttributes_getLength(ISAXAttributes *iface, int *length)
Definition: mxwriter.c:2966
static HRESULT WINAPI SAXLexicalHandler_endEntity(ISAXLexicalHandler *iface, const WCHAR *name, int len)
Definition: mxwriter.c:1596
xml_encoding
Definition: mxwriter.c:49
@ XmlEncoding_windows_1252
Definition: mxwriter.c:63
@ XmlEncoding_UTF8
Definition: mxwriter.c:60
@ XmlEncoding_ISO_8859_5
Definition: mxwriter.c:56
@ XmlEncoding_ISO_8859_7
Definition: mxwriter.c:57
@ XmlEncoding_windows_1251
Definition: mxwriter.c:62
@ XmlEncoding_windows_1250
Definition: mxwriter.c:61
@ XmlEncoding_ISO_8859_9
Definition: mxwriter.c:58
@ XmlEncoding_windows_1256
Definition: mxwriter.c:67
@ XmlEncoding_windows_1258
Definition: mxwriter.c:69
@ XmlEncoding_windows_1257
Definition: mxwriter.c:68
@ XmlEncoding_ISO_8859_1
Definition: mxwriter.c:50
@ XmlEncoding_Unknown
Definition: mxwriter.c:70
@ XmlEncoding_windows_1255
Definition: mxwriter.c:66
@ XmlEncoding_ISO_8859_13
Definition: mxwriter.c:51
@ XmlEncoding_windows_1254
Definition: mxwriter.c:65
@ XmlEncoding_ISO_8859_3
Definition: mxwriter.c:54
@ XmlEncoding_UTF16
Definition: mxwriter.c:59
@ XmlEncoding_ISO_8859_2
Definition: mxwriter.c:53
@ XmlEncoding_ISO_8859_15
Definition: mxwriter.c:52
@ XmlEncoding_ISO_8859_4
Definition: mxwriter.c:55
@ XmlEncoding_windows_1253
Definition: mxwriter.c:64
static HRESULT init_encoded_buffer(encoded_buffer *buffer)
Definition: mxwriter.c:269
static const ISAXAttributesVtbl SAXAttributesVtbl
Definition: mxwriter.c:3199
HRESULT MXWriter_create(MSXML_VERSION version, void **ppObj)
Definition: mxwriter.c:2590
static HRESULT WINAPI VBSAXAttributes_getLocalName(IVBSAXAttributes *iface, int index, BSTR *name)
Definition: mxwriter.c:3340
static const IVBSAXContentHandlerVtbl VBSAXContentHandlerVtbl
Definition: mxwriter.c:2263
static ULONG WINAPI SAXAttributes_Release(ISAXAttributes *iface)
Definition: mxwriter.c:2960
static const WCHAR windows_1251W[]
Definition: mxwriter.c:92
static HRESULT WINAPI MXAttributes_setLocalName(IMXAttributes *iface, int index, BSTR localName)
Definition: mxwriter.c:2867
static HRESULT WINAPI VBSAXAttributes_GetTypeInfo(IVBSAXAttributes *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: mxwriter.c:3251
static ULONG WINAPI mxwriter_Release(IMXWriter *iface)
Definition: mxwriter.c:839
static const ISAXDeclHandlerVtbl SAXDeclHandlerVtbl
Definition: mxwriter.c:1809
static HRESULT WINAPI VBSAXAttributes_getIndexFromName(IVBSAXAttributes *iface, BSTR uri, BSTR name, int *index)
Definition: mxwriter.c:3380
static HRESULT WINAPI SAXErrorHandler_ignorableWarning(ISAXErrorHandler *iface, ISAXLocator *locator, const WCHAR *message, HRESULT hr)
Definition: mxwriter.c:2484
static HRESULT WINAPI SAXLexicalHandler_startCDATA(ISAXLexicalHandler *iface)
Definition: mxwriter.c:1603
static HRESULT WINAPI VBSAXDTDHandler_GetIDsOfNames(IVBSAXDTDHandler *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: mxwriter.c:2396
static HRESULT WINAPI SAXContentHandler_endPrefixMapping(ISAXContentHandler *iface, const WCHAR *prefix, int nprefix)
Definition: mxwriter.c:1260
static const IMXAttributesVtbl MXAttributesVtbl
Definition: mxwriter.c:2928
static HRESULT WINAPI MXAttributes_addAttribute(IMXAttributes *iface, BSTR uri, BSTR localName, BSTR QName, BSTR type, BSTR value)
Definition: mxwriter.c:2764
static HRESULT WINAPI SAXContentHandler_putDocumentLocator(ISAXContentHandler *iface, ISAXLocator *locator)
Definition: mxwriter.c:1198
static HRESULT WINAPI VBSAXDeclHandler_GetIDsOfNames(IVBSAXDeclHandler *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: mxwriter.c:1851
static ULONG WINAPI MXAttributes_Release(IMXAttributes *iface)
Definition: mxwriter.c:2696
unsigned int UINT
Definition: ndis.h:50
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
INT WINAPI SysReAllocString(LPBSTR old, LPCOLESTR str)
Definition: oleaut.c:467
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:196
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
#define V_UNKNOWN(A)
Definition: oleauto.h:281
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
const GUID IID_IDispatch
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
static unsigned __int64 next
Definition: rand_nt.c:6
const WCHAR * str
DWORD LCID
Definition: nls.h:13
#define CP_UTF8
Definition: nls.h:20
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
__WINE_SERVER_LIST_INLINE struct list * list_tail(const struct list *list)
Definition: list.h:137
#define memset(x, y, z)
Definition: compat.h:39
static void init_output_buffer(void)
Definition: tools.h:791
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
Definition: cookie.c:202
WCHAR * value
Definition: cookie.c:204
Definition: inflate.c:139
char * data
Definition: mxwriter.c:143
unsigned int written
Definition: mxwriter.c:145
unsigned int allocated
Definition: mxwriter.c:144
Definition: tftpd.h:60
BSTR value
Definition: mxwriter.c:202
BSTR qname
Definition: mxwriter.c:198
BSTR local
Definition: mxwriter.c:199
BSTR type
Definition: mxwriter.c:201
BSTR uri
Definition: mxwriter.c:200
ISAXAttributes ISAXAttributes_iface
Definition: mxwriter.c:209
IMXAttributes IMXAttributes_iface
Definition: mxwriter.c:208
IVBSAXAttributes IVBSAXAttributes_iface
Definition: mxwriter.c:210
DispatchEx dispex
Definition: mxwriter.c:207
mxattribute * attr
Definition: mxwriter.c:215
int allocated
Definition: mxwriter.c:217
MSXML_VERSION class_version
Definition: mxwriter.c:213
DispatchEx dispex
Definition: mxwriter.c:158
IMXWriter IMXWriter_iface
Definition: mxwriter.c:159
BOOL cdata
Definition: mxwriter.c:176
output_buffer buffer
Definition: mxwriter.c:193
MSXML_VERSION class_version
Definition: mxwriter.c:172
BOOL text
Definition: mxwriter.c:178
BOOL newline
Definition: mxwriter.c:179
UINT indent
Definition: mxwriter.c:180
ISAXDTDHandler ISAXDTDHandler_iface
Definition: mxwriter.c:163
IVBSAXContentHandler IVBSAXContentHandler_iface
Definition: mxwriter.c:167
BSTR version
Definition: mxwriter.c:182
xml_encoding xml_enc
Definition: mxwriter.c:185
ISAXContentHandler ISAXContentHandler_iface
Definition: mxwriter.c:160
VARIANT_BOOL props[MXWriter_LastProp]
Definition: mxwriter.c:174
ISAXErrorHandler ISAXErrorHandler_iface
Definition: mxwriter.c:164
IVBSAXDeclHandler IVBSAXDeclHandler_iface
Definition: mxwriter.c:165
ISAXLexicalHandler ISAXLexicalHandler_iface
Definition: mxwriter.c:161
IVBSAXErrorHandler IVBSAXErrorHandler_iface
Definition: mxwriter.c:169
IVBSAXLexicalHandler IVBSAXLexicalHandler_iface
Definition: mxwriter.c:166
LONG ref
Definition: mxwriter.c:171
IVBSAXDTDHandler IVBSAXDTDHandler_iface
Definition: mxwriter.c:168
ISAXDeclHandler ISAXDeclHandler_iface
Definition: mxwriter.c:162
IStream * dest
Definition: mxwriter.c:191
BSTR element
Definition: mxwriter.c:189
BOOL prop_changed
Definition: mxwriter.c:175
BSTR encoding
Definition: mxwriter.c:184
Definition: name.c:39
UINT utf16_total
Definition: mxwriter.c:152
UINT code_page
Definition: mxwriter.c:151
struct list blocks
Definition: mxwriter.c:153
encoded_buffer encoded
Definition: mxwriter.c:150
Definition: send.c:48
Definition: parse.h:23
Definition: tools.h:99
const WCHAR * encoding
Definition: mxwriter.c:75
xml_encoding enc
Definition: mxwriter.c:76
#define max(a, b)
Definition: svc.c:63
#define LIST_ENTRY(type)
Definition: queue.h:175
Character const *const prefix
Definition: tempnam.cpp:195
int32_t INT
Definition: typedefs.h:58
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
Definition: pdh_main.c:96
static const WCHAR props[]
Definition: wbemdisp.c:288
WINBASEAPI _In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon_undoc.h:337
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:3479
#define E_POINTER
Definition: winerror.h:3480
__wchar_t WCHAR
Definition: xmlstorage.h:180