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