ReactOS 0.4.16-dev-2216-ga08d639
schema.c
Go to the documentation of this file.
1/*
2 * Schema cache implementation
3 *
4 * Copyright 2007 Huw Davies
5 * Copyright 2010 Adam Martinson for CodeWeavers
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 <assert.h>
25#include <stdarg.h>
26#include <libxml/xmlerror.h>
27#include <libxml/tree.h>
28#include <libxml/xmlschemas.h>
30#include <libxml/hash.h>
31#include <libxml/parser.h>
33#include <libxml/xmlIO.h>
34#include <libxml/xmlversion.h>
35#include <libxml/xpath.h>
36
37#include "windef.h"
38#include "winbase.h"
39#include "winuser.h"
40#include "ole2.h"
41#include "msxml6.h"
42
43#include "wine/debug.h"
44
45#include "msxml_private.h"
46
48
49/* We use a chained hashtable, which can hold any number of schemas
50 * TODO: grow/shrink hashtable depending on load factor
51 * TODO: implement read-only where appropriate
52 */
53
54/* This is just the number of buckets, should be prime */
55#define DEFAULT_HASHTABLE_SIZE 17
56
57xmlDocPtr XDR_to_XSD_doc(xmlDocPtr xdr_doc, xmlChar const* nsURI);
58
59static const xmlChar XSD_schema[] = "schema";
60static const xmlChar XSD_nsURI[] = "http://www.w3.org/2001/XMLSchema";
61static const xmlChar XDR_schema[] = "Schema";
62static const xmlChar XDR_nsURI[] = "urn:schemas-microsoft-com:xml-data";
63static const xmlChar DT_nsURI[] = "urn:schemas-microsoft-com:datatypes";
64
66static int datatypes_len;
68static HRSRC datatypes_rsrc;
69static xmlSchemaPtr datatypes_schema;
70
71static const WCHAR emptyW[] = {0};
72
73/* Supported types:
74 * msxml3 - XDR only
75 * msxml4 - XDR & XSD
76 * msxml5 - XDR & XSD
77 * mxsml6 - XSD only
78 *
79 * CacheType_NS is a special type used for read-only collection build with
80 * IXMLDOMDocument2::namespaces()
81 */
82typedef enum {
88
89typedef struct
90{
94
99 int count;
100
104
105typedef struct
106{
108 xmlSchemaPtr schema;
109 xmlDocPtr doc;
112
113static const tid_t schema_cache_se_tids[] = {
117};
118
119/* datatypes lookup stuff
120 * generated with help from gperf */
121#define DT_MIN_STR_LEN 2
122#define DT_MAX_STR_LEN 11
123#define DT_MIN_HASH_VALUE 2
124#define DT_MAX_HASH_VALUE 115
125
126static const xmlChar DT_bin_base64[] = "bin.base64";
127static const xmlChar DT_bin_hex[] = "bin.hex";
128static const xmlChar DT_boolean[] = "boolean";
129static const xmlChar DT_char[] = "char";
130static const xmlChar DT_date[] = "date";
131static const xmlChar DT_date_tz[] = "date.tz";
132static const xmlChar DT_dateTime[] = "dateTime";
133static const xmlChar DT_dateTime_tz[] = "dateTime.tz";
134static const xmlChar DT_entity[] = "entity";
135static const xmlChar DT_entities[] = "entities";
136static const xmlChar DT_enumeration[] = "enumeration";
137static const xmlChar DT_fixed_14_4[] = "fixed.14.4";
138static const xmlChar DT_float[] = "float";
139static const xmlChar DT_i1[] = "i1";
140static const xmlChar DT_i2[] = "i2";
141static const xmlChar DT_i4[] = "i4";
142static const xmlChar DT_i8[] = "i8";
143static const xmlChar DT_id[] = "id";
144static const xmlChar DT_idref[] = "idref";
145static const xmlChar DT_idrefs[] = "idrefs";
146static const xmlChar DT_int[] = "int";
147static const xmlChar DT_nmtoken[] = "nmtoken";
148static const xmlChar DT_nmtokens[] = "nmtokens";
149static const xmlChar DT_notation[] = "notation";
150static const xmlChar DT_number[] = "number";
151static const xmlChar DT_r4[] = "r4";
152static const xmlChar DT_r8[] = "r8";
153static const xmlChar DT_string[] = "string";
154static const xmlChar DT_time[] = "time";
155static const xmlChar DT_time_tz[] = "time.tz";
156static const xmlChar DT_ui1[] = "ui1";
157static const xmlChar DT_ui2[] = "ui2";
158static const xmlChar DT_ui4[] = "ui4";
159static const xmlChar DT_ui8[] = "ui8";
160static const xmlChar DT_uri[] = "uri";
161static const xmlChar DT_uuid[] = "uuid";
162
163static const OLECHAR wDT_bin_base64[] = {'b','i','n','.','b','a','s','e','6','4',0};
164static const OLECHAR wDT_bin_hex[] = {'b','i','n','.','h','e','x',0};
165static const OLECHAR wDT_boolean[] = {'b','o','o','l','e','a','n',0};
166static const OLECHAR wDT_char[] = {'c','h','a','r',0};
167static const OLECHAR wDT_date[] = {'d','a','t','e',0};
168static const OLECHAR wDT_date_tz[] = {'d','a','t','e','.','t','z',0};
169static const OLECHAR wDT_dateTime[] = {'d','a','t','e','T','i','m','e',0};
170static const OLECHAR wDT_dateTime_tz[] = {'d','a','t','e','T','i','m','e','.','t','z',0};
171static const OLECHAR wDT_entity[] = {'e','n','t','i','t','y',0};
172static const OLECHAR wDT_entities[] = {'e','n','t','i','t','i','e','s',0};
173static const OLECHAR wDT_enumeration[] = {'e','n','u','m','e','r','a','t','i','o','n',0};
174static const OLECHAR wDT_fixed_14_4[] = {'f','i','x','e','d','.','1','4','.','4',0};
175static const OLECHAR wDT_float[] = {'f','l','o','a','t',0};
176static const OLECHAR wDT_i1[] = {'i','1',0};
177static const OLECHAR wDT_i2[] = {'i','2',0};
178static const OLECHAR wDT_i4[] = {'i','4',0};
179static const OLECHAR wDT_i8[] = {'i','8',0};
180static const OLECHAR wDT_id[] = {'i','d',0};
181static const OLECHAR wDT_idref[] = {'i','d','r','e','f',0};
182static const OLECHAR wDT_idrefs[] = {'i','d','r','e','f','s',0};
183static const OLECHAR wDT_int[] = {'i','n','t',0};
184static const OLECHAR wDT_nmtoken[] = {'n','m','t','o','k','e','n',0};
185static const OLECHAR wDT_nmtokens[] = {'n','m','t','o','k','e','n','s',0};
186static const OLECHAR wDT_notation[] = {'n','o','t','a','t','i','o','n',0};
187static const OLECHAR wDT_number[] = {'n','u','m','b','e','r',0};
188static const OLECHAR wDT_r4[] = {'r','4',0};
189static const OLECHAR wDT_r8[] = {'r','8',0};
190static const OLECHAR wDT_string[] = {'s','t','r','i','n','g',0};
191static const OLECHAR wDT_time[] = {'t','i','m','e',0};
192static const OLECHAR wDT_time_tz[] = {'t','i','m','e','.','t','z',0};
193static const OLECHAR wDT_ui1[] = {'u','i','1',0};
194static const OLECHAR wDT_ui2[] = {'u','i','2',0};
195static const OLECHAR wDT_ui4[] = {'u','i','4',0};
196static const OLECHAR wDT_ui8[] = {'u','i','8',0};
197static const OLECHAR wDT_uri[] = {'u','r','i',0};
198static const OLECHAR wDT_uuid[] = {'u','u','i','d',0};
199
200static const BYTE hash_assoc_values[] =
201{
202 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
203 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
204 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
205 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
206 116, 116, 116, 116, 116, 116, 10, 116, 116, 55,
207 45, 116, 5, 116, 0, 116, 0, 116, 116, 116,
208 116, 116, 116, 116, 116, 5, 0, 0, 20, 0,
209 0, 10, 0, 0, 116, 0, 0, 0, 15, 5,
210 116, 116, 10, 0, 0, 0, 116, 116, 0, 0,
211 10, 116, 116, 116, 116, 116, 116, 5, 0, 0,
212 20, 0, 0, 10, 0, 0, 116, 0, 0, 0,
213 15, 5, 116, 116, 10, 0, 0, 0, 116, 116,
214 0, 0, 10, 116, 116, 116, 116, 116, 116, 116,
215 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
216 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
217 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
218 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
219 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
220 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
221 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
222 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
223 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
224 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
225 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
226 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
227 116, 116, 116, 116, 116, 116
228};
229
230static void LIBXML2_LOG_CALLBACK parser_error(void* ctx, char const* msg, ...)
231{
232 va_list ap;
233 va_start(ap, msg);
235 va_end(ap);
236}
237
238static void LIBXML2_LOG_CALLBACK parser_warning(void* ctx, char const* msg, ...)
239{
240 va_list ap;
241 va_start(ap, msg);
243 va_end(ap);
244}
245
246static void parser_serror(void* ctx, const xmlError* err)
247{
249}
250
251static inline xmlSchemaPtr Schema_parse(xmlSchemaParserCtxtPtr spctx)
252{
253 TRACE("(%p)\n", spctx);
254
255 xmlSchemaSetParserErrors(spctx, parser_error, parser_warning, NULL);
256 xmlSchemaSetParserStructuredErrors(spctx, parser_serror, NULL);
257 return xmlSchemaParse(spctx);
258}
259
260static void LIBXML2_LOG_CALLBACK validate_error(void* ctx, char const* msg, ...)
261{
262 va_list ap;
263 va_start(ap, msg);
265 va_end(ap);
266}
267
268static void LIBXML2_LOG_CALLBACK validate_warning(void* ctx, char const* msg, ...)
269{
270 va_list ap;
271 va_start(ap, msg);
273 va_end(ap);
274}
275
276static void validate_serror(void* ctx, const xmlError* err)
277{
279}
280
282{
283 V_VT(item) = VT_BSTR;
284 return IXMLDOMSchemaCollection2_get_namespaceURI((IXMLDOMSchemaCollection2*)iface, index, &V_BSTR(item));
285}
286
289 NULL
290};
291
292static inline HRESULT Schema_validate_tree(xmlSchemaPtr schema, xmlNodePtr tree)
293{
294 xmlSchemaValidCtxtPtr svctx;
295 int err;
296
297 TRACE("(%p, %p)\n", schema, tree);
298 /* TODO: if validateOnLoad property is false,
299 * we probably need to validate the schema here. */
300 svctx = xmlSchemaNewValidCtxt(schema);
301 xmlSchemaSetValidErrors(svctx, validate_error, validate_warning, NULL);
302 xmlSchemaSetValidStructuredErrors(svctx, validate_serror, NULL);
303
304 if (tree->type == XML_DOCUMENT_NODE)
305 err = xmlSchemaValidateDoc(svctx, (xmlDocPtr)tree);
306 else
307 err = xmlSchemaValidateOneElement(svctx, tree);
308
309 xmlSchemaFreeValidCtxt(svctx);
310 return err? S_FALSE : S_OK;
311}
312
313static DWORD dt_hash(xmlChar const* str, int len /* calculated if -1 */)
314{
315 DWORD hval = (len == -1)? xmlStrlen(str) : len;
316
317 switch (hval)
318 {
319 default:
320 hval += hash_assoc_values[str[10]];
321 /*FALLTHROUGH*/
322 case 10:
323 hval += hash_assoc_values[str[9]];
324 /*FALLTHROUGH*/
325 case 9:
326 hval += hash_assoc_values[str[8]];
327 /*FALLTHROUGH*/
328 case 8:
329 hval += hash_assoc_values[str[7]];
330 /*FALLTHROUGH*/
331 case 7:
332 hval += hash_assoc_values[str[6]];
333 /*FALLTHROUGH*/
334 case 6:
335 hval += hash_assoc_values[str[5]];
336 /*FALLTHROUGH*/
337 case 5:
338 hval += hash_assoc_values[str[4]];
339 /*FALLTHROUGH*/
340 case 4:
341 hval += hash_assoc_values[str[3]];
342 /*FALLTHROUGH*/
343 case 3:
344 hval += hash_assoc_values[str[2]];
345 /*FALLTHROUGH*/
346 case 2:
347 hval += hash_assoc_values[str[1]];
348 /*FALLTHROUGH*/
349 case 1:
350 hval += hash_assoc_values[str[0]];
351 break;
352 }
353 return hval;
354}
355
356static DWORD dt_hash_bstr(OLECHAR const* bstr, int len /* calculated if -1 */)
357{
358 DWORD hval = (len == -1)? lstrlenW(bstr) : len;
359
360 switch (hval)
361 {
362 default:
363 hval += (bstr[10] & 0xFF00)? 116 : hash_assoc_values[bstr[10]];
364 /*FALLTHROUGH*/
365 case 10:
366 hval += (bstr[9] & 0xFF00)? 116 : hash_assoc_values[bstr[9]];
367 /*FALLTHROUGH*/
368 case 9:
369 hval += (bstr[8] & 0xFF00)? 116 : hash_assoc_values[bstr[8]];
370 /*FALLTHROUGH*/
371 case 8:
372 hval += (bstr[7] & 0xFF00)? 116 : hash_assoc_values[bstr[7]];
373 /*FALLTHROUGH*/
374 case 7:
375 hval += (bstr[6] & 0xFF00)? 116 : hash_assoc_values[bstr[6]];
376 /*FALLTHROUGH*/
377 case 6:
378 hval += (bstr[5] & 0xFF00)? 116 : hash_assoc_values[bstr[5]];
379 /*FALLTHROUGH*/
380 case 5:
381 hval += (bstr[4] & 0xFF00)? 116 : hash_assoc_values[bstr[4]];
382 /*FALLTHROUGH*/
383 case 4:
384 hval += (bstr[3] & 0xFF00)? 116 : hash_assoc_values[bstr[3]];
385 /*FALLTHROUGH*/
386 case 3:
387 hval += (bstr[2] & 0xFF00)? 116 : hash_assoc_values[bstr[2]];
388 /*FALLTHROUGH*/
389 case 2:
390 hval += (bstr[1] & 0xFF00)? 116 : hash_assoc_values[bstr[1]];
391 /*FALLTHROUGH*/
392 case 1:
393 hval += (bstr[0] & 0xFF00)? 116 : hash_assoc_values[bstr[0]];
394 break;
395 }
396 return hval;
397}
398
399static const xmlChar *const DT_string_table[LAST_DT] =
400{
404 DT_char,
405 DT_date,
409 DT_entity,
413 DT_float,
414 DT_i1,
415 DT_i2,
416 DT_i4,
417 DT_i8,
418 DT_id,
419 DT_idref,
420 DT_idrefs,
421 DT_int,
425 DT_number,
426 DT_r4,
427 DT_r8,
428 DT_string,
429 DT_time,
431 DT_ui1,
432 DT_ui2,
433 DT_ui4,
434 DT_ui8,
435 DT_uri,
436 DT_uuid
437};
438
439static const WCHAR *const DT_wstring_table[LAST_DT] =
440{
444 wDT_char,
445 wDT_date,
453 wDT_float,
454 wDT_i1,
455 wDT_i2,
456 wDT_i4,
457 wDT_i8,
458 wDT_id,
459 wDT_idref,
461 wDT_int,
466 wDT_r4,
467 wDT_r8,
469 wDT_time,
471 wDT_ui1,
472 wDT_ui2,
473 wDT_ui4,
474 wDT_ui8,
475 wDT_uri,
477};
478
479static const XDR_DT DT_lookup_table[] =
480{
481 -1, -1,
482 DT_I8,
483 DT_UI8,
484 DT_TIME,
485 -1, -1,
486 DT_I4,
487 DT_UI4,
488 -1, -1, -1,
489 DT_R8,
490 DT_URI,
491 -1,
492 DT_FLOAT,
493 -1,
494 DT_R4,
495 DT_INT,
496 DT_CHAR,
497 -1,
498 DT_ENTITY,
499 DT_ID,
501 DT_UUID,
502 -1, -1,
504 -1,
505 DT_DATE,
506 -1,
507 DT_NUMBER,
510 -1,
511 DT_IDREF,
512 DT_IDREFS,
514 -1, -1, -1,
515 DT_STRING,
518 -1,
520 -1,
521 DT_I2,
522 DT_UI2,
523 -1, -1, -1,
526 -1, -1,
528 DT_I1,
529 DT_UI1,
530 -1, -1,
532 -1, -1, -1, -1, -1, -1, -1, -1, -1,
533 -1, -1, -1, -1, -1, -1, -1, -1, -1,
534 -1, -1, -1, -1, -1, -1, -1, -1, -1,
535 -1, -1, -1, -1, -1, -1, -1, -1, -1,
536 -1, -1, -1, -1, -1, -1, -1, -1, -1,
537 -1, -1, -1, -1, -1, -1, -1, -1,
539};
540
541XDR_DT str_to_dt(xmlChar const* str, int len /* calculated if -1 */)
542{
544 XDR_DT dt = DT_INVALID;
545
546 if (hash <= DT_MAX_HASH_VALUE)
547 dt = DT_lookup_table[hash];
548
549 if (dt != DT_INVALID && xmlStrcasecmp(str, DT_string_table[dt]) == 0)
550 return dt;
551
552 return DT_INVALID;
553}
554
555XDR_DT bstr_to_dt(OLECHAR const* bstr, int len /* calculated if -1 */)
556{
557 DWORD hash = dt_hash_bstr(bstr, len);
558 XDR_DT dt = DT_INVALID;
559
560 if (hash <= DT_MAX_HASH_VALUE)
561 dt = DT_lookup_table[hash];
562
563 if (dt != DT_INVALID && lstrcmpiW(bstr, DT_wstring_table[dt]) == 0)
564 return dt;
565
566 return DT_INVALID;
567}
568
570{
571 if (dt == DT_INVALID)
572 return NULL;
573
574 return DT_string_table[dt];
575}
576
578{
579 if (dt == DT_INVALID)
580 return NULL;
581
582 return DT_wstring_table[dt];
583}
584
585const char* debugstr_dt(XDR_DT dt)
586{
587 return debugstr_a(dt != DT_INVALID ? (const char*)DT_string_table[dt] : NULL);
588}
589
591{
592 xmlDocPtr tmp_doc;
593 xmlNodePtr node;
594 xmlNsPtr ns;
595 HRESULT hr;
596
597 TRACE("(dt:%s, %s)\n", debugstr_dt(dt), debugstr_a((char const*)content));
598
599 if (!datatypes_schema)
600 {
601 xmlSchemaParserCtxtPtr spctx;
603 spctx = xmlSchemaNewMemParserCtxt((char const*)datatypes_src, datatypes_len);
605 xmlSchemaFreeParserCtxt(spctx);
606 }
607
608 switch (dt)
609 {
610 case DT_INVALID:
611 return E_FAIL;
612 case DT_BIN_BASE64:
613 case DT_BIN_HEX:
614 case DT_BOOLEAN:
615 case DT_CHAR:
616 case DT_DATE:
617 case DT_DATE_TZ:
618 case DT_DATETIME:
619 case DT_DATETIME_TZ:
620 case DT_FIXED_14_4:
621 case DT_FLOAT:
622 case DT_I1:
623 case DT_I2:
624 case DT_I4:
625 case DT_I8:
626 case DT_INT:
627 case DT_NMTOKEN:
628 case DT_NMTOKENS:
629 case DT_NUMBER:
630 case DT_R4:
631 case DT_R8:
632 case DT_STRING:
633 case DT_TIME:
634 case DT_TIME_TZ:
635 case DT_UI1:
636 case DT_UI2:
637 case DT_UI4:
638 case DT_UI8:
639 case DT_URI:
640 case DT_UUID:
641 if (!datatypes_schema)
642 {
643 ERR("failed to load schema for urn:schemas-microsoft-com:datatypes, "
644 "you're probably using an old version of libxml2: " LIBXML_DOTTED_VERSION "\n");
645
646 /* Hopefully they don't need much in the way of XDR datatypes support... */
647 return S_OK;
648 }
649
650 if (content && xmlStrlen(content))
651 {
652 tmp_doc = xmlNewDoc(NULL);
653 node = xmlNewChild((xmlNodePtr)tmp_doc, NULL, dt_to_str(dt), content);
654 ns = xmlNewNs(node, DT_nsURI, BAD_CAST "dt");
655 xmlSetNs(node, ns);
656 xmlDocSetRootElement(tmp_doc, node);
657
658 hr = Schema_validate_tree(datatypes_schema, (xmlNodePtr)tmp_doc);
659 xmlFreeDoc(tmp_doc);
660 }
661 else
662 { /* probably the node is being created manually and has no content yet */
663 hr = S_OK;
664 }
665 return hr;
666 default:
667 FIXME("need to handle dt:%s\n", debugstr_dt(dt));
668 return S_OK;
669 }
670}
671
672static inline xmlChar const* get_node_nsURI(xmlNodePtr node)
673{
674 return (node->ns != NULL)? node->ns->href : NULL;
675}
676
677static inline cache_entry* get_entry(schema_cache* This, xmlChar const* nsURI)
678{
679 return (!nsURI)? xmlHashLookup(This->cache, BAD_CAST "") :
680 xmlHashLookup(This->cache, nsURI);
681}
682
683static inline xmlSchemaPtr get_node_schema(schema_cache* This, xmlNodePtr node)
684{
686 return (!entry)? NULL : entry->schema;
687}
688
690
691static xmlParserInputPtr external_entity_loader(const char *URL, const char *ID,
692 xmlParserCtxtPtr ctxt)
693{
694 xmlParserInputPtr input;
695
696 TRACE("(%s %s %p)\n", debugstr_a(URL), debugstr_a(ID), ctxt);
697
702
703 /* TODO: if the desired schema is in the cache, load it from there */
704 if (lstrcmpA(URL, "urn:schemas-microsoft-com:datatypes") == 0)
705 {
706 TRACE("loading built-in schema for %s\n", URL);
708 }
709 else
710 {
711 input = _external_entity_loader(URL, ID, ctxt);
712 }
713
714 return input;
715}
716
717void schemasInit(void)
718{
719 xmlChar* buf;
720 if (!(datatypes_rsrc = FindResourceA(MSXML_hInstance, "DATATYPES", "XML")))
721 {
722 FIXME("failed to find resource for %s\n", DT_nsURI);
723 return;
724 }
725
727 {
728 FIXME("failed to load resource for %s\n", DT_nsURI);
729 return;
730 }
733
734 /* Resource is loaded as raw data,
735 * need a null-terminated string */
736 while (buf[datatypes_len - 1] != '>') datatypes_len--;
740
742 {
745 }
746}
747
749{
750 xmlSchemaFree(datatypes_schema);
753}
754
756{
758 TRACE("%p, refcount %ld.\n", entry, ref);
759 return ref;
760}
761
763{
765 TRACE("%p, refcount %ld.\n", entry, ref);
766
767 if (ref == 0)
768 {
769 if (entry->type == CacheEntryType_XSD)
770 {
771 xmldoc_release(entry->doc);
772 entry->schema->doc = NULL;
773 xmlSchemaFree(entry->schema);
774 }
775 else if (entry->type == CacheEntryType_XDR)
776 {
777 xmldoc_release(entry->doc);
778 xmldoc_release(entry->schema->doc);
779 entry->schema->doc = NULL;
780 xmlSchemaFree(entry->schema);
781 }
782
783 free(entry);
784 }
785 return ref;
786}
787
788static const struct IXMLDOMSchemaCollection2Vtbl XMLDOMSchemaCollection2Vtbl;
789
791{
792 return CONTAINING_RECORD(iface, schema_cache, IXMLDOMSchemaCollection2_iface);
793}
794
796{
797 return CONTAINING_RECORD(iface, schema_cache, IXMLDOMSchemaCollection2_iface);
798}
799
801{
802 return iface->lpVtbl == (void*)&XMLDOMSchemaCollection2Vtbl ? impl_from_IXMLDOMSchemaCollection(iface) : NULL;
803}
804
806{
807 xmlNodePtr root = NULL;
808 if (schema)
809 root = xmlDocGetRootElement(schema);
810 if (root && root->ns)
811 {
812
813 if (xmlStrEqual(root->name, XDR_schema) &&
814 xmlStrEqual(root->ns->href, XDR_nsURI))
815 {
816 return CacheEntryType_XDR;
817 }
818 else if (xmlStrEqual(root->name, XSD_schema) &&
819 xmlStrEqual(root->ns->href, XSD_nsURI))
820 {
821 return CacheEntryType_XSD;
822 }
823 }
825}
826
827static BOOL link_datatypes(xmlDocPtr schema)
828{
829 xmlNodePtr root, next, child;
830 xmlNsPtr ns;
831
833 root = xmlDocGetRootElement(schema);
834 if (!root)
835 return FALSE;
836
837 for (ns = root->nsDef; ns != NULL; ns = ns->next)
838 {
839 if (xmlStrEqual(ns->href, DT_nsURI))
840 break;
841 }
842
843 if (!ns)
844 return FALSE;
845
846 next = xmlFirstElementChild(root);
847 child = xmlNewChild(root, NULL, BAD_CAST "import", NULL);
848 if (next) child = xmlAddPrevSibling(next, child);
849 xmlSetProp(child, BAD_CAST "namespace", DT_nsURI);
850 xmlSetProp(child, BAD_CAST "schemaLocation", DT_nsURI);
851
852 return TRUE;
853}
854
855static cache_entry* cache_entry_from_xsd_doc(xmlDocPtr doc, xmlChar const* nsURI, MSXML_VERSION v)
856{
858 xmlSchemaParserCtxtPtr spctx;
859 xmlDocPtr new_doc = xmlCopyDoc(doc, 1);
860
861 link_datatypes(new_doc);
862
863 /* TODO: if the nsURI is different from the default xmlns or targetNamespace,
864 * do we need to do something special here? */
866 entry->ref = 0;
867 spctx = xmlSchemaNewDocParserCtxt(new_doc);
868
869 if ((entry->schema = Schema_parse(spctx)))
870 {
871 xmldoc_init(entry->schema->doc, v);
872 entry->doc = entry->schema->doc;
873 xmldoc_add_ref(entry->doc);
874 }
875 else
876 {
877 FIXME("failed to parse doc\n");
878 xmlFreeDoc(new_doc);
879 free(entry);
880 entry = NULL;
881 }
882 xmlSchemaFreeParserCtxt(spctx);
883 return entry;
884}
885
887{
889 xmlSchemaParserCtxtPtr spctx;
890 xmlDocPtr new_doc = xmlCopyDoc(doc, 1), xsd_doc = XDR_to_XSD_doc(doc, nsURI);
891
892 link_datatypes(xsd_doc);
893
895 entry->ref = 0;
896 spctx = xmlSchemaNewDocParserCtxt(xsd_doc);
897
898 if ((entry->schema = Schema_parse(spctx)))
899 {
900 entry->doc = new_doc;
901 xmldoc_init(entry->schema->doc, version);
903 xmldoc_add_ref(entry->doc);
904 xmldoc_add_ref(entry->schema->doc);
905 }
906 else
907 {
908 FIXME("failed to parse doc\n");
909 xmlFreeDoc(new_doc);
910 xmlFreeDoc(xsd_doc);
911 free(entry);
912 entry = NULL;
913 }
914 xmlSchemaFreeParserCtxt(spctx);
915
916 return entry;
917}
918
920{
923 xmlDocPtr doc = NULL;
925 VARIANT_BOOL b = VARIANT_FALSE;
927
928 if (hr != S_OK)
929 {
930 FIXME("failed to create domdoc\n");
931 return NULL;
932 }
933 assert(domdoc != NULL);
934 assert(V_VT(&url) == VT_BSTR);
935
936 hr = IXMLDOMDocument3_load(domdoc, url, &b);
937 if (hr != S_OK)
938 {
939 ERR("load() returned %#lx.\n", hr);
940 if (b != VARIANT_TRUE)
941 {
942 FIXME("Failed to load doc at %s\n", debugstr_w(V_BSTR(&url)));
943 IXMLDOMDocument3_Release(domdoc);
944 return NULL;
945 }
946 }
947 doc = xmlNodePtr_from_domnode((IXMLDOMNode*)domdoc, XML_DOCUMENT_NODE)->doc;
949
950 switch (type)
951 {
954 break;
957 break;
958 default:
959 entry = NULL;
960 FIXME("invalid schema\n");
961 break;
962 }
963 IXMLDOMDocument3_Release(domdoc);
964
965 return entry;
966}
967
968static void cache_free(void* data, const xmlChar* name /* ignored */)
969{
971}
972
973/* returns index or -1 if not found */
975{
976 int i;
977
978 for (i = 0; i < cache->count; i++)
979 if (xmlStrEqual(cache->uris[i], uri))
980 {
981 free(cache->uris[i]);
982 return i;
983 }
984
985 return -1;
986}
987
989{
990 int i;
991
992 /* meaning no entry found with this name */
994 {
995 if (cache->count == cache->allocated)
996 {
997 cache->allocated *= 2;
998 cache->uris = realloc(cache->uris, cache->allocated * sizeof(xmlChar*));
999 }
1000 i = cache->count++;
1001 }
1002 else
1004
1005 cache->uris[i] = strdupxmlChar(uri);
1006 xmlHashAddEntry(cache->cache, uri, entry);
1007}
1008
1010{
1011 /* adjust index if entry was really removed */
1012 if (xmlHashRemoveEntry(cache->cache, uri, cache_free) == 0)
1013 {
1014 int i = cache_free_uri(cache, uri);
1015 if (i == -1) return;
1016 /* shift array */
1017 if (i != --cache->count)
1018 memmove(&cache->uris[i], &cache->uris[i+1], (cache->count-i)*sizeof(xmlChar*));
1019 }
1020}
1021
1022/* This one adds all namespaces defined in document to a cache, without anything
1023 associated with uri obviously.
1024 Unfortunately namespace:: axis implementation in libxml2 differs from what we need,
1025 it uses additional node type to describe namespace definition attribute while
1026 in msxml it's expected to be a normal attribute - as a workaround document is
1027 queried at libxml2 level here. */
1029{
1031 static const xmlChar query[] = "//*/namespace::*";
1032 xmlXPathObjectPtr nodeset;
1033 xmlXPathContextPtr ctxt;
1034
1035 This->read_only = 1;
1036
1037 ctxt = xmlXPathNewContext(node->node->doc);
1038
1039 nodeset = xmlXPathEvalExpression(query, ctxt);
1040 xmlXPathFreeContext(ctxt);
1041
1042 if (nodeset)
1043 {
1044 int pos = 0, len = xmlXPathNodeSetGetLength(nodeset->nodesetval);
1045
1046 while (pos < len)
1047 {
1048 xmlNodePtr node = xmlXPathNodeSetItem(nodeset->nodesetval, pos);
1049 if (node->type == XML_NAMESPACE_DECL)
1050 {
1051 static const xmlChar defns[] = "http://www.w3.org/XML/1998/namespace";
1052 xmlNsPtr ns = (xmlNsPtr)node;
1054
1055 /* filter out default uri */
1056 if (xmlStrEqual(ns->href, defns))
1057 {
1058 pos++;
1059 continue;
1060 }
1061
1062 entry = malloc(sizeof(cache_entry));
1063 entry->type = CacheEntryType_NS;
1064 entry->ref = 1;
1065 entry->schema = NULL;
1066 entry->doc = NULL;
1067
1068 cache_add_entry(This, ns->href, entry);
1069 }
1070 pos++;
1071 }
1072
1073 xmlXPathFreeObject(nodeset);
1074 }
1075
1076 return S_OK;
1077}
1078
1080 REFIID riid, void** ppvObject)
1081{
1083
1084 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
1085
1086 if ( IsEqualIID(riid, &IID_IUnknown) ||
1088 IsEqualIID(riid, &IID_IXMLDOMSchemaCollection) ||
1089 IsEqualIID(riid, &IID_IXMLDOMSchemaCollection2) )
1090 {
1091 *ppvObject = iface;
1092 }
1093 else if(This->version == MSXML6 && IsEqualIID(riid, &CLSID_XMLSchemaCache60))
1094 {
1095 /*
1096 * Version 6 can be queried for an interface with IID equal to CLSID.
1097 * There is no public interface with that IID and returned pointer
1098 * is equal to returned IXMLDOMSchemaCollection2 iface. We assume
1099 * that it's just another way for querying IXMLDOMSchemaCollection2
1100 * interface. Office 2013 ClickToRun installer uses this.
1101 */
1102 WARN("riid CLSID_XMLSchemaCache60, returning IXMLDOMSchemaCollection2 interface.\n");
1103 *ppvObject = iface;
1104 }
1105 else if (dispex_query_interface(&This->dispex, riid, ppvObject))
1106 {
1107 return *ppvObject ? S_OK : E_NOINTERFACE;
1108 }
1109 else if(IsEqualGUID( riid, &IID_ISupportErrorInfo ))
1110 {
1112 }
1113 else
1114 {
1115 FIXME("interface %s not implemented\n", debugstr_guid(riid));
1116 *ppvObject = NULL;
1117 return E_NOINTERFACE;
1118 }
1119
1120 IXMLDOMSchemaCollection2_AddRef(iface);
1121
1122 return S_OK;
1123}
1124
1126{
1129 TRACE("%p, refcount %ld.\n", iface, ref);
1130 return ref;
1131}
1132
1134{
1137 TRACE("%p, refcount %ld.\n", iface, ref);
1138
1139 if (!ref)
1140 {
1141 int i;
1142
1143 for (i = 0; i < This->count; i++)
1144 free(This->uris[i]);
1145 free(This->uris);
1146 xmlHashFree(This->cache, cache_free);
1147 free(This);
1148 }
1149
1150 return ref;
1151}
1152
1154 UINT* pctinfo)
1155{
1157 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
1158}
1159
1161 UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo)
1162{
1164 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface,
1165 iTInfo, lcid, ppTInfo);
1166}
1167
1169 REFIID riid, LPOLESTR* rgszNames,
1170 UINT cNames, LCID lcid, DISPID* rgDispId)
1171{
1173 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface,
1174 riid, rgszNames, cNames, lcid, rgDispId);
1175}
1176
1178 DISPID dispIdMember, REFIID riid, LCID lcid,
1179 WORD wFlags, DISPPARAMS* pDispParams,
1180 VARIANT* pVarResult, EXCEPINFO* pExcepInfo,
1181 UINT* puArgErr)
1182{
1184 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface,
1185 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1186}
1187
1189{
1191 xmlChar* name;
1192
1193 TRACE("(%p)->(%s %s)\n", This, debugstr_w(uri), debugstr_variant(&var));
1194
1195 if (This->read_only) return E_FAIL;
1196
1198
1199 switch (V_VT(&var))
1200 {
1201 case VT_NULL:
1202 {
1204 }
1205 break;
1206
1207 case VT_BSTR:
1208 {
1210
1211 if (entry)
1212 {
1214 }
1215 else
1216 {
1217 free(name);
1218 return E_FAIL;
1219 }
1220
1222 }
1223 break;
1224
1225 case VT_DISPATCH:
1226 case VT_UNKNOWN:
1227 {
1228 xmlDocPtr doc = NULL;
1231 IXMLDOMNode* domnode = NULL;
1232 IUnknown_QueryInterface(V_UNKNOWN(&var), &IID_IXMLDOMNode, (void**)&domnode);
1233
1234 if (domnode)
1235 {
1237
1238 IXMLDOMNode_get_nodeType(domnode, &type);
1239 switch (type)
1240 {
1241 case NODE_ELEMENT:
1242 {
1245 BSTR xml;
1246
1247 IXMLDOMNode_get_xml(domnode, &xml);
1248 dom_document_create(This->version, (void **)&domdoc);
1249 IXMLDOMDocument_loadXML(domdoc, xml, &b);
1250 SysFreeString(xml);
1251 doc = xmlNodePtr_from_domnode((IXMLDOMNode*)domdoc, XML_DOCUMENT_NODE)->doc;
1252 break;
1253 }
1254 default:
1255 doc = xmlNodePtr_from_domnode(domnode, XML_DOCUMENT_NODE)->doc;
1256 break;
1257 }
1258 }
1259
1260 if (!doc)
1261 {
1262 IXMLDOMNode_Release(domnode);
1263 free(name);
1264 return E_INVALIDARG;
1265 }
1267
1268 if (type == CacheEntryType_XSD)
1269 {
1270 entry = cache_entry_from_xsd_doc(doc, name, This->version);
1271 }
1272 else if (type == CacheEntryType_XDR)
1273 {
1274 entry = cache_entry_from_xdr_doc(doc, name, This->version);
1275 }
1276 else
1277 {
1278 WARN("invalid schema!\n");
1279 entry = NULL;
1280 }
1281
1282 IXMLDOMNode_Release(domnode);
1283
1284 if (entry)
1285 {
1287 }
1288 else
1289 {
1290 free(name);
1291 return E_FAIL;
1292 }
1293
1295 }
1296 break;
1297
1298 default:
1299 FIXME("arg type is not supported, %s\n", debugstr_variant(&var));
1300 free(name);
1301 return E_INVALIDARG;
1302 }
1303 free(name);
1304 return S_OK;
1305}
1306
1308 IXMLDOMNode** node)
1309{
1312 xmlChar* name;
1313
1314 TRACE("(%p)->(%s %p)\n", This, debugstr_w(uri), node);
1315
1316 if (This->version == MSXML6)
1317 {
1318 if (node) *node = NULL;
1319 return E_NOTIMPL;
1320 }
1321
1322 if (!node)
1323 return E_POINTER;
1324
1325 *node = NULL;
1326
1328 entry = (cache_entry*) xmlHashLookup(This->cache, name);
1329 free(name);
1330
1331 /* TODO: this should be read-only */
1332 if (entry && entry->doc)
1334
1335 return S_OK;
1336}
1337
1339{
1341 xmlChar* name;
1342
1343 TRACE("(%p)->(%s)\n", This, debugstr_w(uri));
1344
1345 if (This->version == MSXML6) return E_NOTIMPL;
1346
1349 free(name);
1350 return S_OK;
1351}
1352
1354{
1356 TRACE("(%p)->(%p)\n", This, length);
1357
1358 if (!length)
1359 return E_POINTER;
1360
1361 *length = This->count;
1362 return S_OK;
1363}
1364
1366 LONG index, BSTR* uri)
1367{
1369
1370 TRACE("%p, %ld, %p.\n", iface, index, uri);
1371
1372 if (!uri)
1373 return E_POINTER;
1374
1375 if (This->version == MSXML6)
1376 *uri = NULL;
1377
1378 if (index >= This->count)
1379 return E_FAIL;
1380
1381 *uri = bstr_from_xmlChar(This->uris[index]);
1382 return S_OK;
1383}
1384
1385static void cache_copy(void* data, void* dest, const xmlChar* name)
1386{
1389
1390 if (xmlHashLookup(This->cache, name) == NULL)
1391 {
1394 }
1395}
1396
1399{
1401 schema_cache* That;
1402
1403 TRACE("(%p)->(%p)\n", This, collection);
1404
1405 if (!collection)
1406 return E_POINTER;
1407
1409 if (!That)
1410 {
1411 ERR("external collection implementation\n");
1412 return E_FAIL;
1413 }
1414
1415 /* TODO: detect errors while copying & return E_FAIL */
1417
1418 return S_OK;
1419}
1420
1422{
1424 TRACE("(%p)->(%p)\n", This, enumv);
1426}
1427
1429{
1431 FIXME("(%p): stub\n", This);
1432 return E_NOTIMPL;
1433}
1434
1437{
1439 FIXME("(%p)->(%d): stub\n", This, value);
1440
1441 This->validateOnLoad = value;
1442 /* it's ok to disable it, cause we don't validate on load anyway */
1443 if (value == VARIANT_FALSE) return S_OK;
1444
1445 return E_NOTIMPL;
1446}
1447
1450{
1452 TRACE("(%p)->(%p)\n", This, value);
1453
1454 if (!value) return E_POINTER;
1455 *value = This->validateOnLoad;
1456
1457 return S_OK;
1458}
1459
1461 BSTR namespaceURI, ISchema** schema)
1462{
1464 FIXME("(%p)->(%s %p): stub\n", This, debugstr_w(namespaceURI), schema);
1465 if (schema)
1466 *schema = NULL;
1467 return E_NOTIMPL;
1468}
1469
1471 IXMLDOMNode* node, ISchemaItem** item)
1472{
1474 FIXME("(%p)->(%p %p): stub\n", This, node, item);
1475 if (item)
1476 *item = NULL;
1477 return E_NOTIMPL;
1478}
1479
1480static const struct IXMLDOMSchemaCollection2Vtbl XMLDOMSchemaCollection2Vtbl =
1481{
1501};
1502
1503static xmlSchemaElementPtr lookup_schema_elemDecl(xmlSchemaPtr schema, xmlNodePtr node)
1504{
1505 xmlSchemaElementPtr decl = NULL;
1506 xmlChar const* nsURI = get_node_nsURI(node);
1507
1508 TRACE("(%p, %p)\n", schema, node);
1509
1510 if (xmlStrEqual(nsURI, schema->targetNamespace))
1511 decl = xmlHashLookup(schema->elemDecl, node->name);
1512
1513 if (!decl && xmlHashSize(schema->schemasImports) > 1)
1514 {
1515 FIXME("declaration not found in main schema - need to check schema imports!\n");
1516 /*xmlSchemaImportPtr import;
1517 if (nsURI == NULL)
1518 import = xmlHashLookup(schema->schemasImports, XML_SCHEMAS_NO_NAMESPACE);
1519 else
1520 import = xmlHashLookup(schema->schemasImports, node->ns->href);
1521
1522 if (import != NULL)
1523 decl = xmlHashLookup(import->schema->elemDecl, node->name);*/
1524 }
1525
1526 return decl;
1527}
1528
1529static inline xmlNodePtr lookup_schema_element(xmlSchemaPtr schema, xmlNodePtr node)
1530{
1531 xmlSchemaElementPtr decl = lookup_schema_elemDecl(schema, node);
1532 while (decl != NULL && decl->refDecl != NULL)
1533 decl = decl->refDecl;
1534 return (decl != NULL)? decl->node : NULL;
1535}
1536
1538{
1540 xmlSchemaPtr schema;
1541
1542 TRACE("(%p, %p)\n", This, tree);
1543
1544 if (!tree)
1545 return E_POINTER;
1546
1547 if (tree->type == XML_DOCUMENT_NODE)
1548 tree = xmlDocGetRootElement(tree->doc);
1549
1551 /* TODO: if the ns is not in the cache, and it's a URL,
1552 * do we try to load from that? */
1553 if (schema)
1555 else
1556 WARN("no schema found for xmlns=%s\n", get_node_nsURI(tree));
1557
1558 return E_FAIL;
1559}
1560
1562{
1564 xmlSchemaPtr schema = get_node_schema(This, node);
1565 XDR_DT dt = DT_INVALID;
1566
1567 TRACE("(%p, %p)\n", This, node);
1568
1569 if (node->ns && xmlStrEqual(node->ns->href, DT_nsURI))
1570 {
1571 dt = str_to_dt(node->name, -1);
1572 }
1573 else if (schema)
1574 {
1575 xmlChar* str;
1576 xmlNodePtr schema_node = lookup_schema_element(schema, node);
1577
1578 str = xmlGetNsProp(schema_node, BAD_CAST "dt", DT_nsURI);
1579 if (str)
1580 {
1581 dt = str_to_dt(str, -1);
1582 xmlFree(str);
1583 }
1584 }
1585
1586 return dt;
1587}
1588
1591 0
1592};
1593
1595 NULL,
1597 NULL,
1599};
1600
1602{
1604 if (!This)
1605 return E_OUTOFMEMORY;
1606
1607 TRACE("(%d %p)\n", version, obj);
1608
1609 This->IXMLDOMSchemaCollection2_iface.lpVtbl = &XMLDOMSchemaCollection2Vtbl;
1611 This->allocated = 10;
1612 This->count = 0;
1613 This->uris = malloc(This->allocated * sizeof(xmlChar*));
1614 This->ref = 1;
1615 This->version = version;
1616 This->validateOnLoad = VARIANT_TRUE;
1617 This->read_only = 0;
1618 init_dispex(&This->dispex, (IUnknown*)&This->IXMLDOMSchemaCollection2_iface, &schemacache_dispex);
1619
1620 *obj = &This->IXMLDOMSchemaCollection2_iface;
1621 return S_OK;
1622}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define msg(x)
Definition: auth_time.c:54
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
struct _root root
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#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
content
Definition: atl_ax.c:994
#define DT_STRING
Definition: datetime.c:117
WCHAR OLECHAR
Definition: compat.h:2292
OLECHAR * BSTR
Definition: compat.h:2293
short VARIANT_BOOL
Definition: compat.h:2290
@ VT_BSTR
Definition: compat.h:2303
@ VT_NULL
Definition: compat.h:2296
@ VT_UNKNOWN
Definition: compat.h:2308
@ VT_DISPATCH
Definition: compat.h:2304
#define lstrlenW
Definition: compat.h:750
static const WCHAR version[]
Definition: asmname.c:66
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4198
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4265
LCID lcid
Definition: locale.c:5656
#define assert(_expr)
Definition: assert.h:32
#define va_end(v)
Definition: stdarg.h:28
#define va_start(v, l)
Definition: stdarg.h:26
char * va_list
Definition: vadefs.h:50
void xmldoc_init(xmlDocPtr doc, MSXML_VERSION version)
Definition: domdoc.c:606
LONG xmldoc_release(xmlDocPtr doc)
Definition: domdoc.c:653
HRESULT get_domdoc_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document)
Definition: domdoc.c:3749
LONG xmldoc_add_ref(xmlDocPtr doc)
Definition: domdoc.c:619
HRESULT dom_document_create(MSXML_VERSION version, void **ppObj)
Definition: domdoc.c:3788
HINSTANCE MSXML_hInstance
Definition: main.c:51
static const OLECHAR wDT_id[]
Definition: schema.c:180
static HRESULT WINAPI schema_cache_QueryInterface(IXMLDOMSchemaCollection2 *iface, REFIID riid, void **ppvObject)
Definition: schema.c:1079
static const OLECHAR wDT_nmtoken[]
Definition: schema.c:184
static const OLECHAR wDT_idrefs[]
Definition: schema.c:182
static const xmlChar DT_i8[]
Definition: schema.c:142
static const struct IXMLDOMSchemaCollection2Vtbl XMLDOMSchemaCollection2Vtbl
Definition: schema.c:788
static const xmlChar DT_nmtokens[]
Definition: schema.c:148
static const OLECHAR wDT_bin_base64[]
Definition: schema.c:163
static const OLECHAR wDT_entity[]
Definition: schema.c:171
static const xmlChar DT_ui2[]
Definition: schema.c:157
static HRESULT WINAPI schema_cache_GetTypeInfo(IXMLDOMSchemaCollection2 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: schema.c:1160
static HRESULT WINAPI schema_cache_remove(IXMLDOMSchemaCollection2 *iface, BSTR uri)
Definition: schema.c:1338
static cache_entry * get_entry(schema_cache *This, xmlChar const *nsURI)
Definition: schema.c:677
XDR_DT bstr_to_dt(OLECHAR const *bstr, int len)
Definition: schema.c:555
void schemasCleanup(void)
Definition: schema.c:748
static const OLECHAR wDT_number[]
Definition: schema.c:187
static int cache_free_uri(schema_cache *cache, const xmlChar *uri)
Definition: schema.c:974
static LONG cache_entry_release(cache_entry *entry)
Definition: schema.c:762
static const OLECHAR wDT_ui2[]
Definition: schema.c:194
static HRESULT WINAPI schema_cache_get_namespaceURI(IXMLDOMSchemaCollection2 *iface, LONG index, BSTR *uri)
Definition: schema.c:1365
static HRESULT WINAPI schema_cache_GetTypeInfoCount(IXMLDOMSchemaCollection2 *iface, UINT *pctinfo)
Definition: schema.c:1153
static const xmlChar XSD_schema[]
Definition: schema.c:59
static const xmlChar DT_nmtoken[]
Definition: schema.c:147
static void cache_copy(void *data, void *dest, const xmlChar *name)
Definition: schema.c:1385
static const OLECHAR wDT_r4[]
Definition: schema.c:188
static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2 *iface, BSTR uri, VARIANT var)
Definition: schema.c:1188
static const OLECHAR wDT_ui4[]
Definition: schema.c:195
static const xmlChar DT_ui4[]
Definition: schema.c:158
static HRESULT WINAPI schema_cache_get(IXMLDOMSchemaCollection2 *iface, BSTR uri, IXMLDOMNode **node)
Definition: schema.c:1307
static const OLECHAR wDT_entities[]
Definition: schema.c:172
static const xmlChar DT_boolean[]
Definition: schema.c:128
static const OLECHAR wDT_date[]
Definition: schema.c:167
XDR_DT SchemaCache_get_node_dt(IXMLDOMSchemaCollection2 *iface, xmlNodePtr node)
Definition: schema.c:1561
xmlChar const * dt_to_str(XDR_DT dt)
Definition: schema.c:569
static const OLECHAR wDT_i4[]
Definition: schema.c:178
static const xmlChar DT_dateTime_tz[]
Definition: schema.c:133
static const tid_t schema_cache_se_tids[]
Definition: schema.c:113
static xmlSchemaElementPtr lookup_schema_elemDecl(xmlSchemaPtr schema, xmlNodePtr node)
Definition: schema.c:1503
static void LIBXML2_LOG_CALLBACK validate_warning(void *ctx, char const *msg,...)
Definition: schema.c:268
static xmlSchemaPtr Schema_parse(xmlSchemaParserCtxtPtr spctx)
Definition: schema.c:251
static HRESULT schema_cache_get_item(IUnknown *iface, LONG index, VARIANT *item)
Definition: schema.c:281
static const OLECHAR wDT_int[]
Definition: schema.c:183
static cache_entry * cache_entry_from_xsd_doc(xmlDocPtr doc, xmlChar const *nsURI, MSXML_VERSION v)
Definition: schema.c:855
static const OLECHAR wDT_fixed_14_4[]
Definition: schema.c:174
static xmlSchemaPtr datatypes_schema
Definition: schema.c:69
static const xmlChar DT_uri[]
Definition: schema.c:160
static LONG cache_entry_add_ref(cache_entry *entry)
Definition: schema.c:755
static int datatypes_len
Definition: schema.c:66
static const OLECHAR wDT_i8[]
Definition: schema.c:179
static HRESULT WINAPI schema_cache_GetIDsOfNames(IXMLDOMSchemaCollection2 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: schema.c:1168
static dispex_static_data_t schemacache_dispex
Definition: schema.c:1594
static const OLECHAR wDT_ui1[]
Definition: schema.c:193
static const OLECHAR wDT_r8[]
Definition: schema.c:189
static const xmlChar DT_bin_base64[]
Definition: schema.c:126
static const xmlChar DT_dateTime[]
Definition: schema.c:132
static const xmlChar DT_number[]
Definition: schema.c:150
static const xmlChar DT_ui1[]
Definition: schema.c:156
static const BYTE hash_assoc_values[]
Definition: schema.c:200
static const tid_t schemacache_iface_tids[]
Definition: schema.c:1589
HRESULT SchemaCache_create(MSXML_VERSION version, void **obj)
Definition: schema.c:1601
static const xmlChar *const DT_string_table[LAST_DT]
Definition: schema.c:399
static const xmlChar DT_fixed_14_4[]
Definition: schema.c:137
static xmlParserInputPtr external_entity_loader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt)
Definition: schema.c:691
static const xmlChar DT_i4[]
Definition: schema.c:141
static HRESULT WINAPI schema_cache_get__newEnum(IXMLDOMSchemaCollection2 *iface, IUnknown **enumv)
Definition: schema.c:1421
static BOOL link_datatypes(xmlDocPtr schema)
Definition: schema.c:827
static HRESULT WINAPI schema_cache_get_validateOnLoad(IXMLDOMSchemaCollection2 *iface, VARIANT_BOOL *value)
Definition: schema.c:1448
static const OLECHAR wDT_float[]
Definition: schema.c:175
static schema_cache * unsafe_impl_from_IXMLDOMSchemaCollection(IXMLDOMSchemaCollection *iface)
Definition: schema.c:800
static const xmlChar DT_idref[]
Definition: schema.c:144
static const OLECHAR wDT_char[]
Definition: schema.c:166
static const OLECHAR wDT_dateTime_tz[]
Definition: schema.c:170
static const WCHAR *const DT_wstring_table[LAST_DT]
Definition: schema.c:439
static const xmlChar DT_r4[]
Definition: schema.c:151
static const OLECHAR wDT_boolean[]
Definition: schema.c:165
static const OLECHAR wDT_dateTime[]
Definition: schema.c:169
void schemasInit(void)
Definition: schema.c:717
static const xmlChar XSD_nsURI[]
Definition: schema.c:60
#define DT_MAX_HASH_VALUE
Definition: schema.c:124
static const OLECHAR wDT_time_tz[]
Definition: schema.c:192
xmlDocPtr XDR_to_XSD_doc(xmlDocPtr xdr_doc, xmlChar const *nsURI)
Definition: xdr.c:810
static xmlExternalEntityLoader _external_entity_loader
Definition: schema.c:689
static xmlChar const * get_node_nsURI(xmlNodePtr node)
Definition: schema.c:672
static schema_cache * impl_from_IXMLDOMSchemaCollection2(IXMLDOMSchemaCollection2 *iface)
Definition: schema.c:790
static DWORD dt_hash(xmlChar const *str, int len)
Definition: schema.c:313
static ULONG WINAPI schema_cache_AddRef(IXMLDOMSchemaCollection2 *iface)
Definition: schema.c:1125
static const OLECHAR wDT_string[]
Definition: schema.c:190
static const xmlChar DT_entities[]
Definition: schema.c:135
static const OLECHAR wDT_i1[]
Definition: schema.c:176
#define DEFAULT_HASHTABLE_SIZE
Definition: schema.c:55
static const xmlChar DT_i1[]
Definition: schema.c:139
static const XDR_DT DT_lookup_table[]
Definition: schema.c:479
static const OLECHAR wDT_i2[]
Definition: schema.c:177
static HRESULT WINAPI schema_cache_getSchema(IXMLDOMSchemaCollection2 *iface, BSTR namespaceURI, ISchema **schema)
Definition: schema.c:1460
static xmlNodePtr lookup_schema_element(xmlSchemaPtr schema, xmlNodePtr node)
Definition: schema.c:1529
static const xmlChar XDR_nsURI[]
Definition: schema.c:62
static const xmlChar DT_int[]
Definition: schema.c:146
static const xmlChar DT_char[]
Definition: schema.c:129
static const xmlChar XDR_schema[]
Definition: schema.c:61
static void cache_free(void *data, const xmlChar *name)
Definition: schema.c:968
HRESULT cache_from_doc_ns(IXMLDOMSchemaCollection2 *iface, xmlnode *node)
Definition: schema.c:1028
static void LIBXML2_LOG_CALLBACK parser_error(void *ctx, char const *msg,...)
Definition: schema.c:230
HRESULT SchemaCache_validate_tree(IXMLDOMSchemaCollection2 *iface, xmlNodePtr tree)
Definition: schema.c:1537
static const WCHAR emptyW[]
Definition: schema.c:71
static const OLECHAR wDT_time[]
Definition: schema.c:191
static ULONG WINAPI schema_cache_Release(IXMLDOMSchemaCollection2 *iface)
Definition: schema.c:1133
static const struct enumvariant_funcs schemacache_enumvariant
Definition: schema.c:287
static void validate_serror(void *ctx, const xmlError *err)
Definition: schema.c:276
static xmlSchemaPtr get_node_schema(schema_cache *This, xmlNodePtr node)
Definition: schema.c:683
static const xmlChar DT_nsURI[]
Definition: schema.c:63
static const xmlChar DT_id[]
Definition: schema.c:143
static const OLECHAR wDT_bin_hex[]
Definition: schema.c:164
static void cache_add_entry(schema_cache *cache, const xmlChar *uri, cache_entry *entry)
Definition: schema.c:988
static CacheEntryType cache_type_from_xmlDocPtr(xmlDocPtr schema)
Definition: schema.c:805
static const OLECHAR wDT_idref[]
Definition: schema.c:181
static const xmlChar DT_i2[]
Definition: schema.c:140
XDR_DT str_to_dt(xmlChar const *str, int len)
Definition: schema.c:541
static schema_cache * impl_from_IXMLDOMSchemaCollection(IXMLDOMSchemaCollection *iface)
Definition: schema.c:795
static void LIBXML2_LOG_CALLBACK validate_error(void *ctx, char const *msg,...)
Definition: schema.c:260
static cache_entry * cache_entry_from_url(VARIANT url, xmlChar const *nsURI, MSXML_VERSION version)
Definition: schema.c:919
static void parser_serror(void *ctx, const xmlError *err)
Definition: schema.c:246
static const xmlChar DT_float[]
Definition: schema.c:138
static HRESULT WINAPI schema_cache_getDeclaration(IXMLDOMSchemaCollection2 *iface, IXMLDOMNode *node, ISchemaItem **item)
Definition: schema.c:1470
static HGLOBAL datatypes_handle
Definition: schema.c:67
static const xmlChar DT_date_tz[]
Definition: schema.c:131
static const xmlChar DT_string[]
Definition: schema.c:153
static const xmlChar DT_uuid[]
Definition: schema.c:161
static HRESULT Schema_validate_tree(xmlSchemaPtr schema, xmlNodePtr tree)
Definition: schema.c:292
static const OLECHAR wDT_uuid[]
Definition: schema.c:198
static const xmlChar DT_notation[]
Definition: schema.c:149
static void cache_remove_entry(schema_cache *cache, const xmlChar *uri)
Definition: schema.c:1009
static const xmlChar DT_time[]
Definition: schema.c:154
static DWORD dt_hash_bstr(OLECHAR const *bstr, int len)
Definition: schema.c:356
static const xmlChar DT_bin_hex[]
Definition: schema.c:127
static HRESULT WINAPI schema_cache_validate(IXMLDOMSchemaCollection2 *iface)
Definition: schema.c:1428
static const OLECHAR wDT_notation[]
Definition: schema.c:186
HRESULT dt_validate(XDR_DT dt, xmlChar const *content)
Definition: schema.c:590
const char * debugstr_dt(XDR_DT dt)
Definition: schema.c:585
static xmlChar * datatypes_src
Definition: schema.c:65
static const OLECHAR wDT_uri[]
Definition: schema.c:197
static const xmlChar DT_time_tz[]
Definition: schema.c:155
static const xmlChar DT_ui8[]
Definition: schema.c:159
static cache_entry * cache_entry_from_xdr_doc(xmlDocPtr doc, xmlChar const *nsURI, MSXML_VERSION version)
Definition: schema.c:886
static const OLECHAR wDT_enumeration[]
Definition: schema.c:173
static HRSRC datatypes_rsrc
Definition: schema.c:68
static HRESULT WINAPI schema_cache_put_validateOnLoad(IXMLDOMSchemaCollection2 *iface, VARIANT_BOOL value)
Definition: schema.c:1435
static void LIBXML2_LOG_CALLBACK parser_warning(void *ctx, char const *msg,...)
Definition: schema.c:238
static const xmlChar DT_r8[]
Definition: schema.c:152
static const xmlChar DT_entity[]
Definition: schema.c:134
OLECHAR const * dt_to_bstr(XDR_DT dt)
Definition: schema.c:577
static const OLECHAR wDT_nmtokens[]
Definition: schema.c:185
static HRESULT WINAPI schema_cache_get_length(IXMLDOMSchemaCollection2 *iface, LONG *length)
Definition: schema.c:1353
static const xmlChar DT_enumeration[]
Definition: schema.c:136
static const xmlChar DT_date[]
Definition: schema.c:130
static const OLECHAR wDT_ui8[]
Definition: schema.c:196
static HRESULT WINAPI schema_cache_Invoke(IXMLDOMSchemaCollection2 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: schema.c:1177
static const OLECHAR wDT_date_tz[]
Definition: schema.c:168
static HRESULT WINAPI schema_cache_addCollection(IXMLDOMSchemaCollection2 *iface, IXMLDOMSchemaCollection *collection)
Definition: schema.c:1397
static const xmlChar DT_idrefs[]
Definition: schema.c:145
CacheEntryType
Definition: schema.c:82
@ CacheEntryType_Invalid
Definition: schema.c:83
@ CacheEntryType_XDR
Definition: schema.c:84
@ CacheEntryType_XSD
Definition: schema.c:85
@ CacheEntryType_NS
Definition: schema.c:86
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
const GLdouble * v
Definition: gl.h:2040
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint index
Definition: glext.h:6031
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLenum GLsizei len
Definition: glext.h:6722
GLenum GLenum GLenum input
Definition: glext.h:9031
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
tid_t
Definition: ieframe.h:311
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
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 b
Definition: ke_i.h:79
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
const WCHAR * schema
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static const WCHAR url[]
Definition: encode.c:1384
const char * var
Definition: shader.c:5666
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 ICollection collection
Definition: typelib.c:184
static VARIANTARG static DISPID
Definition: ordinal.c:49
const char * uri
Definition: sec_mgr.c:1588
static HWND child
Definition: cursoricon.c:298
BOOL dispex_query_interface(DispatchEx *This, REFIID riid, void **ppv)
Definition: dispex.c:1656
GUID CLSID_XMLSchemaCache60
enum tagDOMNodeType DOMNodeType
@ NODE_ELEMENT
Definition: msxml6.idl:113
MSXML_VERSION
Definition: msxml_dispex.h:27
@ MSXML6
Definition: msxml_dispex.h:33
@ IXMLDOMSchemaCollection2_tid
Definition: msxml_dispex.h:56
@ NULL_tid
Definition: msxml_dispex.h:38
@ IXMLDOMSchemaCollection_tid
Definition: msxml_dispex.h:55
#define LIBXML2_LOG_CALLBACK
xmlNodePtr xmlNodePtr_from_domnode(IXMLDOMNode *iface, xmlElementType type)
Definition: node.c:52
static BSTR bstr_from_xmlChar(const xmlChar *str)
#define LIBXML2_CALLBACK_ERR(caller, msg, ap)
HRESULT create_enumvariant(IUnknown *, BOOL, const struct enumvariant_funcs *, IEnumVARIANT **)
Definition: selection.c:565
#define LIBXML2_CALLBACK_WARN(caller, msg, ap)
static xmlChar * xmlchar_from_wchar(const WCHAR *str)
enum _XDR_DT XDR_DT
#define LIBXML2_CALLBACK_SERROR(caller, err)
static xmlChar * strdupxmlChar(const xmlChar *str)
@ DT_I4
Definition: msxml_private.h:57
@ DT_NMTOKEN
Definition: msxml_private.h:63
@ DT_ID
Definition: msxml_private.h:59
@ DT_TIME_TZ
Definition: msxml_private.h:71
@ DT_NUMBER
Definition: msxml_private.h:66
@ DT_FIXED_14_4
Definition: msxml_private.h:53
@ DT_NMTOKENS
Definition: msxml_private.h:64
@ DT_URI
Definition: msxml_private.h:76
@ DT_DATE_TZ
Definition: msxml_private.h:47
@ DT_INVALID
Definition: msxml_private.h:41
@ DT_UI4
Definition: msxml_private.h:74
@ DT_R8
Definition: msxml_private.h:68
@ DT_DATETIME_TZ
Definition: msxml_private.h:49
@ DT_ENTITIES
Definition: msxml_private.h:51
@ DT_FLOAT
Definition: msxml_private.h:54
@ DT_DATETIME
Definition: msxml_private.h:48
@ DT_BIN_HEX
Definition: msxml_private.h:43
@ DT_I1
Definition: msxml_private.h:55
@ DT_UI8
Definition: msxml_private.h:75
@ DT_DATE
Definition: msxml_private.h:46
@ LAST_DT
Definition: msxml_private.h:78
@ DT_UI2
Definition: msxml_private.h:73
@ DT_BIN_BASE64
Definition: msxml_private.h:42
@ DT_I2
Definition: msxml_private.h:56
@ DT_ENTITY
Definition: msxml_private.h:50
@ DT_ENUMERATION
Definition: msxml_private.h:52
@ DT_IDREF
Definition: msxml_private.h:60
@ DT_R4
Definition: msxml_private.h:67
@ DT_UI1
Definition: msxml_private.h:72
@ DT_BOOLEAN
Definition: msxml_private.h:44
@ DT_CHAR
Definition: msxml_private.h:45
@ DT_TIME
Definition: msxml_private.h:70
@ DT_IDREFS
Definition: msxml_private.h:61
@ DT_NOTATION
Definition: msxml_private.h:65
@ DT_I8
Definition: msxml_private.h:58
@ DT_INT
Definition: msxml_private.h:62
@ DT_UUID
Definition: msxml_private.h:77
HRESULT node_create_supporterrorinfo(const tid_t *, void **)
unsigned int UINT
Definition: ndis.h:50
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#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
XMLPUBFUN xmlParserInputPtr xmlNewStringInputStream(xmlParserCtxtPtr ctxt, const xmlChar *buffer)
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
static unsigned __int64 next
Definition: rand_nt.c:6
#define err(...)
const WCHAR * str
#define ID
Definition: ruserpass.c:36
DWORD LCID
Definition: nls.h:13
xmlFreeFunc xmlFree
Definition: globals.c:184
void xmlHashScan(xmlHashTablePtr hash, xmlHashScanner scan, void *data)
Definition: hash.c:898
void xmlHashFree(xmlHashTablePtr hash, xmlHashDeallocator dealloc)
Definition: hash.c:229
void * xmlHashLookup(xmlHashTablePtr hash, const xmlChar *key)
Definition: hash.c:739
int xmlHashRemoveEntry(xmlHashTablePtr hash, const xmlChar *key, xmlHashDeallocator dealloc)
Definition: hash.c:1102
int xmlHashSize(xmlHashTablePtr hash)
Definition: hash.c:1085
int xmlHashAddEntry(xmlHashTablePtr hash, const xmlChar *key, void *payload)
Definition: hash.c:621
xmlHashTablePtr xmlHashCreate(int size)
Definition: hash.c:160
XMLPUBFUN xmlExternalEntityLoader xmlGetExternalEntityLoader(void)
XMLPUBFUN void xmlSetExternalEntityLoader(xmlExternalEntityLoader f)
xmlParserInputPtr(* xmlExternalEntityLoader)(const char *URL, const char *ID, xmlParserCtxtPtr context)
Definition: parser.h:837
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
Definition: svc_auth_des.c:77
LONG ref
Definition: schema.c:110
CacheEntryType type
Definition: schema.c:107
xmlDocPtr doc
Definition: schema.c:109
xmlSchemaPtr schema
Definition: schema.c:108
Definition: cache.c:49
Definition: domdoc.c:111
Definition: _hash_fun.h:40
Definition: name.c:39
Definition: mxnamespace.c:38
Definition: send.c:48
MSXML_VERSION version
Definition: schema.c:95
VARIANT_BOOL validateOnLoad
Definition: schema.c:101
int count
Definition: schema.c:99
int allocated
Definition: schema.c:98
DispatchEx dispex
Definition: schema.c:91
xmlChar ** uris
Definition: schema.c:97
xmlHashTablePtr cache
Definition: schema.c:96
IXMLDOMSchemaCollection2 IXMLDOMSchemaCollection2_iface
Definition: schema.c:92
LONG ref
Definition: schema.c:93
int read_only
Definition: schema.c:102
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
Definition: dlist.c:348
Definition: pdh_main.c:96
WINBASEAPI _In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon_undoc.h:337
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:3451
#define E_NOINTERFACE
Definition: winerror.h:3479
#define E_POINTER
Definition: winerror.h:3480
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36
__wchar_t WCHAR
Definition: xmlstorage.h:180
XMLPUBFUN int xmlStrlen(const xmlChar *str)
Definition: xmlstring.c:428
XMLPUBFUN int xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:277
#define BAD_CAST
Definition: xmlstring.h:35
XMLPUBFUN int xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:162
unsigned char xmlChar
Definition: xmlstring.h:28
#define LIBXML_DOTTED_VERSION
Definition: xmlversion.h:32
unsigned char BYTE
Definition: xxhash.c:193