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