ReactOS 0.4.16-dev-1946-g52006dd
rpc_binding.c
Go to the documentation of this file.
1/*
2 * RPC binding API
3 *
4 * Copyright 2001 Ove Kåven, TransGaming Technologies
5 * Copyright 2003 Mike Hearn
6 * Copyright 2004 Filip Navara
7 * Copyright 2006 CodeWeavers
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include <stdarg.h>
25#include <stdio.h>
26#include <stdlib.h>
27#include <string.h>
28#include <assert.h>
29
30#include "windef.h"
31#include "winbase.h"
32#include "winnls.h"
33#include "winerror.h"
34#include "winternl.h"
35
36#include "rpc.h"
37#include "rpcndr.h"
38
39#include "wine/debug.h"
40
41#include "rpc_binding.h"
42#include "rpc_assoc.h"
43
45
47{
48 DWORD len;
49 LPSTR s;
50 if (!src) return NULL;
52 s = malloc(len);
54 return s;
55}
56
58{
59 DWORD len;
60 LPWSTR s;
61 if (!src) return NULL;
62 len = MultiByteToWideChar(CP_ACP, 0, src, -1, NULL, 0);
63 s = malloc(len * sizeof(WCHAR));
65 return s;
66}
67
69{
70 DWORD len;
71 LPWSTR s;
72 if (!src) return NULL;
73 len = MultiByteToWideChar(CP_ACP, 0, src, slen, NULL, 0);
74 s = malloc(len * sizeof(WCHAR));
75 MultiByteToWideChar(CP_ACP, 0, src, slen, s, len);
76 return s;
77}
78
80{
81 DWORD len;
82 LPWSTR s;
83 if (!src) return NULL;
84 if (slen == -1) slen = lstrlenW(src);
85 len = slen;
86 s = malloc((len + 1) * sizeof(WCHAR));
87 memcpy(s, src, len*sizeof(WCHAR));
88 s[len] = 0;
89 return s;
90}
91
93{
94 RpcBinding* NewBinding;
95
96 NewBinding = calloc(1, sizeof(RpcBinding));
97 NewBinding->refs = 1;
98 NewBinding->server = server;
99
100 *Binding = NewBinding;
101
102 return RPC_S_OK;
103}
104
106{
107 RpcBinding* NewBinding;
108
109 RPCRT4_AllocBinding(&NewBinding, server);
110 NewBinding->Protseq = strdup(Protseq);
111
112 TRACE("binding: %p\n", NewBinding);
113 *Binding = NewBinding;
114
115 return RPC_S_OK;
116}
117
119{
120 RpcBinding* NewBinding;
121
122 RPCRT4_AllocBinding(&NewBinding, server);
123 NewBinding->Protseq = RPCRT4_strdupWtoA(Protseq);
124
125 TRACE("binding: %p\n", NewBinding);
126 *Binding = NewBinding;
127
128 return RPC_S_OK;
129}
130
132 LPCSTR Endpoint, LPCSTR NetworkOptions)
133{
135
136 TRACE("(RpcBinding == ^%p, NetworkAddr == %s, EndPoint == %s, NetworkOptions == %s)\n", Binding,
137 debugstr_a(NetworkAddr), debugstr_a(Endpoint), debugstr_a(NetworkOptions));
138
139 free(Binding->NetworkAddr);
140 Binding->NetworkAddr = strdup(NetworkAddr);
141 free(Binding->Endpoint);
142 Binding->Endpoint = strdup(Endpoint);
143 free(Binding->NetworkOptions);
144 Binding->NetworkOptions = RPCRT4_strdupAtoW(NetworkOptions);
145
146 /* only attempt to get an association if the binding is complete */
147 if (Endpoint && Endpoint[0] != '\0')
148 {
149 status = RPCRT4_GetAssociation(Binding->Protseq, Binding->NetworkAddr,
150 Binding->Endpoint, Binding->NetworkOptions,
151 &Binding->Assoc);
152 if (status != RPC_S_OK)
153 return status;
154 }
155
156 return RPC_S_OK;
157}
158
160 LPCWSTR Endpoint, LPCWSTR NetworkOptions)
161{
163
164 TRACE("(RpcBinding == ^%p, NetworkAddr == %s, EndPoint == %s, NetworkOptions == %s)\n", Binding,
165 debugstr_w(NetworkAddr), debugstr_w(Endpoint), debugstr_w(NetworkOptions));
166
167 free(Binding->NetworkAddr);
168 Binding->NetworkAddr = RPCRT4_strdupWtoA(NetworkAddr);
169 free(Binding->Endpoint);
170 Binding->Endpoint = RPCRT4_strdupWtoA(Endpoint);
171 free(Binding->NetworkOptions);
172 Binding->NetworkOptions = wcsdup(NetworkOptions);
173
174 /* only attempt to get an association if the binding is complete */
175 if (Endpoint && Endpoint[0] != '\0')
176 {
177 status = RPCRT4_GetAssociation(Binding->Protseq, Binding->NetworkAddr,
178 Binding->Endpoint, Binding->NetworkOptions,
179 &Binding->Assoc);
180 if (status != RPC_S_OK)
181 return status;
182 }
183
184 return RPC_S_OK;
185}
186
188{
190
191 TRACE("(RpcBinding == ^%p, EndPoint == \"%s\"\n", Binding, Endpoint);
192
193 free(Binding->Endpoint);
194 Binding->Endpoint = strdup(Endpoint);
195
196 if (Binding->Assoc) RpcAssoc_Release(Binding->Assoc);
197 Binding->Assoc = NULL;
198 status = RPCRT4_GetAssociation(Binding->Protseq, Binding->NetworkAddr,
199 Binding->Endpoint, Binding->NetworkOptions,
200 &Binding->Assoc);
201 if (status != RPC_S_OK)
202 return status;
203
204 return RPC_S_OK;
205}
206
208{
209 TRACE("(*RpcBinding == ^%p, UUID == %s)\n", Binding, debugstr_guid(ObjectUuid));
210 if (ObjectUuid) Binding->ObjectUuid = *ObjectUuid;
211 else UuidCreateNil(&Binding->ObjectUuid);
212 return RPC_S_OK;
213}
214
216{
217 RpcBinding* NewBinding;
218 TRACE("(RpcBinding == ^%p, Connection == ^%p)\n", Binding, Connection);
219
220 RPCRT4_AllocBinding(&NewBinding, Connection->server);
221 NewBinding->Protseq = strdup(rpcrt4_conn_get_name(Connection));
222 NewBinding->NetworkAddr = strdup(Connection->NetworkAddr);
223 NewBinding->Endpoint = strdup(Connection->Endpoint);
224 NewBinding->FromConn = Connection;
225
226 TRACE("binding: %p\n", NewBinding);
227 *Binding = NewBinding;
228
229 return RPC_S_OK;
230}
231
233{
235}
236
238{
239 if (InterlockedDecrement(&Binding->refs))
240 return RPC_S_OK;
241
242 TRACE("binding: %p\n", Binding);
243 if (Binding->Assoc) RpcAssoc_Release(Binding->Assoc);
244 free(Binding->Endpoint);
245 free(Binding->NetworkAddr);
246 free(Binding->Protseq);
247 free(Binding->NetworkOptions);
248 free(Binding->CookieAuth);
249 if (Binding->AuthInfo) RpcAuthInfo_Release(Binding->AuthInfo);
251 free(Binding);
252 return RPC_S_OK;
253}
254
256 const RPC_SYNTAX_IDENTIFIER *TransferSyntax,
257 const RPC_SYNTAX_IDENTIFIER *InterfaceId, BOOL *from_cache)
258{
259 TRACE("(Binding == ^%p)\n", Binding);
260
261 if (!Binding->server) {
262 return RpcAssoc_GetClientConnection(Binding->Assoc, InterfaceId,
263 TransferSyntax, Binding->AuthInfo, Binding->QOS, Binding->CookieAuth, Connection, from_cache);
264 } else {
265 /* we already have a connection with acceptable binding, so use it */
266 if (Binding->FromConn) {
267 *Connection = Binding->FromConn;
268 return RPC_S_OK;
269 } else {
270 ERR("no connection in binding\n");
272 }
273 }
274}
275
277{
278 TRACE("(Binding == ^%p)\n", Binding);
279 if (!Connection) return RPC_S_OK;
280 if (Binding->server) {
281 /* don't destroy a connection that is cached in the binding */
282 if (Binding->FromConn != Connection)
283 RPCRT4_ReleaseConnection(Connection);
284 }
285 else {
286 RpcAssoc_ReleaseIdleConnection(Binding->Assoc, Connection);
287 }
288 return RPC_S_OK;
289}
290
292{
293 DWORD len = strlen(dst), slen = strlen(src);
294 char *ndst = realloc(dst, len + slen + 2);
295 if (!ndst)
296 {
297 free(dst);
298 return NULL;
299 }
300 ndst[len] = ',';
301 memcpy(ndst+len+1, src, slen+1);
302 return ndst;
303}
304
306{
307 DWORD len = lstrlenW(dst), slen = lstrlenW(src);
308 WCHAR *ndst = realloc(dst, (len + slen + 2) * sizeof(WCHAR));
309 if (!ndst)
310 {
311 free(dst);
312 return NULL;
313 }
314 ndst[len] = ',';
315 memcpy(ndst+len+1, src, (slen+1)*sizeof(WCHAR));
316 return ndst;
317}
318
319/* Copies the escaped version of a component into a string binding.
320 * Note: doesn't nul-terminate the string */
322 const unsigned char *component)
323{
324 for (; *component; component++) {
325 switch (*component) {
326 case '@':
327 case ':':
328 case '[':
329 case ']':
330 case '\\':
331 *string_binding++ = '\\';
332 *string_binding++ = *component;
333 break;
334 default:
335 *string_binding++ = *component;
336 break;
337 }
338 }
339 return string_binding;
340}
341
343 const WCHAR *component)
344{
345 for (; *component; component++) {
346 switch (*component) {
347 case '@':
348 case ':':
349 case '[':
350 case ']':
351 case '\\':
352 *string_binding++ = '\\';
353 *string_binding++ = *component;
354 break;
355 default:
356 *string_binding++ = *component;
357 break;
358 }
359 }
360 return string_binding;
361}
362
363static const unsigned char *string_binding_find_delimiter(
364 const unsigned char *string_binding, unsigned char delim)
365{
366 const unsigned char *next;
367 for (next = string_binding; *next; next++) {
368 if (*next == '\\') {
369 next++;
370 continue;
371 }
372 if (*next == delim)
373 return next;
374 }
375 return NULL;
376}
377
379 const WCHAR *string_binding, WCHAR delim)
380{
381 const WCHAR *next;
382 for (next = string_binding; *next; next++) {
383 if (*next == '\\') {
384 next++;
385 continue;
386 }
387 if (*next == delim)
388 return next;
389 }
390 return NULL;
391}
392
394 const unsigned char *string_binding, int len)
395{
396 RPC_CSTR component, p;
397
398 if (len == -1) len = strlen((const char *)string_binding);
399
400 component = malloc((len + 1) * sizeof(*component));
401 if (!component) return NULL;
402 for (p = component; len > 0; string_binding++, len--) {
403 if (*string_binding == '\\') {
404 string_binding++;
405 len--;
406 *p++ = *string_binding;
407 } else {
408 *p++ = *string_binding;
409 }
410 }
411 *p = '\0';
412 return component;
413}
414
416 const WCHAR *string_binding, int len)
417{
418 RPC_WSTR component, p;
419
420 if (len == -1) len = lstrlenW(string_binding);
421
422 component = malloc((len + 1) * sizeof(*component));
423 if (!component) return NULL;
424 for (p = component; len > 0; string_binding++, len--) {
425 if (*string_binding == '\\') {
426 string_binding++;
427 len--;
428 *p++ = *string_binding;
429 } else {
430 *p++ = *string_binding;
431 }
432 }
433 *p = '\0';
434 return component;
435}
436
437/***********************************************************************
438 * RpcStringBindingComposeA (RPCRT4.@)
439 */
441 RPC_CSTR NetworkAddr, RPC_CSTR Endpoint,
442 RPC_CSTR Options, RPC_CSTR *StringBinding )
443{
444 DWORD len = 1;
446
447 TRACE( "(%s,%s,%s,%s,%s,%p)\n",
448 debugstr_a( (char*)ObjUuid ), debugstr_a( (char*)Protseq ),
449 debugstr_a( (char*)NetworkAddr ), debugstr_a( (char*)Endpoint ),
450 debugstr_a( (char*)Options ), StringBinding );
451
452 /* overestimate for each component for escaping of delimiters */
453 if (ObjUuid && *ObjUuid) len += strlen((char*)ObjUuid) * 2 + 1;
454 if (Protseq && *Protseq) len += strlen((char*)Protseq) * 2 + 1;
455 if (NetworkAddr && *NetworkAddr) len += strlen((char*)NetworkAddr) * 2;
456 if (Endpoint && *Endpoint) len += strlen((char*)Endpoint) * 2 + 2;
457 if (Options && *Options) len += strlen((char*)Options) * 2 + 2;
458
459 data = malloc(len);
460 *StringBinding = data;
461
462 if (ObjUuid && *ObjUuid) {
464 *data++ = '@';
465 }
466 if (Protseq && *Protseq) {
468 *data++ = ':';
469 }
470 if (NetworkAddr && *NetworkAddr)
472
473 if ((Endpoint && *Endpoint) ||
474 (Options && *Options)) {
475 *data++ = '[';
476 if (Endpoint && *Endpoint) {
478 if (Options && *Options) *data++ = ',';
479 }
480 if (Options && *Options) {
482 }
483 *data++ = ']';
484 }
485 *data = 0;
486
487 return RPC_S_OK;
488}
489
490/***********************************************************************
491 * RpcStringBindingComposeW (RPCRT4.@)
492 */
494 RPC_WSTR NetworkAddr, RPC_WSTR Endpoint,
495 RPC_WSTR Options, RPC_WSTR* StringBinding )
496{
497 DWORD len = 1;
499
500 TRACE("(%s,%s,%s,%s,%s,%p)\n",
501 debugstr_w( ObjUuid ), debugstr_w( Protseq ),
502 debugstr_w( NetworkAddr ), debugstr_w( Endpoint ),
503 debugstr_w( Options ), StringBinding);
504
505 /* overestimate for each component for escaping of delimiters */
506 if (ObjUuid && *ObjUuid) len += lstrlenW(ObjUuid) * 2 + 1;
507 if (Protseq && *Protseq) len += lstrlenW(Protseq) * 2 + 1;
508 if (NetworkAddr && *NetworkAddr) len += lstrlenW(NetworkAddr) * 2;
509 if (Endpoint && *Endpoint) len += lstrlenW(Endpoint) * 2 + 2;
510 if (Options && *Options) len += lstrlenW(Options) * 2 + 2;
511
512 data = malloc(len * sizeof(WCHAR));
513 *StringBinding = data;
514
515 if (ObjUuid && *ObjUuid) {
517 *data++ = '@';
518 }
519 if (Protseq && *Protseq) {
521 *data++ = ':';
522 }
523 if (NetworkAddr && *NetworkAddr) {
525 }
526 if ((Endpoint && *Endpoint) ||
527 (Options && *Options)) {
528 *data++ = '[';
529 if (Endpoint && *Endpoint) {
531 if (Options && *Options) *data++ = ',';
532 }
533 if (Options && *Options) {
535 }
536 *data++ = ']';
537 }
538 *data = 0;
539
540 return RPC_S_OK;
541}
542
543
544/***********************************************************************
545 * RpcStringBindingParseA (RPCRT4.@)
546 */
548 RPC_CSTR *Protseq, RPC_CSTR *NetworkAddr,
549 RPC_CSTR *Endpoint, RPC_CSTR *Options)
550{
551 const unsigned char *data, *next;
552 static const char ep_opt[] = "endpoint=";
553 BOOL endpoint_already_found = FALSE;
554
555 TRACE("(%s,%p,%p,%p,%p,%p)\n", debugstr_a((char*)StringBinding),
556 ObjUuid, Protseq, NetworkAddr, Endpoint, Options);
557
558 if (ObjUuid) *ObjUuid = NULL;
559 if (Protseq) *Protseq = NULL;
560 if (NetworkAddr) *NetworkAddr = NULL;
561 if (Endpoint) *Endpoint = NULL;
562 if (Options) *Options = NULL;
563
564 data = StringBinding;
565
567 if (next) {
568 UUID uuid;
571 status = UuidFromStringA(str_uuid, &uuid);
572 if (status != RPC_S_OK) {
573 free(str_uuid);
574 return status;
575 }
576 if (ObjUuid)
577 *ObjUuid = str_uuid;
578 else
579 free(str_uuid);
580 data = next+1;
581 }
582
584 if (next) {
585 if (Protseq) *Protseq = unescape_string_binding_component(data, next - data);
586 data = next+1;
587 } else {
588 goto fail;
589 }
590
592 if (next) {
593 const unsigned char *close;
594 RPC_CSTR opt;
595
596 if (NetworkAddr) *NetworkAddr = unescape_string_binding_component(data, next - data);
597 data = next+1;
599 if (!close) goto fail;
600
601 /* tokenize options */
602 while (data < close) {
604 if (!next || next > close) next = close;
605 /* FIXME: this is kind of inefficient */
607 data = next+1;
608
609 /* parse option */
611 if (!next) {
612 /* not an option, must be an endpoint */
613 if (endpoint_already_found) goto fail;
614 if (Endpoint) *Endpoint = opt;
615 else free(opt);
616 endpoint_already_found = TRUE;
617 } else {
618 if (strncmp((const char *)opt, ep_opt, strlen(ep_opt)) == 0) {
619 /* endpoint option */
620 if (endpoint_already_found) goto fail;
621 if (Endpoint) *Endpoint = unescape_string_binding_component(next+1, -1);
622 free(opt);
623 endpoint_already_found = TRUE;
624 } else {
625 /* network option */
626 if (Options) {
627 if (*Options) {
628 /* FIXME: this is kind of inefficient */
629 *Options = (unsigned char*) RPCRT4_strconcatA( (char*)*Options, (char *)opt);
630 free(opt);
631 } else
632 *Options = opt;
633 } else
634 free(opt);
635 }
636 }
637 }
638
639 data = close+1;
640 if (*data) goto fail;
641 }
642 else if (NetworkAddr)
643 *NetworkAddr = unescape_string_binding_component(data, -1);
644
645 return RPC_S_OK;
646
647fail:
648 if (ObjUuid) RpcStringFreeA(ObjUuid);
649 if (Protseq) RpcStringFreeA(Protseq);
650 if (NetworkAddr) RpcStringFreeA(NetworkAddr);
651 if (Endpoint) RpcStringFreeA(Endpoint);
654}
655
656/***********************************************************************
657 * RpcStringBindingParseW (RPCRT4.@)
658 */
660 RPC_WSTR *Protseq, RPC_WSTR *NetworkAddr,
661 RPC_WSTR *Endpoint, RPC_WSTR *Options)
662{
663 const WCHAR *data, *next;
664 BOOL endpoint_already_found = FALSE;
665
666 TRACE("(%s,%p,%p,%p,%p,%p)\n", debugstr_w(StringBinding),
667 ObjUuid, Protseq, NetworkAddr, Endpoint, Options);
668
669 if (ObjUuid) *ObjUuid = NULL;
670 if (Protseq) *Protseq = NULL;
671 if (NetworkAddr) *NetworkAddr = NULL;
672 if (Endpoint) *Endpoint = NULL;
673 if (Options) *Options = NULL;
674
675 data = StringBinding;
676
678 if (next) {
679 UUID uuid;
682 status = UuidFromStringW(str_uuid, &uuid);
683 if (status != RPC_S_OK) {
684 free(str_uuid);
685 return status;
686 }
687 if (ObjUuid)
688 *ObjUuid = str_uuid;
689 else
690 free(str_uuid);
691 data = next+1;
692 }
693
695 if (next) {
696 if (Protseq) *Protseq = unescape_string_binding_componentW(data, next - data);
697 data = next+1;
698 } else {
699 goto fail;
700 }
701
703 if (next) {
704 const WCHAR *close;
705 RPC_WSTR opt;
706
707 if (NetworkAddr) *NetworkAddr = unescape_string_binding_componentW(data, next - data);
708 data = next+1;
710 if (!close) goto fail;
711
712 /* tokenize options */
713 while (data < close) {
715 if (!next || next > close) next = close;
716 /* FIXME: this is kind of inefficient */
718 data = next+1;
719
720 /* parse option */
722 if (!next) {
723 /* not an option, must be an endpoint */
724 if (endpoint_already_found) goto fail;
725 if (Endpoint) *Endpoint = opt;
726 else free(opt);
727 endpoint_already_found = TRUE;
728 } else {
729 if (wcsncmp(opt, L"endpoint=", lstrlenW(L"endpoint=")) == 0) {
730 /* endpoint option */
731 if (endpoint_already_found) goto fail;
732 if (Endpoint) *Endpoint = unescape_string_binding_componentW(next+1, -1);
733 free(opt);
734 endpoint_already_found = TRUE;
735 } else {
736 /* network option */
737 if (Options) {
738 if (*Options) {
739 /* FIXME: this is kind of inefficient */
741 free(opt);
742 } else
743 *Options = opt;
744 } else
745 free(opt);
746 }
747 }
748 }
749
750 data = close+1;
751 if (*data) goto fail;
752 } else if (NetworkAddr)
753 *NetworkAddr = unescape_string_binding_componentW(data, -1);
754
755 return RPC_S_OK;
756
757fail:
758 if (ObjUuid) RpcStringFreeW(ObjUuid);
759 if (Protseq) RpcStringFreeW(Protseq);
760 if (NetworkAddr) RpcStringFreeW(NetworkAddr);
761 if (Endpoint) RpcStringFreeW(Endpoint);
764}
765
766/***********************************************************************
767 * RpcBindingFree (RPCRT4.@)
768 */
770{
772 TRACE("(%p) = %p\n", Binding, *Binding);
773 if (*Binding)
775 else
777 if (status == RPC_S_OK) *Binding = NULL;
778 return status;
779}
780
781/***********************************************************************
782 * RpcBindingVectorFree (RPCRT4.@)
783 */
785{
786 ULONG c;
787
788 TRACE("(%p)\n", BindingVector);
789 for (c=0; c<(*BindingVector)->Count; c++) RpcBindingFree(&(*BindingVector)->BindingH[c]);
790 free(*BindingVector);
791 *BindingVector = NULL;
792 return RPC_S_OK;
793}
794
795/***********************************************************************
796 * RpcBindingInqObject (RPCRT4.@)
797 */
799{
801
802 TRACE("(%p,%p) = %s\n", Binding, ObjectUuid, debugstr_guid(&bind->ObjectUuid));
803 *ObjectUuid = bind->ObjectUuid;
804 return RPC_S_OK;
805}
806
807/***********************************************************************
808 * RpcBindingSetObject (RPCRT4.@)
809 */
811{
813
814 TRACE("(%p,%s)\n", Binding, debugstr_guid(ObjectUuid));
815 if (bind->server) return RPC_S_WRONG_KIND_OF_BINDING;
816 return RPCRT4_SetBindingObject(Binding, ObjectUuid);
817}
818
819/***********************************************************************
820 * RpcBindingFromStringBindingA (RPCRT4.@)
821 */
823{
826 RPC_CSTR ObjectUuid, Protseq, NetworkAddr, Endpoint, Options;
827 UUID Uuid;
828
829 TRACE("(%s,%p)\n", debugstr_a((char*)StringBinding), Binding);
830
831 ret = RpcStringBindingParseA(StringBinding, &ObjectUuid, &Protseq,
832 &NetworkAddr, &Endpoint, &Options);
833 if (ret != RPC_S_OK) return ret;
834
835 ret = UuidFromStringA(ObjectUuid, &Uuid);
836
837 if (ret == RPC_S_OK)
838 ret = RPCRT4_CreateBindingA(&bind, FALSE, (char*)Protseq);
839 if (ret == RPC_S_OK) {
841 if (ret == RPC_S_OK)
842 ret = RPCRT4_CompleteBindingA(bind, (char*)NetworkAddr, (char*)Endpoint, (char*)Options);
843
844 if (ret == RPC_S_OK)
846 else
848 }
849
851 RpcStringFreeA(&Endpoint);
852 RpcStringFreeA(&NetworkAddr);
853 RpcStringFreeA(&Protseq);
854 RpcStringFreeA(&ObjectUuid);
855
856 return ret;
857}
858
859/***********************************************************************
860 * RpcBindingFromStringBindingW (RPCRT4.@)
861 */
863{
866 RPC_WSTR ObjectUuid, Protseq, NetworkAddr, Endpoint, Options;
867 UUID Uuid;
868
869 TRACE("(%s,%p)\n", debugstr_w(StringBinding), Binding);
870
871 ret = RpcStringBindingParseW(StringBinding, &ObjectUuid, &Protseq,
872 &NetworkAddr, &Endpoint, &Options);
873 if (ret != RPC_S_OK) return ret;
874
875 ret = UuidFromStringW(ObjectUuid, &Uuid);
876
877 if (ret == RPC_S_OK)
878 ret = RPCRT4_CreateBindingW(&bind, FALSE, Protseq);
879 if (ret == RPC_S_OK) {
881 if (ret == RPC_S_OK)
882 ret = RPCRT4_CompleteBindingW(bind, NetworkAddr, Endpoint, Options);
883
884 if (ret == RPC_S_OK)
886 else
888 }
889
891 RpcStringFreeW(&Endpoint);
892 RpcStringFreeW(&NetworkAddr);
893 RpcStringFreeW(&Protseq);
894 RpcStringFreeW(&ObjectUuid);
895
896 return ret;
897}
898
899/***********************************************************************
900 * RpcBindingToStringBindingA (RPCRT4.@)
901 */
903{
906 RPC_CSTR ObjectUuid;
907
908 TRACE("(%p,%p)\n", Binding, StringBinding);
909
910 if (UuidIsNil(&bind->ObjectUuid, &ret))
911 ObjectUuid = NULL;
912 else
913 {
914 ret = UuidToStringA(&bind->ObjectUuid, &ObjectUuid);
915 if (ret != RPC_S_OK) return ret;
916 }
917
918 ret = RpcStringBindingComposeA(ObjectUuid, (unsigned char*)bind->Protseq, (unsigned char*) bind->NetworkAddr,
919 (unsigned char*) bind->Endpoint, NULL, StringBinding);
920
921 RpcStringFreeA(&ObjectUuid);
922
923 return ret;
924}
925
926/***********************************************************************
927 * RpcBindingToStringBindingW (RPCRT4.@)
928 */
930{
932 unsigned char *str = NULL;
933 TRACE("(%p,%p)\n", Binding, StringBinding);
935 *StringBinding = RPCRT4_strdupAtoW((char*)str);
937 return ret;
938}
939
940/***********************************************************************
941 * I_RpcBindingInqTransportType (RPCRT4.@)
942 */
944{
945
946 FIXME( "(%p,%p): stub\n", Binding, Type);
948 return RPC_S_OK;
949}
950
951/***********************************************************************
952 * I_RpcBindingSetAsync (RPCRT4.@)
953 * NOTES
954 * Exists in win9x and winNT, but with different number of arguments
955 * (9x version has 3 arguments, NT has 2).
956 */
958{
960
961 TRACE( "(%p,%p): stub\n", Binding, BlockingFn );
962
963 bind->BlockingFn = BlockingFn;
964
965 return RPC_S_OK;
966}
967
968/***********************************************************************
969 * RpcBindingCopy (RPCRT4.@)
970 */
972 RPC_BINDING_HANDLE SourceBinding,
973 RPC_BINDING_HANDLE* DestinationBinding)
974{
975 RpcBinding *DestBinding;
976 RpcBinding *SrcBinding = SourceBinding;
978
979 TRACE("(%p, %p)\n", SourceBinding, DestinationBinding);
980
981 status = RPCRT4_AllocBinding(&DestBinding, SrcBinding->server);
982 if (status != RPC_S_OK) return status;
983
984 DestBinding->ObjectUuid = SrcBinding->ObjectUuid;
985 DestBinding->BlockingFn = SrcBinding->BlockingFn;
986 DestBinding->Protseq = strdup(SrcBinding->Protseq);
987 DestBinding->NetworkAddr = strdup(SrcBinding->NetworkAddr);
988 DestBinding->Endpoint = strdup(SrcBinding->Endpoint);
989 DestBinding->NetworkOptions = wcsdup(SrcBinding->NetworkOptions);
990 DestBinding->CookieAuth = wcsdup(SrcBinding->CookieAuth);
991 if (SrcBinding->Assoc) SrcBinding->Assoc->refs++;
992 DestBinding->Assoc = SrcBinding->Assoc;
993
994 if (SrcBinding->AuthInfo) RpcAuthInfo_AddRef(SrcBinding->AuthInfo);
995 DestBinding->AuthInfo = SrcBinding->AuthInfo;
996 if (SrcBinding->QOS) RpcQualityOfService_AddRef(SrcBinding->QOS);
997 DestBinding->QOS = SrcBinding->QOS;
998
999 *DestinationBinding = DestBinding;
1000 return RPC_S_OK;
1001}
1002
1003/***********************************************************************
1004 * RpcBindingReset (RPCRT4.@)
1005 */
1007{
1009
1010 TRACE("(%p)\n", Binding);
1011
1012 free(bind->Endpoint);
1013 bind->Endpoint = NULL;
1014 if (bind->Assoc) RpcAssoc_Release(bind->Assoc);
1015 bind->Assoc = NULL;
1016
1017 return RPC_S_OK;
1018}
1019
1020/***********************************************************************
1021 * RpcImpersonateClient (RPCRT4.@)
1022 *
1023 * Impersonates the client connected via a binding handle so that security
1024 * checks are done in the context of the client.
1025 *
1026 * PARAMS
1027 * BindingHandle [I] Handle to the binding to the client.
1028 *
1029 * RETURNS
1030 * Success: RPS_S_OK.
1031 * Failure: RPC_STATUS value.
1032 *
1033 * NOTES
1034 *
1035 * If BindingHandle is NULL then the function impersonates the client
1036 * connected to the binding handle of the current thread.
1037 */
1039{
1041
1042 TRACE("(%p)\n", BindingHandle);
1043
1046
1048 if (bind->FromConn)
1049 return rpcrt4_conn_impersonate_client(bind->FromConn);
1051}
1052
1053/***********************************************************************
1054 * RpcRevertToSelfEx (RPCRT4.@)
1055 *
1056 * Stops impersonating the client connected to the binding handle so that security
1057 * checks are no longer done in the context of the client.
1058 *
1059 * PARAMS
1060 * BindingHandle [I] Handle to the binding to the client.
1061 *
1062 * RETURNS
1063 * Success: RPS_S_OK.
1064 * Failure: RPC_STATUS value.
1065 *
1066 * NOTES
1067 *
1068 * If BindingHandle is NULL then the function stops impersonating the client
1069 * connected to the binding handle of the current thread.
1070 */
1072{
1074
1075 TRACE("(%p)\n", BindingHandle);
1076
1079
1081 if (bind->FromConn)
1082 return rpcrt4_conn_revert_to_self(bind->FromConn);
1084}
1085
1086static inline BOOL has_nt_auth_identity(ULONG AuthnLevel)
1087{
1088 switch (AuthnLevel)
1089 {
1091 case RPC_C_AUTHN_WINNT:
1093 return TRUE;
1094 default:
1095 return FALSE;
1096 }
1097}
1098
1100 CredHandle cred, TimeStamp exp,
1101 ULONG cbMaxToken,
1103 RpcAuthInfo **ret)
1104{
1105 RpcAuthInfo *AuthInfo = malloc(sizeof(*AuthInfo));
1106 if (!AuthInfo)
1107 return RPC_S_OUT_OF_MEMORY;
1108
1109 AuthInfo->refs = 1;
1110 AuthInfo->AuthnLevel = AuthnLevel;
1111 AuthInfo->AuthnSvc = AuthnSvc;
1112 AuthInfo->cred = cred;
1113 AuthInfo->exp = exp;
1114 AuthInfo->cbMaxToken = cbMaxToken;
1115 AuthInfo->identity = identity;
1116 AuthInfo->server_principal_name = NULL;
1117
1118 /* duplicate the SEC_WINNT_AUTH_IDENTITY structure, if applicable, to
1119 * enable better matching in RpcAuthInfo_IsEqual */
1120 if (identity && has_nt_auth_identity(AuthnSvc))
1121 {
1122 const SEC_WINNT_AUTH_IDENTITY_W *nt_identity = identity;
1123 AuthInfo->nt_identity = malloc(sizeof(*AuthInfo->nt_identity));
1124 if (!AuthInfo->nt_identity)
1125 {
1126 free(AuthInfo);
1127 return RPC_S_OUT_OF_MEMORY;
1128 }
1129
1131 if (nt_identity->Flags & SEC_WINNT_AUTH_IDENTITY_UNICODE)
1132 AuthInfo->nt_identity->User = RPCRT4_strndupW(nt_identity->User, nt_identity->UserLength);
1133 else
1134 AuthInfo->nt_identity->User = RPCRT4_strndupAtoW((const char *)nt_identity->User, nt_identity->UserLength);
1135 AuthInfo->nt_identity->UserLength = nt_identity->UserLength;
1136 if (nt_identity->Flags & SEC_WINNT_AUTH_IDENTITY_UNICODE)
1137 AuthInfo->nt_identity->Domain = RPCRT4_strndupW(nt_identity->Domain, nt_identity->DomainLength);
1138 else
1139 AuthInfo->nt_identity->Domain = RPCRT4_strndupAtoW((const char *)nt_identity->Domain, nt_identity->DomainLength);
1140 AuthInfo->nt_identity->DomainLength = nt_identity->DomainLength;
1141 if (nt_identity->Flags & SEC_WINNT_AUTH_IDENTITY_UNICODE)
1142 AuthInfo->nt_identity->Password = RPCRT4_strndupW(nt_identity->Password, nt_identity->PasswordLength);
1143 else
1144 AuthInfo->nt_identity->Password = RPCRT4_strndupAtoW((const char *)nt_identity->Password, nt_identity->PasswordLength);
1145 AuthInfo->nt_identity->PasswordLength = nt_identity->PasswordLength;
1146
1147 if ((nt_identity->User && !AuthInfo->nt_identity->User) ||
1148 (nt_identity->Domain && !AuthInfo->nt_identity->Domain) ||
1149 (nt_identity->Password && !AuthInfo->nt_identity->Password))
1150 {
1151 free(AuthInfo->nt_identity->User);
1152 free(AuthInfo->nt_identity->Domain);
1153 free(AuthInfo->nt_identity->Password);
1154 free(AuthInfo->nt_identity);
1155 free(AuthInfo);
1156 return RPC_S_OUT_OF_MEMORY;
1157 }
1158 }
1159 else
1160 AuthInfo->nt_identity = NULL;
1161 *ret = AuthInfo;
1162 return RPC_S_OK;
1163}
1164
1166{
1167 return InterlockedIncrement(&AuthInfo->refs);
1168}
1169
1171{
1172 ULONG refs = InterlockedDecrement(&AuthInfo->refs);
1173
1174 if (!refs)
1175 {
1176 FreeCredentialsHandle(&AuthInfo->cred);
1177 if (AuthInfo->nt_identity)
1178 {
1179 free(AuthInfo->nt_identity->User);
1180 free(AuthInfo->nt_identity->Domain);
1181 free(AuthInfo->nt_identity->Password);
1182 free(AuthInfo->nt_identity);
1183 }
1184 free(AuthInfo->server_principal_name);
1185 free(AuthInfo);
1186 }
1187
1188 return refs;
1189}
1190
1191BOOL RpcAuthInfo_IsEqual(const RpcAuthInfo *AuthInfo1, const RpcAuthInfo *AuthInfo2)
1192{
1193 if (AuthInfo1 == AuthInfo2)
1194 return TRUE;
1195
1196 if (!AuthInfo1 || !AuthInfo2)
1197 return FALSE;
1198
1199 if ((AuthInfo1->AuthnLevel != AuthInfo2->AuthnLevel) ||
1200 (AuthInfo1->AuthnSvc != AuthInfo2->AuthnSvc))
1201 return FALSE;
1202
1203 if (AuthInfo1->identity == AuthInfo2->identity)
1204 return TRUE;
1205
1206 if (!AuthInfo1->identity || !AuthInfo2->identity)
1207 return FALSE;
1208
1209 if (has_nt_auth_identity(AuthInfo1->AuthnSvc))
1210 {
1211 const SEC_WINNT_AUTH_IDENTITY_W *identity1 = AuthInfo1->nt_identity;
1212 const SEC_WINNT_AUTH_IDENTITY_W *identity2 = AuthInfo2->nt_identity;
1213 /* compare user names */
1214 if (identity1->UserLength != identity2->UserLength ||
1215 memcmp(identity1->User, identity2->User, identity1->UserLength))
1216 return FALSE;
1217 /* compare domain names */
1218 if (identity1->DomainLength != identity2->DomainLength ||
1219 memcmp(identity1->Domain, identity2->Domain, identity1->DomainLength))
1220 return FALSE;
1221 /* compare passwords */
1222 if (identity1->PasswordLength != identity2->PasswordLength ||
1223 memcmp(identity1->Password, identity2->Password, identity1->PasswordLength))
1224 return FALSE;
1225 }
1226 else
1227 return FALSE;
1228
1229 return TRUE;
1230}
1231
1233{
1234 RpcQualityOfService *qos = malloc(sizeof(*qos));
1235
1236 if (!qos)
1238
1239 qos->refs = 1;
1240 qos->qos = malloc(sizeof(*qos->qos));
1241 if (!qos->qos) goto error;
1242 qos->qos->Version = qos_src->Version;
1243 qos->qos->Capabilities = qos_src->Capabilities;
1244 qos->qos->IdentityTracking = qos_src->IdentityTracking;
1245 qos->qos->ImpersonationType = qos_src->ImpersonationType;
1247
1248 if (qos_src->Version >= 2)
1249 {
1250 const RPC_SECURITY_QOS_V2_W *qos_src2 = (const RPC_SECURITY_QOS_V2_W *)qos_src;
1253 {
1254 const RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials_src = qos_src2->u.HttpCredentials;
1255 RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials_dst;
1256
1257 http_credentials_dst = malloc(sizeof(*http_credentials_dst));
1258 qos->qos->u.HttpCredentials = http_credentials_dst;
1259 if (!http_credentials_dst) goto error;
1260 http_credentials_dst->TransportCredentials = NULL;
1261 http_credentials_dst->Flags = http_credentials_src->Flags;
1262 http_credentials_dst->AuthenticationTarget = http_credentials_src->AuthenticationTarget;
1263 http_credentials_dst->NumberOfAuthnSchemes = http_credentials_src->NumberOfAuthnSchemes;
1264 http_credentials_dst->AuthnSchemes = NULL;
1265 http_credentials_dst->ServerCertificateSubject = NULL;
1266 if (http_credentials_src->TransportCredentials)
1267 {
1268 SEC_WINNT_AUTH_IDENTITY_W *cred_dst;
1269 cred_dst = http_credentials_dst->TransportCredentials = calloc(1, sizeof(*cred_dst));
1270 if (!cred_dst) goto error;
1272 if (unicode)
1273 {
1274 const SEC_WINNT_AUTH_IDENTITY_W *cred_src = http_credentials_src->TransportCredentials;
1275 cred_dst->UserLength = cred_src->UserLength;
1276 cred_dst->PasswordLength = cred_src->PasswordLength;
1277 cred_dst->DomainLength = cred_src->DomainLength;
1278 cred_dst->User = RPCRT4_strndupW(cred_src->User, cred_src->UserLength);
1279 cred_dst->Password = RPCRT4_strndupW(cred_src->Password, cred_src->PasswordLength);
1280 cred_dst->Domain = RPCRT4_strndupW(cred_src->Domain, cred_src->DomainLength);
1281 }
1282 else
1283 {
1284 const SEC_WINNT_AUTH_IDENTITY_A *cred_src = (const SEC_WINNT_AUTH_IDENTITY_A *)http_credentials_src->TransportCredentials;
1285 cred_dst->UserLength = MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->User, cred_src->UserLength, NULL, 0);
1286 cred_dst->DomainLength = MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->Domain, cred_src->DomainLength, NULL, 0);
1287 cred_dst->PasswordLength = MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->Password, cred_src->PasswordLength, NULL, 0);
1288 cred_dst->User = malloc(cred_dst->UserLength * sizeof(WCHAR));
1289 cred_dst->Password = malloc(cred_dst->PasswordLength * sizeof(WCHAR));
1290 cred_dst->Domain = malloc(cred_dst->DomainLength * sizeof(WCHAR));
1291 if (!cred_dst->Password || !cred_dst->Domain) goto error;
1292 MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->User, cred_src->UserLength, cred_dst->User, cred_dst->UserLength);
1293 MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->Domain, cred_src->DomainLength, cred_dst->Domain, cred_dst->DomainLength);
1294 MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->Password, cred_src->PasswordLength, cred_dst->Password, cred_dst->PasswordLength);
1295 }
1296 }
1297 if (http_credentials_src->NumberOfAuthnSchemes)
1298 {
1299 http_credentials_dst->AuthnSchemes = malloc(http_credentials_src->NumberOfAuthnSchemes * sizeof(*http_credentials_dst->AuthnSchemes));
1300 if (!http_credentials_dst->AuthnSchemes) goto error;
1301 memcpy(http_credentials_dst->AuthnSchemes, http_credentials_src->AuthnSchemes, http_credentials_src->NumberOfAuthnSchemes * sizeof(*http_credentials_dst->AuthnSchemes));
1302 }
1303 if (http_credentials_src->ServerCertificateSubject)
1304 {
1305 if (unicode)
1306 http_credentials_dst->ServerCertificateSubject =
1307 RPCRT4_strndupW(http_credentials_src->ServerCertificateSubject,
1308 lstrlenW(http_credentials_src->ServerCertificateSubject));
1309 else
1310 http_credentials_dst->ServerCertificateSubject =
1311 RPCRT4_strdupAtoW((char *)http_credentials_src->ServerCertificateSubject);
1312 if (!http_credentials_dst->ServerCertificateSubject) goto error;
1313 }
1314 }
1315 }
1316 *qos_dst = qos;
1317 return RPC_S_OK;
1318
1319error:
1320 if (qos->qos)
1321 {
1323 qos->qos->u.HttpCredentials)
1324 {
1326 {
1331 }
1334 free(qos->qos->u.HttpCredentials);
1335 }
1336 free(qos->qos);
1337 }
1338 free(qos);
1340}
1341
1343{
1344 return InterlockedIncrement(&qos->refs);
1345}
1346
1348{
1349 ULONG refs = InterlockedDecrement(&qos->refs);
1350
1351 if (!refs)
1352 {
1354 {
1356 {
1361 }
1364 free(qos->qos->u.HttpCredentials);
1365 }
1366 free(qos->qos);
1367 free(qos);
1368 }
1369 return refs;
1370}
1371
1373{
1374 if (qos1 == qos2)
1375 return TRUE;
1376
1377 if (!qos1 || !qos2)
1378 return FALSE;
1379
1380 TRACE("qos1 = { %ld %ld %ld %ld }, qos2 = { %ld %ld %ld %ld }\n",
1381 qos1->qos->Capabilities, qos1->qos->IdentityTracking,
1383 qos2->qos->Capabilities, qos2->qos->IdentityTracking,
1385
1386 if ((qos1->qos->Capabilities != qos2->qos->Capabilities) ||
1387 (qos1->qos->IdentityTracking != qos2->qos->IdentityTracking) ||
1388 (qos1->qos->ImpersonationType != qos2->qos->ImpersonationType) ||
1390 return FALSE;
1391
1393 {
1394 const RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials1 = qos1->qos->u.HttpCredentials;
1395 const RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials2 = qos2->qos->u.HttpCredentials;
1396
1397 if (http_credentials1->Flags != http_credentials2->Flags)
1398 return FALSE;
1399
1400 if (http_credentials1->AuthenticationTarget != http_credentials2->AuthenticationTarget)
1401 return FALSE;
1402
1403 if (http_credentials1->NumberOfAuthnSchemes != http_credentials2->NumberOfAuthnSchemes)
1404 return FALSE;
1405
1406 if ((!http_credentials1->AuthnSchemes && http_credentials2->AuthnSchemes) ||
1407 (http_credentials1->AuthnSchemes && !http_credentials2->AuthnSchemes))
1408 return FALSE;
1409
1410 if (memcmp(http_credentials1->AuthnSchemes, http_credentials2->AuthnSchemes,
1411 http_credentials1->NumberOfAuthnSchemes * sizeof(http_credentials1->AuthnSchemes[0])))
1412 return FALSE;
1413
1414 /* server certificate subject not currently used */
1415
1416 if (http_credentials1->TransportCredentials != http_credentials2->TransportCredentials)
1417 {
1418 const SEC_WINNT_AUTH_IDENTITY_W *identity1 = http_credentials1->TransportCredentials;
1419 const SEC_WINNT_AUTH_IDENTITY_W *identity2 = http_credentials2->TransportCredentials;
1420
1421 if (!identity1 || !identity2)
1422 return FALSE;
1423
1424 /* compare user names */
1425 if (identity1->UserLength != identity2->UserLength ||
1426 memcmp(identity1->User, identity2->User, identity1->UserLength))
1427 return FALSE;
1428 /* compare domain names */
1429 if (identity1->DomainLength != identity2->DomainLength ||
1430 memcmp(identity1->Domain, identity2->Domain, identity1->DomainLength))
1431 return FALSE;
1432 /* compare passwords */
1433 if (identity1->PasswordLength != identity2->PasswordLength ||
1434 memcmp(identity1->Password, identity2->Password, identity1->PasswordLength))
1435 return FALSE;
1436 }
1437 }
1438
1439 return TRUE;
1440}
1441
1442/***********************************************************************
1443 * RpcRevertToSelf (RPCRT4.@)
1444 */
1446{
1447 TRACE("\n");
1448 return RpcRevertToSelfEx(NULL);
1449}
1450
1451/***********************************************************************
1452 * RpcMgmtSetComTimeout (RPCRT4.@)
1453 */
1455{
1456 FIXME("(%p, %d): stub\n", BindingHandle, Timeout);
1457 return RPC_S_OK;
1458}
1459
1460/***********************************************************************
1461 * RpcBindingInqAuthInfoExA (RPCRT4.@)
1462 */
1465 ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc,
1466 ULONG RpcQosVersion, RPC_SECURITY_QOS *SecurityQOS )
1467{
1469 RPC_WSTR principal;
1470
1471 TRACE("%p %p %p %p %p %p %lu %p\n", Binding, ServerPrincName, AuthnLevel,
1472 AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS);
1473
1474 status = RpcBindingInqAuthInfoExW(Binding, ServerPrincName ? &principal : NULL, AuthnLevel,
1475 AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS);
1476 if (status == RPC_S_OK && ServerPrincName)
1477 {
1478 *ServerPrincName = (RPC_CSTR)RPCRT4_strdupWtoA(principal);
1479 RpcStringFreeW(&principal);
1480 if (!*ServerPrincName) return RPC_S_OUT_OF_MEMORY;
1481 }
1482
1483 return status;
1484}
1485
1486/***********************************************************************
1487 * RpcBindingInqAuthInfoExW (RPCRT4.@)
1488 */
1491 ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc,
1492 ULONG RpcQosVersion, RPC_SECURITY_QOS *SecurityQOS )
1493{
1495
1496 TRACE("%p %p %p %p %p %p %lu %p\n", Binding, ServerPrincName, AuthnLevel,
1497 AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS);
1498
1499 if (!bind->AuthInfo) return RPC_S_BINDING_HAS_NO_AUTH;
1500
1501 if (SecurityQOS)
1502 {
1503 FIXME("QOS not implemented\n");
1504 return RPC_S_INVALID_BINDING;
1505 }
1506
1507 if (ServerPrincName)
1508 {
1509 if (bind->AuthInfo->server_principal_name)
1510 {
1511 *ServerPrincName = wcsdup(bind->AuthInfo->server_principal_name);
1512 if (!*ServerPrincName) return RPC_S_OUT_OF_MEMORY;
1513 }
1514 else *ServerPrincName = NULL;
1515 }
1516 if (AuthnLevel) *AuthnLevel = bind->AuthInfo->AuthnLevel;
1517 if (AuthnSvc) *AuthnSvc = bind->AuthInfo->AuthnSvc;
1518 if (AuthIdentity) *AuthIdentity = bind->AuthInfo->identity;
1519 if (AuthzSvc)
1520 {
1521 FIXME("authorization service not implemented\n");
1522 *AuthzSvc = RPC_C_AUTHZ_NONE;
1523 }
1524
1525 return RPC_S_OK;
1526}
1527
1528/***********************************************************************
1529 * RpcBindingInqAuthInfoA (RPCRT4.@)
1530 */
1533 ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc )
1534{
1535 return RpcBindingInqAuthInfoExA(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity,
1536 AuthzSvc, 0, NULL);
1537}
1538
1539/***********************************************************************
1540 * RpcBindingInqAuthInfoW (RPCRT4.@)
1541 */
1544 ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc )
1545{
1546 return RpcBindingInqAuthInfoExW(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity,
1547 AuthzSvc, 0, NULL);
1548}
1549
1550/***********************************************************************
1551 * RpcBindingInqAuthClientA (RPCRT4.@)
1552 */
1555 RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc,
1556 ULONG *AuthzSvc )
1557{
1558 return RpcBindingInqAuthClientExA(ClientBinding, Privs, ServerPrincName, AuthnLevel,
1559 AuthnSvc, AuthzSvc, 0);
1560}
1561
1562/***********************************************************************
1563 * RpcBindingInqAuthClientW (RPCRT4.@)
1564 */
1567 RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc,
1568 ULONG *AuthzSvc )
1569{
1570 return RpcBindingInqAuthClientExW(ClientBinding, Privs, ServerPrincName, AuthnLevel,
1571 AuthnSvc, AuthzSvc, 0);
1572}
1573
1574/***********************************************************************
1575 * RpcBindingInqAuthClientExA (RPCRT4.@)
1576 */
1579 RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc,
1580 ULONG *AuthzSvc, ULONG Flags )
1581{
1583 RPC_WSTR principal;
1584
1585 TRACE("%p %p %p %p %p %p 0x%lx\n", ClientBinding, Privs, ServerPrincName, AuthnLevel,
1586 AuthnSvc, AuthzSvc, Flags);
1587
1588 status = RpcBindingInqAuthClientExW(ClientBinding, Privs, ServerPrincName ? &principal : NULL,
1589 AuthnLevel, AuthnSvc, AuthzSvc, Flags);
1590 if (status == RPC_S_OK && ServerPrincName)
1591 {
1592 *ServerPrincName = (RPC_CSTR)RPCRT4_strdupWtoA(principal);
1593 if (!*ServerPrincName && principal) status = RPC_S_OUT_OF_MEMORY;
1594 RpcStringFreeW(&principal);
1595 }
1596
1597 return status;
1598}
1599
1600/***********************************************************************
1601 * RpcBindingInqAuthClientExW (RPCRT4.@)
1602 */
1605 RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc,
1606 ULONG *AuthzSvc, ULONG Flags )
1607{
1609
1610 TRACE("%p %p %p %p %p %p 0x%lx\n", ClientBinding, Privs, ServerPrincName, AuthnLevel,
1611 AuthnSvc, AuthzSvc, Flags);
1612
1613 if (!ClientBinding) ClientBinding = I_RpcGetCurrentCallHandle();
1614 if (!ClientBinding) return RPC_S_INVALID_BINDING;
1615
1616 bind = ClientBinding;
1617 if (!bind->FromConn) return RPC_S_INVALID_BINDING;
1618
1619 return rpcrt4_conn_inquire_auth_client(bind->FromConn, Privs,
1620 ServerPrincName, AuthnLevel,
1621 AuthnSvc, AuthzSvc, Flags);
1622}
1623
1624/***********************************************************************
1625 * RpcBindingServerFromClient (RPCRT4.@)
1626 */
1629{
1630 RpcBinding* bind = ClientBinding;
1631 RpcBinding* NewBinding;
1632
1633 if (!bind)
1635
1636 if (!bind->server)
1637 return RPC_S_INVALID_BINDING;
1638
1639 RPCRT4_AllocBinding(&NewBinding, TRUE);
1640 NewBinding->Protseq = strdup(bind->Protseq);
1641 NewBinding->NetworkAddr = strdup(bind->NetworkAddr);
1642
1643 *ServerBinding = NewBinding;
1644
1645 return RPC_S_OK;
1646}
1647
1648/***********************************************************************
1649 * RpcBindingSetAuthInfoExA (RPCRT4.@)
1650 */
1653 ULONG AuthnLevel, ULONG AuthnSvc,
1654 RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr,
1655 RPC_SECURITY_QOS *SecurityQos )
1656{
1659 CredHandle cred;
1660 TimeStamp exp;
1661 ULONG package_count;
1662 ULONG i;
1663 PSecPkgInfoA packages;
1664 ULONG cbMaxToken;
1665
1666 TRACE("%p %s %lu %lu %p %lu %p\n", Binding, debugstr_a((const char*)ServerPrincName),
1667 AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, SecurityQos);
1668
1669 if (SecurityQos)
1670 {
1672
1673 TRACE("SecurityQos { Version=%ld, Capabilities=0x%lx, IdentityTracking=%ld, ImpersonationLevel=%ld",
1674 SecurityQos->Version, SecurityQos->Capabilities, SecurityQos->IdentityTracking, SecurityQos->ImpersonationType);
1675 if (SecurityQos->Version >= 2)
1676 {
1677 const RPC_SECURITY_QOS_V2_A *SecurityQos2 = (const RPC_SECURITY_QOS_V2_A *)SecurityQos;
1678 TRACE(", AdditionalSecurityInfoType=%ld", SecurityQos2->AdditionalSecurityInfoType);
1680 TRACE(", { %p, 0x%lx, %ld, %ld, %p(%lu), %s }",
1681 SecurityQos2->u.HttpCredentials->TransportCredentials,
1682 SecurityQos2->u.HttpCredentials->Flags,
1683 SecurityQos2->u.HttpCredentials->AuthenticationTarget,
1684 SecurityQos2->u.HttpCredentials->NumberOfAuthnSchemes,
1685 SecurityQos2->u.HttpCredentials->AuthnSchemes,
1686 SecurityQos2->u.HttpCredentials->AuthnSchemes ? *SecurityQos2->u.HttpCredentials->AuthnSchemes : 0,
1688 }
1689 TRACE("}\n");
1690 status = RpcQualityOfService_Create(SecurityQos, FALSE, &bind->QOS);
1691 if (status != RPC_S_OK)
1692 return status;
1693 }
1694 else
1695 {
1696 if (bind->QOS) RpcQualityOfService_Release(bind->QOS);
1697 bind->QOS = NULL;
1698 }
1699
1700 if (AuthnSvc == RPC_C_AUTHN_DEFAULT)
1701 AuthnSvc = RPC_C_AUTHN_WINNT;
1702
1703 /* FIXME: the mapping should probably be retrieved using SSPI somehow */
1704 if (AuthnLevel == RPC_C_AUTHN_LEVEL_DEFAULT)
1705 AuthnLevel = RPC_C_AUTHN_LEVEL_NONE;
1706
1707 if ((AuthnLevel == RPC_C_AUTHN_LEVEL_NONE) || (AuthnSvc == RPC_C_AUTHN_NONE))
1708 {
1709 if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo);
1710 bind->AuthInfo = NULL;
1711 return RPC_S_OK;
1712 }
1713
1714 if (AuthnLevel > RPC_C_AUTHN_LEVEL_PKT_PRIVACY)
1715 {
1716 FIXME("unknown AuthnLevel %lu\n", AuthnLevel);
1718 }
1719
1720 /* RPC_C_AUTHN_WINNT ignores the AuthzSvr parameter */
1721 if (AuthzSvr && AuthnSvc != RPC_C_AUTHN_WINNT)
1722 {
1723 FIXME("unsupported AuthzSvr %lu\n", AuthzSvr);
1725 }
1726
1727 r = EnumerateSecurityPackagesA(&package_count, &packages);
1728 if (r != SEC_E_OK)
1729 {
1730 ERR("EnumerateSecurityPackagesA failed with error 0x%08lx\n", r);
1731 return RPC_S_SEC_PKG_ERROR;
1732 }
1733
1734 for (i = 0; i < package_count; i++)
1735 if (packages[i].wRPCID == AuthnSvc)
1736 break;
1737
1738 if (i == package_count)
1739 {
1740 FIXME("unsupported AuthnSvc %lu\n", AuthnSvc);
1741 FreeContextBuffer(packages);
1743 }
1744
1745 TRACE("found package %s for service %lu\n", packages[i].Name, AuthnSvc);
1747 AuthIdentity, NULL, NULL, &cred, &exp);
1748 cbMaxToken = packages[i].cbMaxToken;
1749 FreeContextBuffer(packages);
1750 if (r == ERROR_SUCCESS)
1751 {
1752 RpcAuthInfo *new_auth_info;
1753 r = RpcAuthInfo_Create(AuthnLevel, AuthnSvc, cred, exp, cbMaxToken,
1754 AuthIdentity, &new_auth_info);
1755 if (r == RPC_S_OK)
1756 {
1757 new_auth_info->server_principal_name = RPCRT4_strdupAtoW((char *)ServerPrincName);
1758 if (!ServerPrincName || new_auth_info->server_principal_name)
1759 {
1760 if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo);
1761 bind->AuthInfo = new_auth_info;
1762 }
1763 else
1764 {
1765 RpcAuthInfo_Release(new_auth_info);
1767 }
1768 }
1769 else
1770 FreeCredentialsHandle(&cred);
1771 return r;
1772 }
1773 else
1774 {
1775 ERR("AcquireCredentialsHandleA failed with error 0x%08lx\n", r);
1776 return RPC_S_SEC_PKG_ERROR;
1777 }
1778}
1779
1780/***********************************************************************
1781 * RpcBindingSetAuthInfoExW (RPCRT4.@)
1782 */
1785 ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr,
1786 RPC_SECURITY_QOS *SecurityQos )
1787{
1790 CredHandle cred;
1791 TimeStamp exp;
1792 ULONG package_count;
1793 ULONG i;
1794 PSecPkgInfoW packages;
1795 ULONG cbMaxToken;
1796
1797 TRACE("%p %s %lu %lu %p %lu %p\n", Binding, debugstr_w(ServerPrincName),
1798 AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, SecurityQos);
1799
1800 if (SecurityQos)
1801 {
1803
1804 TRACE("SecurityQos { Version=%ld, Capabilities=0x%lx, IdentityTracking=%ld, ImpersonationLevel=%ld",
1805 SecurityQos->Version, SecurityQos->Capabilities, SecurityQos->IdentityTracking, SecurityQos->ImpersonationType);
1806 if (SecurityQos->Version >= 2)
1807 {
1808 const RPC_SECURITY_QOS_V2_W *SecurityQos2 = (const RPC_SECURITY_QOS_V2_W *)SecurityQos;
1809 TRACE(", AdditionalSecurityInfoType=%ld", SecurityQos2->AdditionalSecurityInfoType);
1811 TRACE(", { %p, 0x%lx, %ld, %ld, %p(%lu), %s }",
1812 SecurityQos2->u.HttpCredentials->TransportCredentials,
1813 SecurityQos2->u.HttpCredentials->Flags,
1814 SecurityQos2->u.HttpCredentials->AuthenticationTarget,
1815 SecurityQos2->u.HttpCredentials->NumberOfAuthnSchemes,
1816 SecurityQos2->u.HttpCredentials->AuthnSchemes,
1817 SecurityQos2->u.HttpCredentials->AuthnSchemes ? *SecurityQos2->u.HttpCredentials->AuthnSchemes : 0,
1819 }
1820 TRACE("}\n");
1821 status = RpcQualityOfService_Create(SecurityQos, TRUE, &bind->QOS);
1822 if (status != RPC_S_OK)
1823 return status;
1824 }
1825 else
1826 {
1827 if (bind->QOS) RpcQualityOfService_Release(bind->QOS);
1828 bind->QOS = NULL;
1829 }
1830
1831 if (AuthnSvc == RPC_C_AUTHN_DEFAULT)
1832 AuthnSvc = RPC_C_AUTHN_WINNT;
1833
1834 /* FIXME: the mapping should probably be retrieved using SSPI somehow */
1835 if (AuthnLevel == RPC_C_AUTHN_LEVEL_DEFAULT)
1836 AuthnLevel = RPC_C_AUTHN_LEVEL_NONE;
1837
1838 if ((AuthnLevel == RPC_C_AUTHN_LEVEL_NONE) || (AuthnSvc == RPC_C_AUTHN_NONE))
1839 {
1840 if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo);
1841 bind->AuthInfo = NULL;
1842 return RPC_S_OK;
1843 }
1844
1845 if (AuthnLevel > RPC_C_AUTHN_LEVEL_PKT_PRIVACY)
1846 {
1847 FIXME("unknown AuthnLevel %lu\n", AuthnLevel);
1849 }
1850
1851 /* RPC_C_AUTHN_WINNT ignores the AuthzSvr parameter */
1852 if (AuthzSvr && AuthnSvc != RPC_C_AUTHN_WINNT)
1853 {
1854 FIXME("unsupported AuthzSvr %lu\n", AuthzSvr);
1856 }
1857
1858 r = EnumerateSecurityPackagesW(&package_count, &packages);
1859 if (r != SEC_E_OK)
1860 {
1861 ERR("EnumerateSecurityPackagesW failed with error 0x%08lx\n", r);
1862 return RPC_S_SEC_PKG_ERROR;
1863 }
1864
1865 for (i = 0; i < package_count; i++)
1866 if (packages[i].wRPCID == AuthnSvc)
1867 break;
1868
1869 if (i == package_count)
1870 {
1871 FIXME("unsupported AuthnSvc %lu\n", AuthnSvc);
1872 FreeContextBuffer(packages);
1874 }
1875
1876 TRACE("found package %s for service %lu\n", debugstr_w(packages[i].Name), AuthnSvc);
1878 AuthIdentity, NULL, NULL, &cred, &exp);
1879 cbMaxToken = packages[i].cbMaxToken;
1880 FreeContextBuffer(packages);
1881 if (r == ERROR_SUCCESS)
1882 {
1883 RpcAuthInfo *new_auth_info;
1884 r = RpcAuthInfo_Create(AuthnLevel, AuthnSvc, cred, exp, cbMaxToken,
1885 AuthIdentity, &new_auth_info);
1886 if (r == RPC_S_OK)
1887 {
1888 new_auth_info->server_principal_name = wcsdup(ServerPrincName);
1889 if (!ServerPrincName || new_auth_info->server_principal_name)
1890 {
1891 if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo);
1892 bind->AuthInfo = new_auth_info;
1893 }
1894 else
1895 {
1896 RpcAuthInfo_Release(new_auth_info);
1898 }
1899 }
1900 else
1901 FreeCredentialsHandle(&cred);
1902 return r;
1903 }
1904 else
1905 {
1906 ERR("AcquireCredentialsHandleW failed with error 0x%08lx\n", r);
1907 return RPC_S_SEC_PKG_ERROR;
1908 }
1909}
1910
1911/***********************************************************************
1912 * RpcBindingSetAuthInfoA (RPCRT4.@)
1913 */
1916 ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr )
1917{
1918 TRACE("%p %s %lu %lu %p %lu\n", Binding, debugstr_a((const char*)ServerPrincName),
1919 AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr);
1920 return RpcBindingSetAuthInfoExA(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, NULL);
1921}
1922
1923/***********************************************************************
1924 * RpcBindingSetAuthInfoW (RPCRT4.@)
1925 */
1928 ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr )
1929{
1930 TRACE("%p %s %lu %lu %p %lu\n", Binding, debugstr_w(ServerPrincName),
1931 AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr);
1932 return RpcBindingSetAuthInfoExW(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, NULL);
1933}
1934
1935/***********************************************************************
1936 * RpcBindingSetOption (RPCRT4.@)
1937 */
1939{
1940 TRACE("(%p, %ld, %Id)\n", BindingHandle, Option, OptionValue);
1941
1942 switch (Option)
1943 {
1945 {
1948 int len = MultiByteToWideChar(CP_ACP, 0, cookie->Buffer, cookie->BufferSize, NULL, 0);
1949 WCHAR *str;
1950
1951 if (!(str = malloc((len + 1) * sizeof(WCHAR)))) return RPC_S_OUT_OF_MEMORY;
1952 MultiByteToWideChar(CP_ACP, 0, cookie->Buffer, cookie->BufferSize, str, len);
1953 str[len] = 0;
1954 free(binding->CookieAuth);
1955 binding->CookieAuth = str;
1956 break;
1957 }
1958 default:
1959 FIXME("option %lu not supported\n", Option);
1960 break;
1961 }
1962 return RPC_S_OK;
1963}
1964
1965/***********************************************************************
1966 * I_RpcBindingInqLocalClientPID (RPCRT4.@)
1967 */
1968
1970{
1971 RpcConnection *connection = NULL;
1973
1974 TRACE("%p %p\n", ClientBinding, ClientPID);
1975
1976 binding = ClientBinding ? ClientBinding : RPCRT4_GetThreadCurrentCallHandle();
1977 if (!binding)
1978 return RPC_S_NO_CALL_ACTIVE;
1979
1980 connection = binding->FromConn;
1981 if (!connection->ops->inquire_client_pid)
1982 return RPC_S_INVALID_BINDING;
1983
1984 return connection->ops->inquire_client_pid(connection, ClientPID);
1985}
Type
Definition: Type.h:7
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
#define close
Definition: acwin.h:98
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
#define realloc
Definition: debug_ros.c:6
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define ERROR_SUCCESS
Definition: deptool.c:10
LPWSTR Name
Definition: desk.c:124
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrlenW
Definition: compat.h:750
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble s
Definition: gl.h:2039
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLenum src
Definition: glext.h:6340
const GLubyte * c
Definition: glext.h:8905
GLenum GLenum dst
Definition: glext.h:6340
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: msctf.idl:532
#define c
Definition: ke_i.h:80
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
#define error(str)
Definition: mkdosfs.c:1605
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static RPC_BINDING_HANDLE binding
Definition: server.c:166
DWORD exp
Definition: msg.c:16058
static ULONG Timeout
Definition: ping.c:61
LONG SECURITY_STATUS
Definition: sspi.h:34
#define SECPKG_CRED_OUTBOUND
Definition: sspi.h:291
static unsigned __int64 next
Definition: rand_nt.c:6
#define calloc
Definition: rosglue.h:14
RPC_STATUS RPCRT4_GetAssociation(LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, RpcAssoc **assoc_out)
Definition: rpc_assoc.c:98
void RpcAssoc_ReleaseIdleConnection(RpcAssoc *assoc, RpcConnection *Connection)
Definition: rpc_assoc.c:437
ULONG RpcAssoc_Release(RpcAssoc *assoc)
Definition: rpc_assoc.c:187
RPC_STATUS RpcAssoc_GetClientConnection(RpcAssoc *assoc, const RPC_SYNTAX_IDENTIFIER *InterfaceId, const RPC_SYNTAX_IDENTIFIER *TransferSyntax, RpcAuthInfo *AuthInfo, RpcQualityOfService *QOS, LPCWSTR CookieAuth, RpcConnection **Connection, BOOL *from_cache)
Definition: rpc_assoc.c:390
static RPC_WSTR escape_string_binding_componentW(RPC_WSTR string_binding, const WCHAR *component)
Definition: rpc_binding.c:342
static BOOL has_nt_auth_identity(ULONG AuthnLevel)
Definition: rpc_binding.c:1086
static RPC_STATUS RPCRT4_AllocBinding(RpcBinding **Binding, BOOL server)
Definition: rpc_binding.c:92
RPC_STATUS RpcAuthInfo_Create(ULONG AuthnLevel, ULONG AuthnSvc, CredHandle cred, TimeStamp exp, ULONG cbMaxToken, RPC_AUTH_IDENTITY_HANDLE identity, RpcAuthInfo **ret)
Definition: rpc_binding.c:1099
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:862
LPSTR RPCRT4_strdupWtoA(LPCWSTR src)
Definition: rpc_binding.c:46
BOOL RpcAuthInfo_IsEqual(const RpcAuthInfo *AuthInfo1, const RpcAuthInfo *AuthInfo2)
Definition: rpc_binding.c:1191
static const WCHAR * string_binding_find_delimiterW(const WCHAR *string_binding, WCHAR delim)
Definition: rpc_binding.c:378
static RPC_WSTR unescape_string_binding_componentW(const WCHAR *string_binding, int len)
Definition: rpc_binding.c:415
RPC_STATUS RPCRT4_ResolveBinding(RpcBinding *Binding, LPCSTR Endpoint)
Definition: rpc_binding.c:187
RPC_STATUS WINAPI RpcMgmtSetComTimeout(RPC_BINDING_HANDLE BindingHandle, unsigned int Timeout)
Definition: rpc_binding.c:1454
static LPWSTR RPCRT4_strconcatW(LPWSTR dst, LPCWSTR src)
Definition: rpc_binding.c:305
RPC_STATUS WINAPI RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR *StringBinding)
Definition: rpc_binding.c:493
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthInfoW(RPC_BINDING_HANDLE Binding, RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc)
Definition: rpc_binding.c:1543
void RPCRT4_AddRefBinding(RpcBinding *Binding)
Definition: rpc_binding.c:232
static RPC_STATUS RPCRT4_CreateBindingW(RpcBinding **Binding, BOOL server, LPCWSTR Protseq)
Definition: rpc_binding.c:118
RPC_STATUS RPCRT4_CloseBinding(RpcBinding *Binding, RpcConnection *Connection)
Definition: rpc_binding.c:276
ULONG RpcAuthInfo_AddRef(RpcAuthInfo *AuthInfo)
Definition: rpc_binding.c:1165
RPC_STATUS WINAPI RpcBindingInqObject(RPC_BINDING_HANDLE Binding, UUID *ObjectUuid)
Definition: rpc_binding.c:798
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:769
RPC_STATUS WINAPI RpcStringBindingParseW(RPC_WSTR StringBinding, RPC_WSTR *ObjUuid, RPC_WSTR *Protseq, RPC_WSTR *NetworkAddr, RPC_WSTR *Endpoint, RPC_WSTR *Options)
Definition: rpc_binding.c:659
RPC_STATUS RPCRT4_MakeBinding(RpcBinding **Binding, RpcConnection *Connection)
Definition: rpc_binding.c:215
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingSetAuthInfoA(RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, ULONG AuthnLevel, ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr)
Definition: rpc_binding.c:1915
ULONG RpcQualityOfService_AddRef(RpcQualityOfService *qos)
Definition: rpc_binding.c:1342
ULONG RpcAuthInfo_Release(RpcAuthInfo *AuthInfo)
Definition: rpc_binding.c:1170
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingServerFromClient(RPC_BINDING_HANDLE ClientBinding, RPC_BINDING_HANDLE *ServerBinding)
Definition: rpc_binding.c:1628
RPC_STATUS WINAPI RpcStringBindingParseA(RPC_CSTR StringBinding, RPC_CSTR *ObjUuid, RPC_CSTR *Protseq, RPC_CSTR *NetworkAddr, RPC_CSTR *Endpoint, RPC_CSTR *Options)
Definition: rpc_binding.c:547
static RPC_STATUS RpcQualityOfService_Create(const RPC_SECURITY_QOS *qos_src, BOOL unicode, RpcQualityOfService **qos_dst)
Definition: rpc_binding.c:1232
static RPC_STATUS RPCRT4_CreateBindingA(RpcBinding **Binding, BOOL server, LPCSTR Protseq)
Definition: rpc_binding.c:105
RPC_STATUS RPCRT4_ReleaseBinding(RpcBinding *Binding)
Definition: rpc_binding.c:237
LPWSTR RPCRT4_strdupAtoW(LPCSTR src)
Definition: rpc_binding.c:57
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingSetAuthInfoW(RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, ULONG AuthnLevel, ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr)
Definition: rpc_binding.c:1927
RPC_STATUS RPCRT4_SetBindingObject(RpcBinding *Binding, const UUID *ObjectUuid)
Definition: rpc_binding.c:207
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingSetAuthInfoExA(RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, ULONG AuthnLevel, ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr, RPC_SECURITY_QOS *SecurityQos)
Definition: rpc_binding.c:1652
RPC_STATUS WINAPI RpcBindingToStringBindingW(RPC_BINDING_HANDLE Binding, RPC_WSTR *StringBinding)
Definition: rpc_binding.c:929
static RPC_CSTR escape_string_binding_component(RPC_CSTR string_binding, const unsigned char *component)
Definition: rpc_binding.c:321
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientExW(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs, RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, ULONG *AuthzSvc, ULONG Flags)
Definition: rpc_binding.c:1604
RPC_STATUS WINAPI I_RpcBindingSetAsync(RPC_BINDING_HANDLE Binding, RPC_BLOCKING_FN BlockingFn)
Definition: rpc_binding.c:957
RPC_STATUS WINAPI RpcRevertToSelf(void)
Definition: rpc_binding.c:1445
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthInfoA(RPC_BINDING_HANDLE Binding, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc)
Definition: rpc_binding.c:1532
RPC_STATUS RPC_ENTRY RpcBindingCopy(RPC_BINDING_HANDLE SourceBinding, RPC_BINDING_HANDLE *DestinationBinding)
Definition: rpc_binding.c:971
static LPSTR RPCRT4_strconcatA(LPSTR dst, LPCSTR src)
Definition: rpc_binding.c:291
LPWSTR RPCRT4_strndupW(LPCWSTR src, INT slen)
Definition: rpc_binding.c:79
RPC_STATUS WINAPI RpcStringBindingComposeA(RPC_CSTR ObjUuid, RPC_CSTR Protseq, RPC_CSTR NetworkAddr, RPC_CSTR Endpoint, RPC_CSTR Options, RPC_CSTR *StringBinding)
Definition: rpc_binding.c:440
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientW(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs, RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, ULONG *AuthzSvc)
Definition: rpc_binding.c:1566
RPC_STATUS WINAPI RpcBindingVectorFree(RPC_BINDING_VECTOR **BindingVector)
Definition: rpc_binding.c:784
RPC_STATUS WINAPI RpcRevertToSelfEx(RPC_BINDING_HANDLE BindingHandle)
Definition: rpc_binding.c:1071
RPC_STATUS WINAPI I_RpcBindingInqTransportType(RPC_BINDING_HANDLE Binding, unsigned int *Type)
Definition: rpc_binding.c:943
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingSetAuthInfoExW(RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, ULONG AuthnLevel, ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr, RPC_SECURITY_QOS *SecurityQos)
Definition: rpc_binding.c:1784
RPC_STATUS WINAPI RpcBindingSetObject(RPC_BINDING_HANDLE Binding, UUID *ObjectUuid)
Definition: rpc_binding.c:810
BOOL RpcQualityOfService_IsEqual(const RpcQualityOfService *qos1, const RpcQualityOfService *qos2)
Definition: rpc_binding.c:1372
ULONG RpcQualityOfService_Release(RpcQualityOfService *qos)
Definition: rpc_binding.c:1347
RPC_STATUS RPC_ENTRY RpcBindingReset(RPC_BINDING_HANDLE Binding)
Definition: rpc_binding.c:1006
RPC_STATUS WINAPI RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding, RPC_CSTR *StringBinding)
Definition: rpc_binding.c:902
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientExA(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, ULONG *AuthzSvc, ULONG Flags)
Definition: rpc_binding.c:1578
RPC_STATUS WINAPI I_RpcBindingInqLocalClientPID(RPC_BINDING_HANDLE ClientBinding, ULONG *ClientPID)
Definition: rpc_binding.c:1969
static const unsigned char * string_binding_find_delimiter(const unsigned char *string_binding, unsigned char delim)
Definition: rpc_binding.c:363
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthInfoExW(RPC_BINDING_HANDLE Binding, RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc, ULONG RpcQosVersion, RPC_SECURITY_QOS *SecurityQOS)
Definition: rpc_binding.c:1490
static LPWSTR RPCRT4_strndupAtoW(LPCSTR src, INT slen)
Definition: rpc_binding.c:68
RPC_STATUS WINAPI RpcBindingSetOption(RPC_BINDING_HANDLE BindingHandle, ULONG Option, ULONG_PTR OptionValue)
Definition: rpc_binding.c:1938
RPC_STATUS RPCRT4_OpenBinding(RpcBinding *Binding, RpcConnection **Connection, const RPC_SYNTAX_IDENTIFIER *TransferSyntax, const RPC_SYNTAX_IDENTIFIER *InterfaceId, BOOL *from_cache)
Definition: rpc_binding.c:255
RPC_STATUS WINAPI RpcBindingFromStringBindingA(RPC_CSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:822
static RPC_STATUS RPCRT4_CompleteBindingA(RpcBinding *Binding, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCSTR NetworkOptions)
Definition: rpc_binding.c:131
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthInfoExA(RPC_BINDING_HANDLE Binding, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc, ULONG RpcQosVersion, RPC_SECURITY_QOS *SecurityQOS)
Definition: rpc_binding.c:1464
static RPC_STATUS RPCRT4_CompleteBindingW(RpcBinding *Binding, LPCWSTR NetworkAddr, LPCWSTR Endpoint, LPCWSTR NetworkOptions)
Definition: rpc_binding.c:159
static RPC_CSTR unescape_string_binding_component(const unsigned char *string_binding, int len)
Definition: rpc_binding.c:393
RPC_STATUS WINAPI RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle)
Definition: rpc_binding.c:1038
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientA(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, ULONG *AuthzSvc)
Definition: rpc_binding.c:1554
static const char * rpcrt4_conn_get_name(const RpcConnection *Connection)
Definition: rpc_binding.h:179
static RPC_STATUS rpcrt4_conn_impersonate_client(RpcConnection *conn)
Definition: rpc_binding.h:237
static RPC_STATUS rpcrt4_conn_revert_to_self(RpcConnection *conn)
Definition: rpc_binding.h:243
static RPC_STATUS rpcrt4_conn_inquire_auth_client(RpcConnection *conn, RPC_AUTHZ_HANDLE *privs, RPC_WSTR *server_princ_name, ULONG *authn_level, ULONG *authn_svc, ULONG *authz_svc, ULONG flags)
Definition: rpc_binding.h:249
void RPCRT4_ReleaseConnection(RpcConnection *Connection)
RpcBinding * RPCRT4_GetThreadCurrentCallHandle(void)
Definition: rpcrt4_main.c:1003
RPC_BINDING_HANDLE WINAPI I_RpcGetCurrentCallHandle(void)
Definition: rpc_server.c:1743
const WCHAR * str
#define RPC_C_AUTHN_DEFAULT
Definition: rpcdce.h:165
I_RPC_HANDLE RPC_BINDING_HANDLE
Definition: rpcdce.h:50
unsigned short * RPC_WSTR
Definition: rpcdce.h:46
unsigned char * RPC_CSTR
Definition: rpcdce.h:45
#define SEC_WINNT_AUTH_IDENTITY_UNICODE
Definition: rpcdce.h:310
#define RPC_C_AUTHZ_NONE
Definition: rpcdce.h:167
#define RPC_C_AUTHN_LEVEL_PKT_PRIVACY
Definition: rpcdce.h:151
#define RPC_C_AUTHN_LEVEL_NONE
Definition: rpcdce.h:146
#define RPC_C_AUTHN_LEVEL_DEFAULT
Definition: rpcdce.h:145
#define RPC_C_AUTHN_INFO_TYPE_HTTP
Definition: rpcdce.h:195
#define RPC_C_AUTHN_WINNT
Definition: rpcdce.h:158
#define RPC_C_AUTHN_GSS_NEGOTIATE
Definition: rpcdce.h:157
#define RPC_C_AUTHN_GSS_KERBEROS
Definition: rpcdce.h:160
#define RPC_C_AUTHN_NONE
Definition: rpcdce.h:153
#define RPC_C_OPT_COOKIE_AUTH
Definition: rpcdcep.h:127
#define TRANSPORT_TYPE_LPC
Definition: rpcdcep.h:137
#define RPC_S_OUT_OF_MEMORY
Definition: rpcnterr.h:24
#define RPC_S_OK
Definition: rpcnterr.h:22
RPC_STATUS WINAPI UuidCreateNil(UUID *Uuid)
Definition: rpcrt4_main.c:309
RPC_STATUS WINAPI UuidToStringA(UUID *Uuid, RPC_CSTR *StringUuid)
Definition: rpcrt4_main.c:539
int WINAPI UuidIsNil(UUID *Uuid, RPC_STATUS *Status)
Definition: rpcrt4_main.c:293
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:181
RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR *String)
Definition: rpcrt4_main.c:164
RPC_STATUS WINAPI UuidFromStringW(RPC_WSTR s, UUID *uuid)
Definition: rpcrt4_main.c:655
RPC_STATUS WINAPI UuidFromStringA(RPC_CSTR s, UUID *uuid)
Definition: rpcrt4_main.c:615
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
_Check_return_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)
_Check_return_ _CRTIMP wchar_t *__cdecl wcsdup(_In_z_ const wchar_t *_Str)
#define RPC_ENTRY
Definition: rpc.h:63
long RPC_STATUS
Definition: rpc.h:48
#define RPCRTAPI
Definition: rpc.h:78
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
Definition: socklife.c:36
#define TRACE(s)
Definition: solgame.cpp:4
SECURITY_STATUS WINAPI EnumerateSecurityPackagesW(PULONG pcPackages, PSecPkgInfoW *ppPackageInfo)
Definition: sspi.c:709
SECURITY_STATUS WINAPI FreeContextBuffer(PVOID pv)
Definition: sspi.c:699
SECURITY_STATUS WINAPI EnumerateSecurityPackagesA(PULONG pcPackages, PSecPkgInfoA *ppPackageInfo)
Definition: sspi.c:855
SEC_WINNT_AUTH_IDENTITY_A * TransportCredentials
Definition: rpcdce.h:255
unsigned char * ServerCertificateSubject
Definition: rpcdce.h:260
SEC_WINNT_AUTH_IDENTITY_W * TransportCredentials
Definition: rpcdce.h:245
unsigned short * ServerCertificateSubject
Definition: rpcdce.h:250
ULONG AdditionalSecurityInfoType
Definition: rpcdce.h:289
union _RPC_SECURITY_QOS_V2_A::@3415 u
RPC_HTTP_TRANSPORT_CREDENTIALS_A * HttpCredentials
Definition: rpcdce.h:292
union _RPC_SECURITY_QOS_V2_W::@3414 u
RPC_HTTP_TRANSPORT_CREDENTIALS_W * HttpCredentials
Definition: rpcdce.h:279
ULONG AdditionalSecurityInfoType
Definition: rpcdce.h:276
ULONG ImpersonationType
Definition: rpcdce.h:267
ULONG Capabilities
Definition: rpcdce.h:265
ULONG IdentityTracking
Definition: rpcdce.h:266
RPC_AUTH_IDENTITY_HANDLE * identity
Definition: rpc_binding.h:46
ULONG AuthnLevel
Definition: rpc_binding.h:40
ULONG AuthnSvc
Definition: rpc_binding.h:41
TimeStamp exp
Definition: rpc_binding.h:43
CredHandle cred
Definition: rpc_binding.h:42
SEC_WINNT_AUTH_IDENTITY_W * nt_identity
Definition: rpc_binding.h:49
ULONG cbMaxToken
Definition: rpc_binding.h:44
LPWSTR server_principal_name
Definition: rpc_binding.h:50
RPC_BLOCKING_FN BlockingFn
Definition: rpc_binding.h:135
LPSTR NetworkAddr
Definition: rpc_binding.h:132
LPWSTR NetworkOptions
Definition: rpc_binding.h:134
LPWSTR CookieAuth
Definition: rpc_binding.h:143
RpcConnection * FromConn
Definition: rpc_binding.h:137
RpcAuthInfo * AuthInfo
Definition: rpc_binding.h:141
LPSTR Endpoint
Definition: rpc_binding.h:133
LPSTR Protseq
Definition: rpc_binding.h:131
struct _RpcAssoc * Assoc
Definition: rpc_binding.h:138
UUID ObjectUuid
Definition: rpc_binding.h:130
RpcQualityOfService * QOS
Definition: rpc_binding.h:142
LPSTR NetworkAddr
Definition: rpc_binding.h:67
const struct connection_ops * ops
Definition: rpc_binding.h:70
RPC_SECURITY_QOS_V2_W * qos
Definition: rpc_binding.h:57
unsigned char * Domain
Definition: rpcdce.h:236
unsigned char * User
Definition: rpcdce.h:234
unsigned char * Password
Definition: rpcdce.h:238
unsigned short * Domain
Definition: rpcdce.h:225
unsigned short * User
Definition: rpcdce.h:223
unsigned short * Password
Definition: rpcdce.h:227
ULONG cbMaxToken
Definition: sspi.h:107
ULONG cbMaxToken
Definition: sspi.h:117
Definition: cookie.c:34
Definition: ps.c:97
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1147
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
static rfbScreenInfoPtr server
Definition: vnc.c:74
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3540
#define WINAPI
Definition: msvc.h:6
#define SEC_E_OK
Definition: winerror.h:3450
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1388
#define RPC_S_WRONG_KIND_OF_BINDING
Definition: winerror.h:1368
#define RPC_S_NO_CALL_ACTIVE
Definition: winerror.h:1392
#define RPC_S_INVALID_STRING_BINDING
Definition: winerror.h:1367
#define RPC_S_BINDING_HAS_NO_AUTH
Definition: winerror.h:1411
#define RPC_S_UNKNOWN_AUTHN_LEVEL
Definition: winerror.h:1413
#define RPC_S_UNKNOWN_AUTHN_SERVICE
Definition: winerror.h:1412
#define RPC_S_INTERNAL_ERROR
Definition: winerror.h:1431
#define RPC_S_SEC_PKG_ERROR
Definition: winerror.h:1489
#define RPC_S_INVALID_BINDING
Definition: winerror.h:1369
#define RPC_S_UNKNOWN_AUTHZ_SERVICE
Definition: winerror.h:1415
SECURITY_STATUS WINAPI AcquireCredentialsHandleW(SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialsUse, PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
Definition: wrapper.c:105
SECURITY_STATUS WINAPI AcquireCredentialsHandleA(SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialsUse, PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
Definition: wrapper.c:59
SECURITY_STATUS WINAPI FreeCredentialsHandle(PCredHandle phCredential)
Definition: wrapper.c:151
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
const char * LPCSTR
Definition: xmlstorage.h:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
char * LPSTR
Definition: xmlstorage.h:182