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