d3d11/tests: Add test for shaders interstage interface.
[wine.git] / dlls / webservices / string.c
blob45a5512f6b77652873559f2eeb2595ce3bf7d8b3
1 /*
2 * Copyright 2015-2017 Hans Leidekker for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include <stdarg.h>
20 #include <assert.h>
22 #include "windef.h"
23 #include "winbase.h"
24 #include "webservices.h"
26 #include "wine/debug.h"
27 #include "wine/list.h"
28 #include "webservices_private.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(webservices);
32 const char *debugstr_xmlstr( const WS_XML_STRING *str )
34 if (!str) return "(null)";
35 return debugstr_an( (const char *)str->bytes, str->length );
38 static CRITICAL_SECTION dict_cs;
39 static CRITICAL_SECTION_DEBUG dict_cs_debug =
41 0, 0, &dict_cs,
42 { &dict_cs_debug.ProcessLocksList,
43 &dict_cs_debug.ProcessLocksList},
44 0, 0, {(DWORD_PTR)(__FILE__ ": dict_cs") }
46 static CRITICAL_SECTION dict_cs = { &dict_cs_debug, -1, 0, 0, 0, 0 };
48 struct dictionary dict_builtin =
50 {{0x82704485,0x222a,0x4f7c,{0xb9,0x7b,0xe9,0xa4,0x62,0xa9,0x66,0x2b}}}
53 static inline int cmp_string( const unsigned char *str, ULONG len, const unsigned char *str2, ULONG len2 )
55 if (len < len2) return -1;
56 else if (len > len2) return 1;
57 while (len--)
59 if (*str == *str2) { str++; str2++; }
60 else return *str - *str2;
62 return 0;
65 /* return -1 and string id if found, sort index if not found */
66 int find_string( const struct dictionary *dict, const unsigned char *data, ULONG len, ULONG *id )
68 int i, c, min = 0, max = dict->dict.stringCount - 1;
69 const WS_XML_STRING *strings = dict->dict.strings;
70 while (min <= max)
72 i = (min + max) / 2;
73 c = cmp_string( data, len, strings[dict->sorted[i]].bytes, strings[dict->sorted[i]].length );
74 if (c < 0)
75 max = i - 1;
76 else if (c > 0)
77 min = i + 1;
78 else
80 if (id) *id = strings[dict->sorted[i]].id;
81 return -1;
84 return max + 1;
87 #define MIN_DICTIONARY_SIZE 256
88 #define MAX_DICTIONARY_SIZE 2048
90 static HRESULT grow_dict( struct dictionary *dict, ULONG size )
92 WS_XML_STRING *tmp;
93 ULONG new_size, *tmp_sorted;
95 assert( !dict->dict.isConst );
96 if (dict->size >= dict->dict.stringCount + size) return S_OK;
97 if (dict->size + size > MAX_DICTIONARY_SIZE) return WS_E_QUOTA_EXCEEDED;
99 if (!dict->dict.strings)
101 new_size = max( MIN_DICTIONARY_SIZE, size );
102 if (!(dict->dict.strings = heap_alloc( new_size * sizeof(*dict->dict.strings) ))) return E_OUTOFMEMORY;
103 if (!(dict->sorted = heap_alloc( new_size * sizeof(*dict->sorted) )))
105 heap_free( dict->dict.strings );
106 dict->dict.strings = NULL;
107 return E_OUTOFMEMORY;
109 dict->size = new_size;
110 return S_OK;
113 new_size = max( dict->size * 2, size );
114 if (!(tmp = heap_realloc( dict->dict.strings, new_size * sizeof(*tmp) ))) return E_OUTOFMEMORY;
115 dict->dict.strings = tmp;
116 if (!(tmp_sorted = heap_realloc( dict->sorted, new_size * sizeof(*tmp_sorted) ))) return E_OUTOFMEMORY;
117 dict->sorted = tmp_sorted;
119 dict->size = new_size;
120 return S_OK;
123 void clear_dict( struct dictionary *dict )
125 ULONG i;
126 assert( !dict->dict.isConst );
127 for (i = 0; i < dict->dict.stringCount; i++) heap_free( dict->dict.strings[i].bytes );
128 heap_free( dict->dict.strings );
129 dict->dict.strings = NULL;
130 dict->dict.stringCount = 0;
131 heap_free( dict->sorted );
132 dict->sorted = NULL;
133 dict->size = 0;
136 HRESULT insert_string( struct dictionary *dict, unsigned char *data, ULONG len, int i, ULONG *ret_id )
138 ULONG id = dict->dict.stringCount;
139 HRESULT hr;
141 assert( !dict->dict.isConst );
142 if ((hr = grow_dict( dict, 1 )) != S_OK) return hr;
143 memmove( &dict->sorted[i] + 1, &dict->sorted[i], (dict->dict.stringCount - i) * sizeof(*dict->sorted) );
144 dict->sorted[i] = id;
146 dict->dict.strings[id].length = len;
147 dict->dict.strings[id].bytes = data;
148 dict->dict.strings[id].dictionary = &dict->dict;
149 dict->dict.strings[id].id = id;
150 dict->dict.stringCount++;
151 if (ret_id) *ret_id = id;
152 return S_OK;
155 HRESULT add_xml_string( WS_XML_STRING *str )
157 HRESULT hr = S_OK;
158 int index;
159 ULONG id;
161 if (str->dictionary) return S_OK;
162 EnterCriticalSection( &dict_cs );
163 if ((index = find_string( &dict_builtin, str->bytes, str->length, &id )) == -1)
165 heap_free( str->bytes );
166 *str = dict_builtin.dict.strings[id];
168 else if ((hr = insert_string( &dict_builtin, str->bytes, str->length, index, &id )) == S_OK)
170 *str = dict_builtin.dict.strings[id];
172 LeaveCriticalSection( &dict_cs );
173 return hr;
176 WS_XML_STRING *alloc_xml_string( const unsigned char *data, ULONG len )
178 WS_XML_STRING *ret;
180 if (!(ret = heap_alloc_zero( sizeof(*ret) ))) return NULL;
181 if ((ret->length = len) && !(ret->bytes = heap_alloc( len )))
183 heap_free( ret );
184 return NULL;
186 if (data)
188 memcpy( ret->bytes, data, len );
189 if (add_xml_string( ret ) != S_OK) WARN( "string not added to dictionary\n" );
191 return ret;
194 void free_xml_string( WS_XML_STRING *str )
196 if (!str) return;
197 if (!str->dictionary) heap_free( str->bytes );
198 heap_free( str );
201 WS_XML_STRING *dup_xml_string( const WS_XML_STRING *src, BOOL use_static_dict )
203 WS_XML_STRING *ret;
204 unsigned char *data;
205 HRESULT hr;
206 int index;
207 ULONG id;
209 if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
210 if (src->dictionary)
212 *ret = *src;
213 return ret;
215 if (use_static_dict && (index = find_string( &dict_builtin_static, src->bytes, src->length, &id )) == -1)
217 *ret = dict_builtin_static.dict.strings[id];
218 return ret;
220 EnterCriticalSection( &dict_cs );
221 if ((index = find_string( &dict_builtin, src->bytes, src->length, &id )) == -1)
223 *ret = dict_builtin.dict.strings[id];
224 LeaveCriticalSection( &dict_cs );
225 return ret;
227 if (!(data = heap_alloc( src->length )))
229 heap_free( ret );
230 LeaveCriticalSection( &dict_cs );
231 return NULL;
233 memcpy( data, src->bytes, src->length );
234 if ((hr = insert_string( &dict_builtin, data, src->length, index, &id )) == S_OK)
236 *ret = dict_builtin.dict.strings[id];
237 LeaveCriticalSection( &dict_cs );
238 return ret;
240 LeaveCriticalSection( &dict_cs );
242 WARN( "string not added to dictionary\n" );
243 ret->length = src->length;
244 ret->bytes = data;
245 ret->dictionary = NULL;
246 ret->id = 0;
247 return ret;
250 const struct dictionary dict_builtin_static;
251 static const WS_XML_STRING dict_strings[] =
253 #define X(str, id) { sizeof(str) - 1, (BYTE *)(str), (WS_XML_DICTIONARY *)&dict_builtin_static.dict, id },
254 X("mustUnderstand", 0)
255 X("Envelope", 1)
256 X("http://www.w3.org/2003/05/soap-envelope", 2)
257 X("http://www.w3.org/2005/08/addressing", 3)
258 X("Header", 4)
259 X("Action", 5)
260 X("To", 6)
261 X("Body", 7)
262 X("Algorithm", 8)
263 X("RelatesTo", 9)
264 X("http://www.w3.org/2005/08/addressing/anonymous", 10)
265 X("URI", 11)
266 X("Reference", 12)
267 X("MessageID", 13)
268 X("Id", 14)
269 X("Identifier", 15)
270 X("http://schemas.xmlsoap.org/ws/2005/02/rm", 16)
271 X("Transforms", 17)
272 X("Transform", 18)
273 X("DigestMethod", 19)
274 X("DigestValue", 20)
275 X("Address", 21)
276 X("ReplyTo", 22)
277 X("SequenceAcknowledgement", 23)
278 X("AcknowledgementRange", 24)
279 X("Upper", 25)
280 X("Lower", 26)
281 X("BufferRemaining", 27)
282 X("http://schemas.microsoft.com/ws/2006/05/rm", 28)
283 X("http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement", 29)
284 X("SecurityTokenReference", 30)
285 X("Sequence", 31)
286 X("MessageNumber", 32)
287 X("http://www.w3.org/2000/09/xmldsig#", 33)
288 X("http://www.w3.org/2000/09/xmldsig#enveloped-signature", 34)
289 X("KeyInfo", 35)
290 X("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", 36)
291 X("http://www.w3.org/2001/04/xmlenc#", 37)
292 X("http://schemas.xmlsoap.org/ws/2005/02/sc", 38)
293 X("DerivedKeyToken", 39)
294 X("Nonce", 40)
295 X("Signature", 41)
296 X("SignedInfo", 42)
297 X("CanonicalizationMethod", 43)
298 X("SignatureMethod", 44)
299 X("SignatureValue", 45)
300 X("DataReference", 46)
301 X("EncryptedData", 47)
302 X("EncryptionMethod", 48)
303 X("CipherData", 49)
304 X("CipherValue", 50)
305 X("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", 51)
306 X("Security", 52)
307 X("Timestamp", 53)
308 X("Created", 54)
309 X("Expires", 55)
310 X("Length", 56)
311 X("ReferenceList", 57)
312 X("ValueType", 58)
313 X("Type", 59)
314 X("EncryptedHeader", 60)
315 X("http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd", 61)
316 X("RequestSecurityTokenResponseCollection", 62)
317 X("http://schemas.xmlsoap.org/ws/2005/02/trust", 63)
318 X("http://schemas.xmlsoap.org/ws/2005/02/trust#BinarySecret", 64)
319 X("http://schemas.microsoft.com/ws/2006/02/transactions", 65)
320 X("s", 66)
321 X("Fault", 67)
322 X("MustUnderstand", 68)
323 X("role", 69)
324 X("relay", 70)
325 X("Code", 71)
326 X("Reason", 72)
327 X("Text", 73)
328 X("Node", 74)
329 X("Role", 75)
330 X("Detail", 76)
331 X("Value", 77)
332 X("Subcode", 78)
333 X("NotUnderstood", 79)
334 X("qname", 80)
335 X("", 81)
336 X("From", 82)
337 X("FaultTo", 83)
338 X("EndpointReference", 84)
339 X("PortType", 85)
340 X("ServiceName", 86)
341 X("PortName", 87)
342 X("ReferenceProperties", 88)
343 X("RelationshipType", 89)
344 X("Reply", 90)
345 X("a", 91)
346 X("http://schemas.xmlsoap.org/ws/2006/02/addressingidentity", 92)
347 X("Identity", 93)
348 X("Spn", 94)
349 X("Upn", 95)
350 X("Rsa", 96)
351 X("Dns", 97)
352 X("X509v3Certificate", 98)
353 X("http://www.w3.org/2005/08/addressing/fault", 99)
354 X("ReferenceParameters", 100)
355 X("IsReferenceParameter", 101)
356 X("http://www.w3.org/2005/08/addressing/reply", 102)
357 X("http://www.w3.org/2005/08/addressing/none", 103)
358 X("Metadata", 104)
359 X("http://schemas.xmlsoap.org/ws/2004/08/addressing", 105)
360 X("http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous", 106)
361 X("http://schemas.xmlsoap.org/ws/2004/08/addressing/fault", 107)
362 X("http://schemas.xmlsoap.org/ws/2004/06/addressingex", 108)
363 X("RedirectTo", 109)
364 X("Via", 110)
365 X("http://www.w3.org/2001/10/xml-exc-c14n#", 111)
366 X("PrefixList", 112)
367 X("InclusiveNamespaces", 113)
368 X("ec", 114)
369 X("SecurityContextToken", 115)
370 X("Generation", 116)
371 X("Label", 117)
372 X("Offset", 118)
373 X("Properties", 119)
374 X("Cookie", 120)
375 X("wsc", 121)
376 X("http://schemas.xmlsoap.org/ws/2004/04/sc", 122)
377 X("http://schemas.xmlsoap.org/ws/2004/04/security/sc/dk", 123)
378 X("http://schemas.xmlsoap.org/ws/2004/04/security/sc/sct", 124)
379 X("http://schemas.xmlsoap.org/ws/2004/04/security/trust/RST/SCT", 125)
380 X("http://schemas.xmlsoap.org/ws/2004/04/security/trust/RSTR/SCT", 126)
381 X("RenewNeeded", 127)
382 X("BadContextToken", 128)
383 X("c", 129)
384 X("http://schemas.xmlsoap.org/ws/2005/02/sc/dk", 130)
385 X("http://schemas.xmlsoap.org/ws/2005/02/sc/sct", 131)
386 X("http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT", 132)
387 X("http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/SCT", 133)
388 X("http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT/Renew", 134)
389 X("http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/SCT/Renew", 135)
390 X("http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT/Cancel", 136)
391 X("http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/SCT/Cancel", 137)
392 X("http://www.w3.org/2001/04/xmlenc#aes128-cbc", 138)
393 X("http://www.w3.org/2001/04/xmlenc#kw-aes128", 139)
394 X("http://www.w3.org/2001/04/xmlenc#aes192-cbc", 140)
395 X("http://www.w3.org/2001/04/xmlenc#kw-aes192", 141)
396 X("http://www.w3.org/2001/04/xmlenc#aes256-cbc", 142)
397 X("http://www.w3.org/2001/04/xmlenc#kw-aes256", 143)
398 X("http://www.w3.org/2001/04/xmlenc#des-cbc", 144)
399 X("http://www.w3.org/2000/09/xmldsig#dsa-sha1", 145)
400 X("http://www.w3.org/2001/10/xml-exc-c14n#WithComments", 146)
401 X("http://www.w3.org/2000/09/xmldsig#hmac-sha1", 147)
402 X("http://www.w3.org/2001/04/xmldsig-more#hmac-sha256", 148)
403 X("http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1", 149)
404 X("http://www.w3.org/2001/04/xmlenc#ripemd160", 150)
405 X("http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p", 151)
406 X("http://www.w3.org/2000/09/xmldsig#rsa-sha1", 152)
407 X("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", 153)
408 X("http://www.w3.org/2001/04/xmlenc#rsa-1_5", 154)
409 X("http://www.w3.org/2000/09/xmldsig#sha1", 155)
410 X("http://www.w3.org/2001/04/xmlenc#sha256", 156)
411 X("http://www.w3.org/2001/04/xmlenc#sha512", 157)
412 X("http://www.w3.org/2001/04/xmlenc#tripledes-cbc", 158)
413 X("http://www.w3.org/2001/04/xmlenc#kw-tripledes", 159)
414 X("http://schemas.xmlsoap.org/2005/02/trust/tlsnego#TLS_Wrap", 160)
415 X("http://schemas.xmlsoap.org/2005/02/trust/spnego#GSS_Wrap", 161)
416 X("http://schemas.microsoft.com/ws/2006/05/security", 162)
417 X("dnse", 163)
418 X("o", 164)
419 X("Password", 165)
420 X("PasswordText", 166)
421 X("Username", 167)
422 X("UsernameToken", 168)
423 X("BinarySecurityToken", 169)
424 X("EncodingType", 170)
425 X("KeyIdentifier", 171)
426 X("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary", 172)
427 X("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#HexBinary", 173)
428 X("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Text", 174)
429 X("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier", 175)
430 X("http://docs.oasis-open.org/wss/oasis-wss-kerberos-token-profile-1.1#GSS_Kerberosv5_AP_REQ", 176)
431 X("http://docs.oasis-open.org/wss/oasis-wss-kerberos-token-profile-1.1#GSS_Kerberosv5_AP_REQ1510", 177)
432 X("http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0#SAMLAssertionID", 178)
433 X("Assertion", 179)
434 X("urn:oasis:names:tc:SAML:1.0:assertion", 180)
435 X("http://docs.oasis-open.org/wss/oasis-wss-rel-token-profile-1.0.pdf#license", 181)
436 X("FailedAuthentication", 182)
437 X("InvalidSecurityToken", 183)
438 X("InvalidSecurity", 184)
439 X("k", 185)
440 X("SignatureConfirmation", 186)
441 X("TokenType", 187)
442 X("http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1", 188)
443 X("http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey", 189)
444 X("http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKeySHA1", 190)
445 X("http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1", 191)
446 X("http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0", 192)
447 X("http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLID", 193)
448 X("AUTH-HASH", 194)
449 X("RequestSecurityTokenResponse", 195)
450 X("KeySize", 196)
451 X("RequestedTokenReference", 197)
452 X("AppliesTo", 198)
453 X("Authenticator", 199)
454 X("CombinedHash", 200)
455 X("BinaryExchange", 201)
456 X("Lifetime", 202)
457 X("RequestedSecurityToken", 203)
458 X("Entropy", 204)
459 X("RequestedProofToken", 205)
460 X("ComputedKey", 206)
461 X("RequestSecurityToken", 207)
462 X("RequestType", 208)
463 X("Context", 209)
464 X("BinarySecret", 210)
465 X("http://schemas.xmlsoap.org/ws/2005/02/trust/spnego", 211)
466 X("http://schemas.xmlsoap.org/ws/2005/02/trust/tlsnego", 212)
467 X("wst", 213)
468 X("http://schemas.xmlsoap.org/ws/2004/04/trust", 214)
469 X("http://schemas.xmlsoap.org/ws/2004/04/security/trust/RST/Issue", 215)
470 X("http://schemas.xmlsoap.org/ws/2004/04/security/trust/RSTR/Issue", 216)
471 X("http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue", 217)
472 X("http://schemas.xmlsoap.org/ws/2004/04/security/trust/CK/PSHA1", 218)
473 X("http://schemas.xmlsoap.org/ws/2004/04/security/trust/SymmetricKey", 219)
474 X("http://schemas.xmlsoap.org/ws/2004/04/security/trust/Nonce", 220)
475 X("KeyType", 221)
476 X("http://schemas.xmlsoap.org/ws/2004/04/trust/SymmetricKey", 222)
477 X("http://schemas.xmlsoap.org/ws/2004/04/trust/PublicKey", 223)
478 X("Claims", 224)
479 X("InvalidRequest", 225)
480 X("RequestFailed", 226)
481 X("SignWith", 227)
482 X("EncryptWith", 228)
483 X("EncryptionAlgorithm", 229)
484 X("CanonicalizationAlgorithm", 230)
485 X("ComputedKeyAlgorithm", 231)
486 X("UseKey", 232)
487 X("http://schemas.microsoft.com/net/2004/07/secext/WS-SPNego", 233)
488 X("http://schemas.microsoft.com/net/2004/07/secext/TLSNego", 234)
489 X("t", 235)
490 X("http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue", 236)
491 X("http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/Issue", 237)
492 X("http://schemas.xmlsoap.org/ws/2005/02/trust/Issue", 238)
493 X("http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey", 239)
494 X("http://schemas.xmlsoap.org/ws/2005/02/trust/CK/PSHA1", 240)
495 X("http://schemas.xmlsoap.org/ws/2005/02/trust/Nonce", 241)
496 X("RenewTarget", 242)
497 X("CancelTarget", 243)
498 X("RequestedTokenCancelled", 244)
499 X("RequestedAttachedReference", 245)
500 X("RequestedUnattachedReference", 246)
501 X("IssuedTokens", 247)
502 X("http://schemas.xmlsoap.org/ws/2005/02/trust/Renew", 248)
503 X("http://schemas.xmlsoap.org/ws/2005/02/trust/Cancel", 249)
504 X("http://schemas.xmlsoap.org/ws/2005/02/trust/PublicKey", 250)
505 X("Access", 251)
506 X("AccessDecision", 252)
507 X("Advice", 253)
508 X("AssertionID", 254)
509 X("AssertionIDReference", 255)
510 X("Attribute", 256)
511 X("AttributeName", 257)
512 X("AttributeNamespace", 258)
513 X("AttributeStatement", 259)
514 X("AttributeValue", 260)
515 X("Audience", 261)
516 X("AudienceRestrictionCondition", 262)
517 X("AuthenticationInstant", 263)
518 X("AuthenticationMethod", 264)
519 X("AuthenticationStatement", 265)
520 X("AuthorityBinding", 266)
521 X("AuthorityKind", 267)
522 X("AuthorizationDecisionStatement", 268)
523 X("Binding", 269)
524 X("Condition", 270)
525 X("Conditions", 271)
526 X("Decision", 272)
527 X("DoNotCacheCondition", 273)
528 X("Evidence", 274)
529 X("IssueInstant", 275)
530 X("Issuer", 276)
531 X("Location", 277)
532 X("MajorVersion", 278)
533 X("MinorVersion", 279)
534 X("NameIdentifier", 280)
535 X("Format", 281)
536 X("NameQualifier", 282)
537 X("Namespace", 283)
538 X("NotBefore", 284)
539 X("NotOnOrAfter", 285)
540 X("saml", 286)
541 X("Statement", 287)
542 X("Subject", 288)
543 X("SubjectConfirmation", 289)
544 X("SubjectConfirmationData", 290)
545 X("ConfirmationMethod", 291)
546 X("urn:oasis:names:tc:SAML:1.0:cm:holder-of-key", 292)
547 X("urn:oasis:names:tc:SAML:1.0:cm:sender-vouches", 293)
548 X("SubjectLocality", 294)
549 X("DNSAddress", 295)
550 X("IPAddress", 296)
551 X("SubjectStatement", 297)
552 X("urn:oasis:names:tc:SAML:1.0:am:unspecified", 298)
553 X("xmlns", 299)
554 X("Resource", 300)
555 X("UserName", 301)
556 X("urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName", 302)
557 X("EmailName", 303)
558 X("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", 304)
559 X("u", 305)
560 X("ChannelInstance", 306)
561 X("http://schemas.microsoft.com/ws/2005/02/duplex", 307)
562 X("Encoding", 308)
563 X("MimeType", 309)
564 X("CarriedKeyName", 310)
565 X("Recipient", 311)
566 X("EncryptedKey", 312)
567 X("KeyReference", 313)
568 X("e", 314)
569 X("http://www.w3.org/2001/04/xmlenc#Element", 315)
570 X("http://www.w3.org/2001/04/xmlenc#Content", 316)
571 X("KeyName", 317)
572 X("MgmtData", 318)
573 X("KeyValue", 319)
574 X("RSAKeyValue", 320)
575 X("Modulus", 321)
576 X("Exponent", 322)
577 X("X509Data", 323)
578 X("X509IssuerSerial", 324)
579 X("X509IssuerName", 325)
580 X("X509SerialNumber", 326)
581 X("X509Certificate", 327)
582 X("AckRequested", 328)
583 X("http://schemas.xmlsoap.org/ws/2005/02/rm/AckRequested", 329)
584 X("AcksTo", 330)
585 X("Accept", 331)
586 X("CreateSequence", 332)
587 X("http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence", 333)
588 X("CreateSequenceRefused", 334)
589 X("CreateSequenceResponse", 335)
590 X("http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequenceResponse", 336)
591 X("FaultCode", 337)
592 X("InvalidAcknowledgement", 338)
593 X("LastMessage", 339)
594 X("http://schemas.xmlsoap.org/ws/2005/02/rm/LastMessage", 340)
595 X("LastMessageNumberExceeded", 341)
596 X("MessageNumberRollover", 342)
597 X("Nack", 343)
598 X("netrm", 344)
599 X("Offer", 345)
600 X("r", 346)
601 X("SequenceFault", 347)
602 X("SequenceTerminated", 348)
603 X("TerminateSequence", 349)
604 X("http://schemas.xmlsoap.org/ws/2005/02/rm/TerminateSequence", 350)
605 X("UnknownSequence", 351)
606 X("http://schemas.microsoft.com/ws/2006/02/tx/oletx", 352)
607 X("oletx", 353)
608 X("OleTxTransaction", 354)
609 X("PropagationToken", 355)
610 X("http://schemas.xmlsoap.org/ws/2004/10/wscoor", 356)
611 X("wscoor", 357)
612 X("CreateCoordinationContext", 358)
613 X("CreateCoordinationContextResponse", 359)
614 X("CoordinationContext", 360)
615 X("CurrentContext", 361)
616 X("CoordinationType", 362)
617 X("RegistrationService", 363)
618 X("Register", 364)
619 X("RegisterResponse", 365)
620 X("ProtocolIdentifier", 366)
621 X("CoordinatorProtocolService", 367)
622 X("ParticipantProtocolService", 368)
623 X("http://schemas.xmlsoap.org/ws/2004/10/wscoor/CreateCoordinationContext", 369)
624 X("http://schemas.xmlsoap.org/ws/2004/10/wscoor/CreateCoordinationContextResponse", 370)
625 X("http://schemas.xmlsoap.org/ws/2004/10/wscoor/Register", 371)
626 X("http://schemas.xmlsoap.org/ws/2004/10/wscoor/RegisterResponse", 372)
627 X("http://schemas.xmlsoap.org/ws/2004/10/wscoor/fault", 373)
628 X("ActivationCoordinatorPortType", 374)
629 X("RegistrationCoordinatorPortType", 375)
630 X("InvalidState", 376)
631 X("InvalidProtocol", 377)
632 X("InvalidParameters", 378)
633 X("NoActivity", 379)
634 X("ContextRefused", 380)
635 X("AlreadyRegistered", 381)
636 X("http://schemas.xmlsoap.org/ws/2004/10/wsat", 382)
637 X("wsat", 383)
638 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Completion", 384)
639 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Durable2PC", 385)
640 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Volatile2PC", 386)
641 X("Prepare", 387)
642 X("Prepared", 388)
643 X("ReadOnly", 389)
644 X("Commit", 390)
645 X("Rollback", 391)
646 X("Committed", 392)
647 X("Aborted", 393)
648 X("Replay", 394)
649 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Commit", 395)
650 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Rollback", 396)
651 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Committed", 397)
652 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Aborted", 398)
653 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Prepare", 399)
654 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Prepared", 400)
655 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/ReadOnly", 401)
656 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Replay", 402)
657 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/fault", 403)
658 X("CompletionCoordinatorPortType", 404)
659 X("CompletionParticipantPortType", 405)
660 X("CoordinatorPortType", 406)
661 X("ParticipantPortType", 407)
662 X("InconsistentInternalState", 408)
663 X("mstx", 409)
664 X("Enlistment", 410)
665 X("protocol", 411)
666 X("LocalTransactionId", 412)
667 X("IsolationLevel", 413)
668 X("IsolationFlags", 414)
669 X("Description", 415)
670 X("Loopback", 416)
671 X("RegisterInfo", 417)
672 X("ContextId", 418)
673 X("TokenId", 419)
674 X("AccessDenied", 420)
675 X("InvalidPolicy", 421)
676 X("CoordinatorRegistrationFailed", 422)
677 X("TooManyEnlistments", 423)
678 X("Disabled", 424)
679 X("ActivityId", 425)
680 X("http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics", 426)
681 X("http://docs.oasis-open.org/wss/oasis-wss-kerberos-token-profile-1.1#Kerberosv5APREQSHA1", 427)
682 X("http://schemas.xmlsoap.org/ws/2002/12/policy", 428)
683 X("FloodMessage", 429)
684 X("LinkUtility", 430)
685 X("Hops", 431)
686 X("http://schemas.microsoft.com/net/2006/05/peer/HopCount", 432)
687 X("PeerVia", 433)
688 X("http://schemas.microsoft.com/net/2006/05/peer", 434)
689 X("PeerFlooder", 435)
690 X("PeerTo", 436)
691 X("http://schemas.microsoft.com/ws/2005/05/routing", 437)
692 X("PacketRoutable", 438)
693 X("http://schemas.microsoft.com/ws/2005/05/addressing/none", 439)
694 X("http://schemas.microsoft.com/ws/2005/05/envelope/none", 440)
695 X("http://www.w3.org/2001/XMLSchema-instance", 441)
696 X("http://www.w3.org/2001/XMLSchema", 442)
697 X("nil", 443)
698 X("type", 444)
699 X("char", 445)
700 X("boolean", 446)
701 X("byte", 447)
702 X("unsignedByte", 448)
703 X("short", 449)
704 X("unsignedShort", 450)
705 X("int", 451)
706 X("unsignedInt", 452)
707 X("long", 453)
708 X("unsignedLong", 454)
709 X("float", 455)
710 X("double", 456)
711 X("decimal", 457)
712 X("dateTime", 458)
713 X("string", 459)
714 X("base64Binary", 460)
715 X("anyType", 461)
716 X("duration", 462)
717 X("guid", 463)
718 X("anyURI", 464)
719 X("QName", 465)
720 X("time", 466)
721 X("date", 467)
722 X("hexBinary", 468)
723 X("gYearMonth", 469)
724 X("gYear", 470)
725 X("gMonthDay", 471)
726 X("gDay", 472)
727 X("gMonth", 473)
728 X("integer", 474)
729 X("positiveInteger", 475)
730 X("negativeInteger", 476)
731 X("nonPositiveInteger", 477)
732 X("nonNegativeInteger", 478)
733 X("normalizedString", 479)
734 X("ConnectionLimitReached", 480)
735 X("http://schemas.xmlsoap.org/soap/envelope/", 481)
736 X("actor", 482)
737 X("faultcode", 483)
738 X("faultstring", 484)
739 X("faultactor", 485)
740 X("detail", 486)
741 X("urn:oasis:names:tc:SAML:1.0:cm:bearer", 487)
742 #undef X
745 static const ULONG dict_sorted[] =
747 81, 91, 129, 314, 185, 164, 346, 66, 235, 305, 14, 6, 114, 97, 96, 94, 11, 95, 110, 451,
748 443, 121, 213, 7, 71, 82, 431, 343, 74, 75, 73, 59, 447, 445, 467, 163, 472, 463, 453, 409,
749 69, 286, 466, 444, 383, 67, 117, 26, 40, 345, 465, 90, 25, 77, 482, 455, 470, 344, 353, 80,
750 70, 449, 299, 331, 251, 330, 5, 253, 224, 390, 120, 76, 281, 4, 276, 56, 118, 436, 72, 394,
751 232, 464, 486, 456, 473, 459, 357, 393, 21, 269, 209, 54, 204, 55, 83, 35, 317, 196, 221, 321,
752 433, 387, 22, 78, 288, 419, 461, 446, 457, 474, 261, 272, 424, 308, 1, 274, 322, 93, 319, 202,
753 277, 416, 104, 318, 309, 165, 87, 85, 388, 389, 364, 300, 391, 52, 31, 227, 301, 167, 323, 458,
754 462, 411, 194, 8, 198, 179, 256, 392, 270, 418, 303, 337, 296, 13, 283, 284, 311, 12, 9, 41,
755 287, 53, 187, 18, 58, 483, 471, 468, 425, 49, 271, 295, 410, 116, 15, 379, 112, 119, 109, 42,
756 17, 485, 469, 254, 50, 206, 415, 20, 228, 339, 430, 435, 320, 127, 242, 208, 86, 484, 452, 420,
757 328, 210, 243, 200, 19, 170, 312, 429, 376, 275, 247, 313, 278, 279, 285, 166, 417, 460, 448, 454,
758 257, 199, 267, 46, 47, 421, 171, 32, 282, 79, 57, 226, 347, 168, 450, 252, 260, 201, 310, 380,
759 332, 361, 225, 414, 413, 68, 280, 438, 45, 325, 0, 128, 27, 306, 39, 60, 377, 184, 44, 294,
760 351, 327, 476, 475, 266, 362, 48, 354, 355, 365, 89, 297, 324, 326, 479, 381, 84, 378, 349, 98,
761 258, 259, 291, 412, 366, 348, 423, 478, 477, 169, 360, 406, 273, 229, 113, 407, 100, 88, 363, 205,
762 289, 24, 255, 264, 231, 182, 183, 101, 207, 115, 263, 334, 342, 186, 43, 480, 335, 338, 203, 30,
763 265, 244, 197, 23, 290, 230, 358, 408, 341, 367, 368, 245, 262, 195, 246, 374, 404, 405, 422, 268,
764 375, 442, 359, 37, 33, 3, 180, 487, 62, 155, 156, 157, 111, 2, 122, 16, 38, 316, 315, 144,
765 154, 481, 441, 103, 28, 382, 145, 152, 139, 141, 143, 150, 99, 102, 298, 214, 130, 63, 147, 138,
766 140, 142, 428, 356, 131, 292, 434, 159, 293, 307, 158, 10, 437, 151, 352, 162, 105, 403, 395, 402,
767 238, 241, 248, 153, 108, 398, 399, 373, 149, 249, 211, 148, 400, 401, 396, 132, 212, 146, 65, 123,
768 397, 340, 240, 133, 440, 124, 223, 384, 385, 371, 329, 250, 236, 34, 432, 107, 386, 237, 304, 234,
769 439, 333, 161, 222, 64, 239, 92, 233, 160, 134, 217, 220, 350, 136, 135, 137, 125, 426, 218, 126,
770 372, 215, 216, 106, 336, 29, 219, 61, 302, 193, 369, 191, 192, 181, 370, 178, 189, 36, 188, 51,
771 190, 174, 427, 176, 173, 177, 172, 175,
774 const struct dictionary dict_builtin_static =
776 {{0xf93578f8,0x5852,0x4eb7,{0xa6,0xfc,0xe7,0x2b,0xb7,0x1d,0xb6,0x22}},
777 (WS_XML_STRING *)dict_strings, sizeof(dict_strings)/sizeof(dict_strings[0]), TRUE},
778 (ULONG *)dict_sorted
781 /**************************************************************************
782 * WsGetDictionary [webservices.@]
784 HRESULT WINAPI WsGetDictionary( WS_ENCODING encoding, WS_XML_DICTIONARY **dict, WS_ERROR *error )
786 TRACE( "%u %p %p\n", encoding, dict, error );
787 if (error) FIXME( "ignoring error parameter\n" );
789 if (!dict) return E_INVALIDARG;
791 if (encoding == WS_ENCODING_XML_BINARY_1 || encoding == WS_ENCODING_XML_BINARY_SESSION_1)
792 *dict = (WS_XML_DICTIONARY *)&dict_builtin_static;
793 else
794 *dict = NULL;
796 return S_OK;
799 /**************************************************************************
800 * WsXmlStringEquals [webservices.@]
802 HRESULT WINAPI WsXmlStringEquals( const WS_XML_STRING *str1, const WS_XML_STRING *str2, WS_ERROR *error )
804 TRACE( "%s %s %p\n", debugstr_xmlstr(str1), debugstr_xmlstr(str2), error );
805 if (error) FIXME( "ignoring error parameter\n" );
807 if (!str1 || !str2) return E_INVALIDARG;
809 if (str1->length != str2->length) return S_FALSE;
810 if (!memcmp( str1->bytes, str2->bytes, str1->length )) return S_OK;
811 return S_FALSE;