ReactOS 0.4.16-dev-1946-g52006dd
rpc_server.c
Go to the documentation of this file.
1/*
2 * RPC server API
3 *
4 * Copyright 2001 Ove Kåven, TransGaming Technologies
5 * Copyright 2004 Filip Navara
6 * Copyright 2006-2008 Robert Shearman (for CodeWeavers)
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 */
22
23#include <stdarg.h>
24#include <stdio.h>
25#include <stdlib.h>
26#include <string.h>
27#include <assert.h>
28
29#include "windef.h"
30#include "winbase.h"
31#include "winerror.h"
32
33#include "rpc.h"
34#include "rpcndr.h"
35#include "excpt.h"
36
37#include "wine/debug.h"
38#include "wine/exception.h"
39
40#include "rpc_server.h"
41#include "rpc_assoc.h"
42#include "rpc_message.h"
43#include "rpc_defs.h"
44#include "ncastatus.h"
45#include "secext.h"
46
48
49typedef struct _RpcPacket
50{
54 unsigned char *auth_data;
57
58typedef struct _RpcObjTypeMap
59{
60 /* FIXME: a hash table would be better. */
65
67
68/* list of type RpcServerProtseq */
72
75{
76 0, 0, &server_cs,
78 0, 0, { (DWORD_PTR)(__FILE__ ": server_cs") }
79};
80static CRITICAL_SECTION server_cs = { &server_cs_debug, -1, 0, 0, 0, 0 };
81
84{
85 0, 0, &listen_cs,
87 0, 0, { (DWORD_PTR)(__FILE__ ": listen_cs") }
88};
89static CRITICAL_SECTION listen_cs = { &listen_cs_debug, -1, 0, 0, 0, 0 };
90
93{
96 0, 0, { (DWORD_PTR)(__FILE__ ": server_auth_info_cs") }
97};
99
100/* whether the server is currently listening */
102/* total listeners including auto listeners */
104/* event set once all manual listening is finished */
106
108
109static inline RpcObjTypeMap *LookupObjTypeMap(UUID *ObjUuid)
110{
113
114 while (rslt) {
115 if (! UuidCompare(ObjUuid, &rslt->Object, &dummy)) break;
116 rslt = rslt->next;
117 }
118
119 return rslt;
120}
121
122static inline UUID *LookupObjType(UUID *ObjUuid)
123{
125 if (map)
126 return &map->Type;
127 else
128 return &uuid_nil;
129}
130
132 const RPC_SYNTAX_IDENTIFIER *if_id,
133 const RPC_SYNTAX_IDENTIFIER *transfer_syntax,
134 BOOL check_object)
135{
136 UUID* MgrType = NULL;
139
140 if (check_object)
141 MgrType = LookupObjType(object);
144 if (!memcmp(if_id, &cif->If->InterfaceId, sizeof(RPC_SYNTAX_IDENTIFIER)) &&
145 (!transfer_syntax || !memcmp(transfer_syntax, &cif->If->TransferSyntax, sizeof(RPC_SYNTAX_IDENTIFIER))) &&
146 (check_object == FALSE || UuidEqual(MgrType, &cif->MgrTypeUuid, &status)) &&
147 std_listen) {
149 break;
150 }
151 }
153 if (&cif->entry == &server_interfaces) cif = NULL;
154 TRACE("returning %p for object %s, if_id { %d.%d %s }\n", cif,
157 return cif;
158}
159
161{
163 sif->Delete) {
164 /* sif must have been removed from server_interfaces before
165 * CallsCompletedEvent is set */
166 if (sif->CallsCompletedEvent)
168 free(sif);
169 }
170}
171
173{
174 unsigned int reject_reason;
175 switch (error)
176 {
178 reject_reason = REJECT_TEMPORARY_CONGESTION;
179 break;
182 reject_reason = REJECT_LOCAL_LIMIT_EXCEEDED;
183 break;
186 break;
188 reject_reason = REJECT_UNKNOWN_AUTHN_SERVICE;
189 break;
191 reject_reason = REJECT_INVALID_CHECKSUM;
192 break;
193 default:
194 FIXME("unexpected status value %ld\n", error);
195 /* fall through */
197 reject_reason = REJECT_REASON_NOT_SPECIFIED;
198 break;
199 }
202 reject_reason);
203}
204
207 unsigned char *auth_data, ULONG auth_length, RpcPktHdr **ack_response,
208 unsigned char **auth_data_out, ULONG *auth_length_out)
209{
211 RpcContextElement *ctxt_elem;
212 unsigned int i;
214
215 /* validate data */
216 for (i = 0, ctxt_elem = msg->Buffer;
217 i < hdr->num_elements;
218 i++, ctxt_elem = (RpcContextElement *)&ctxt_elem->transfer_syntaxes[ctxt_elem->num_syntaxes])
219 {
220 if (((char *)ctxt_elem - (char *)msg->Buffer) > msg->BufferLength ||
221 ((char *)&ctxt_elem->transfer_syntaxes[ctxt_elem->num_syntaxes] - (char *)msg->Buffer) > msg->BufferLength)
222 {
223 ERR("inconsistent data in packet - packet length %d, num elements %d\n",
224 msg->BufferLength, hdr->num_elements);
225 return RPC_S_INVALID_BOUND;
226 }
227 }
228
229 if (hdr->max_tsize < RPC_MIN_PACKET_SIZE ||
231 conn->server_binding)
232 {
233 TRACE("packet size less than min size, or active interface syntax guid non-null\n");
234
235 return RPC_S_INVALID_BOUND;
236 }
237
238 results = malloc(hdr->num_elements * sizeof(*results));
239 if (!results)
241
242 for (i = 0, ctxt_elem = (RpcContextElement *)msg->Buffer;
243 i < hdr->num_elements;
244 i++, ctxt_elem = (RpcContextElement *)&ctxt_elem->transfer_syntaxes[ctxt_elem->num_syntaxes])
245 {
247 unsigned int j;
248
249 for (j = 0; !sif && j < ctxt_elem->num_syntaxes; j++)
250 {
251 sif = RPCRT4_find_interface(NULL, &ctxt_elem->abstract_syntax,
252 &ctxt_elem->transfer_syntaxes[j], FALSE);
253 if (sif)
254 break;
255 }
256 if (sif)
257 {
259 TRACE("accepting bind request on connection %p for %s\n", conn,
261 results[i].result = RESULT_ACCEPT;
262 results[i].reason = REASON_NONE;
263 results[i].transfer_syntax = ctxt_elem->transfer_syntaxes[j];
264
265 /* save the interface for later use */
266 /* FIXME: save linked list */
267 conn->ActiveInterface = ctxt_elem->abstract_syntax;
268 }
269 else if ((sif = RPCRT4_find_interface(NULL, &ctxt_elem->abstract_syntax,
270 NULL, FALSE)) != NULL)
271 {
273 TRACE("not accepting bind request on connection %p for %s - no transfer syntaxes supported\n",
274 conn, debugstr_guid(&ctxt_elem->abstract_syntax.SyntaxGUID));
277 memset(&results[i].transfer_syntax, 0, sizeof(results[i].transfer_syntax));
278 }
279 else
280 {
281 TRACE("not accepting bind request on connection %p for %s - abstract syntax not supported\n",
282 conn, debugstr_guid(&ctxt_elem->abstract_syntax.SyntaxGUID));
285 memset(&results[i].transfer_syntax, 0, sizeof(results[i].transfer_syntax));
286 }
287 }
288
289 /* create temporary binding */
291 if (status != RPC_S_OK)
292 {
293 free(results);
294 return status;
295 }
296
298 conn->NetworkAddr, conn->Endpoint,
299 conn->NetworkOptions,
300 hdr->assoc_gid,
301 &conn->server_binding->Assoc);
302 if (status != RPC_S_OK)
303 {
304 free(results);
305 return status;
306 }
307
308 if (auth_length)
309 {
311 (RpcAuthVerifier *)auth_data,
312 auth_length, auth_data_out,
313 auth_length_out);
314 if (status != RPC_S_OK)
315 {
316 free(results);
317 return status;
318 }
319 }
320
324 conn->server_binding->Assoc->assoc_group_id,
325 conn->Endpoint, hdr->num_elements,
326 results);
327 free(results);
328
329 if (*ack_response)
330 conn->MaxTransmissionSize = hdr->max_tsize;
331 else
333
334 return status;
335}
336
339 unsigned char *auth_data,
340 ULONG auth_length)
341{
343 RpcPktHdr *response = NULL;
344 unsigned char *auth_data_out = NULL;
345 ULONG auth_length_out = 0;
346
347 status = process_bind_packet_no_send(conn, hdr, msg, auth_data, auth_length,
348 &response, &auth_data_out,
349 &auth_length_out);
350 if (status != RPC_S_OK)
351 response = handle_bind_error(conn, status);
352 if (response)
353 status = RPCRT4_SendWithAuth(conn, response, NULL, 0, auth_data_out, auth_length_out);
354 else
356 free(response);
357
358 return status;
359}
360
361
363{
365 RpcPktHdr *response = NULL;
369 UUID *object_uuid;
370 NDR_SCONTEXT context_handle;
371 void *buf = msg->Buffer;
372
373 /* fail if the connection isn't bound with an interface */
375 /* FIXME: should send BindNack instead */
377 status);
378
379 RPCRT4_Send(conn, response, NULL, 0);
380 free(response);
381 return RPC_S_OK;
382 }
383
384 if (hdr->common.flags & RPC_FLG_OBJECT_UUID) {
385 object_uuid = (UUID*)(hdr + 1);
386 } else {
387 object_uuid = NULL;
388 }
389
390 sif = RPCRT4_find_interface(object_uuid, &conn->ActiveInterface, NULL, TRUE);
391 if (!sif) {
392 WARN("interface %s no longer registered, returning fault packet\n", debugstr_guid(&conn->ActiveInterface.SyntaxGUID));
395
396 RPCRT4_Send(conn, response, NULL, 0);
397 free(response);
398 return RPC_S_OK;
399 }
400 msg->RpcInterfaceInformation = sif->If;
401 /* copy the endpoint vector from sif to msg so that midl-generated code will use it */
402 msg->ManagerEpv = sif->MgrEpv;
403 if (object_uuid != NULL) {
404 RPCRT4_SetBindingObject(msg->Handle, object_uuid);
405 }
406
407 /* find dispatch function */
408 msg->ProcNum = hdr->opnum;
409 if (sif->Flags & RPC_IF_OLE) {
410 /* native ole32 always gives us a dispatch table with a single entry
411 * (I assume that's a wrapper for IRpcStubBuffer::Invoke) */
413 } else {
414 if (msg->ProcNum >= sif->If->DispatchTable->DispatchTableCount) {
415 WARN("invalid procnum (%d/%d)\n", msg->ProcNum, sif->If->DispatchTable->DispatchTableCount);
418
419 RPCRT4_Send(conn, response, NULL, 0);
420 free(response);
421 }
422 func = sif->If->DispatchTable->DispatchTable[msg->ProcNum];
423 }
424
425 /* put in the drep. FIXME: is this more universally applicable?
426 perhaps we should move this outward... */
427 msg->DataRepresentation =
428 MAKELONG( MAKEWORD(hdr->common.drep[0], hdr->common.drep[1]),
429 MAKEWORD(hdr->common.drep[2], hdr->common.drep[3]));
430
432
433 /* dispatch */
435 __TRY {
436 if (func) func(msg);
437 } __EXCEPT_ALL {
438 WARN("exception caught with code 0x%08lx = %ld\n", GetExceptionCode(), GetExceptionCode());
439 exception = TRUE;
442 else
444 response = RPCRT4_BuildFaultHeader(msg->DataRepresentation,
446 } __ENDTRY
448
449 /* release any unmarshalled context handles */
450 while ((context_handle = RPCRT4_PopThreadContextHandle()) != NULL)
451 RpcServerAssoc_ReleaseContextHandle(conn->server_binding->Assoc, context_handle, TRUE);
452
453 if (!exception)
454 response = RPCRT4_BuildResponseHeader(msg->DataRepresentation,
455 msg->BufferLength);
456
457 /* send response packet */
458 if (response) {
459 status = RPCRT4_Send(conn, response, exception ? NULL : msg->Buffer,
460 exception ? 0 : msg->BufferLength);
461 free(response);
462 } else
463 ERR("out of memory\n");
464
465 msg->RpcInterfaceInformation = NULL;
467
468 if (msg->Buffer == buf) buf = NULL;
469 TRACE("freeing Buffer=%p\n", buf);
470 I_RpcFree(buf);
471
472 return status;
473}
474
478 unsigned char *auth_data,
479 ULONG auth_length)
480{
482
484 !auth_length || msg->BufferLength != 0)
486 else
487 {
489 (RpcAuthVerifier *)auth_data,
490 auth_length, NULL, NULL);
491 }
492
493 /* FIXME: client doesn't expect a response to this message so must store
494 * status in connection so that fault packet can be returned when next
495 * packet is received */
496
497 return RPC_S_OK;
498}
499
501 RPC_MESSAGE* msg, unsigned char *auth_data,
502 ULONG auth_length)
503{
504 msg->Handle = (RPC_BINDING_HANDLE)conn->server_binding;
505
506 switch (hdr->common.ptype) {
507 case PKT_BIND:
508 TRACE("got bind packet\n");
509 process_bind_packet(conn, &hdr->bind, msg, auth_data, auth_length);
510 break;
511
512 case PKT_REQUEST:
513 TRACE("got request packet\n");
514 process_request_packet(conn, &hdr->request, msg);
515 break;
516
517 case PKT_AUTH3:
518 TRACE("got auth3 packet\n");
519 process_auth3_packet(conn, &hdr->common, msg, auth_data, auth_length);
520 break;
521 default:
522 FIXME("unhandled packet type %u\n", hdr->common.ptype);
523 break;
524 }
525
526 /* clean up */
527 I_RpcFree(msg->Buffer);
528 free(hdr);
529 free(msg);
530 free(auth_data);
531}
532
534{
535 RpcPacket *pkt = the_arg;
536 RPCRT4_process_packet(pkt->conn, pkt->hdr, pkt->msg, pkt->auth_data,
537 pkt->auth_length);
539 free(pkt);
540 return 0;
541}
542
544{
545 RpcConnection* conn = the_arg;
546 RpcPktHdr *hdr;
550 unsigned char *auth_data;
551 ULONG auth_length;
552
553 TRACE("(%p)\n", conn);
554 SetThreadDescription(GetCurrentThread(), L"wine_rpcrt4_io");
555
556 for (;;) {
557 msg = calloc(1, sizeof(RPC_MESSAGE));
558 if (!msg) break;
559
560 status = RPCRT4_ReceiveWithAuth(conn, &hdr, msg, &auth_data, &auth_length);
561 if (status != RPC_S_OK) {
562 WARN("receive failed with error %lx\n", status);
563 free(msg);
564 break;
565 }
566
567 switch (hdr->common.ptype) {
568 case PKT_BIND:
569 TRACE("got bind packet\n");
570
571 status = process_bind_packet(conn, &hdr->bind, msg, auth_data,
572 auth_length);
573 break;
574
575 case PKT_REQUEST:
576 TRACE("got request packet\n");
577
578 packet = malloc(sizeof(RpcPacket));
579 if (!packet) {
580 I_RpcFree(msg->Buffer);
581 free(hdr);
582 free(msg);
583 free(auth_data);
584 goto exit;
585 }
586 packet->conn = RPCRT4_GrabConnection( conn );
587 packet->hdr = hdr;
588 packet->msg = msg;
589 packet->auth_data = auth_data;
590 packet->auth_length = auth_length;
592 ERR("couldn't queue work item for worker thread, error was %ld\n", GetLastError());
593 free(packet);
595 } else {
596 continue;
597 }
598 break;
599
600 case PKT_AUTH3:
601 TRACE("got auth3 packet\n");
602
603 status = process_auth3_packet(conn, &hdr->common, msg, auth_data,
604 auth_length);
605 break;
606 default:
607 FIXME("unhandled packet type %u\n", hdr->common.ptype);
608 break;
609 }
610
611 I_RpcFree(msg->Buffer);
612 free(hdr);
613 free(msg);
614 free(auth_data);
615
616 if (status != RPC_S_OK) {
617 WARN("processing packet failed with error %lu\n", status);
618 break;
619 }
620 }
621exit:
623 return 0;
624}
625
627{
629 if (!thread) {
631 ERR("failed to create thread, error=%08lx\n", err);
633 }
634 /* we could set conn->thread, but then we'd have to make the io_thread wait
635 * for that, otherwise the thread might finish, destroy the connection, and
636 * free the memory we'd write to before we did, causing crashes and stuff -
637 * so let's implement that later, when we really need conn->thread */
638
640}
641
643{
644 int res;
645 unsigned int count;
646 void *objs = NULL;
647 RpcServerProtseq* cps = the_arg;
648 RpcConnection* conn;
649 BOOL set_ready_event = FALSE;
650
651 TRACE("(the_arg == ^%p)\n", the_arg);
652 SetThreadDescription(GetCurrentThread(), L"wine_rpcrt4_server");
653
654 for (;;) {
655 objs = cps->ops->get_wait_array(cps, objs, &count);
656
657 if (set_ready_event)
658 {
659 /* signal to function that changed state that we are now sync'ed */
661 set_ready_event = FALSE;
662 }
663
664 /* start waiting */
665 res = cps->ops->wait_for_new_connection(cps, count, objs);
666
667 if (res == -1 || (res == 0 && !std_listen))
668 {
669 /* cleanup */
670 cps->ops->free_wait_array(cps, objs);
671 break;
672 }
673 else if (res == 0)
674 set_ready_event = TRUE;
675 }
676
677 TRACE("closing connections\n");
678
680 LIST_FOR_EACH_ENTRY(conn, &cps->listeners, RpcConnection, protseq_entry)
682 LIST_FOR_EACH_ENTRY(conn, &cps->connections, RpcConnection, protseq_entry)
683 {
686 }
688
689 if (res == 0 && !std_listen)
691
692 TRACE("waiting for active connections to close\n");
693
695 while (!list_empty(&cps->connections))
696 {
697 conn = LIST_ENTRY(list_head(&cps->connections), RpcConnection, protseq_entry);
701 }
703
704 TRACE("done\n");
705 return 0;
706}
707
708/* tells the server thread that the state has changed and waits for it to
709 * make the changes */
711{
712 /* make sure we are the only thread sync'ing the server state, otherwise
713 * there is a race with the server thread setting an older state and setting
714 * the server_ready_event when the new state hasn't yet been applied */
716
717 ps->ops->signal_state_changed(ps);
718
719 /* wait for server thread to make the requested changes before returning */
721
723}
724
726{
728
730 if (ps->server_thread) goto done;
731
732 if (!ps->mgr_mutex) ps->mgr_mutex = CreateMutexW(NULL, FALSE, NULL);
735 if (!ps->server_thread)
737
738done:
740 return status;
741}
742
744{
746 RpcServerProtseq *cps;
747
748 TRACE("\n");
749
751 if (auto_listen || !listen_done_event)
752 {
754 if(!auto_listen)
756 if (++listen_count == 1)
758 }
760 if (status) return status;
761
762 if (std_listen)
763 {
766 {
768 if (status != RPC_S_OK)
769 break;
770
771 /* make sure server is actually listening on the interface before
772 * returning */
774 }
776 }
777
778 return status;
779}
780
782{
783 BOOL stop_listen = FALSE;
785
787 if (!std_listen && (auto_listen || !listen_done_event))
788 {
790 }
791 else
792 {
793 stop_listen = listen_count != 0 && --listen_count == 0;
794 assert(listen_count >= 0);
795 if (stop_listen)
797 }
799
800 if (status) return status;
801
802 if (stop_listen) {
803 RpcServerProtseq *cps;
808 }
809
810 if (!auto_listen)
811 {
815 }
816 return RPC_S_OK;
817}
818
820{
821 RpcConnection *conn;
822 BOOL registered = FALSE;
823 EnterCriticalSection(&protseq->cs);
824 LIST_FOR_EACH_ENTRY(conn, &protseq->listeners, RpcConnection, protseq_entry) {
825 if (!endpoint || !strcmp(endpoint, conn->Endpoint)) {
826 registered = TRUE;
827 break;
828 }
829 }
830 LeaveCriticalSection(&protseq->cs);
831 return registered;
832}
833
835{
837
839
842 else
843 status = ps->ops->open_endpoint(ps, endpoint);
844
846
847 if (status != RPC_S_OK)
848 return status;
849
850 if (std_listen)
851 {
853 if (status == RPC_S_OK)
855 }
856
857 return status;
858}
859
860/***********************************************************************
861 * RpcServerInqBindings (RPCRT4.@)
862 */
864{
866 DWORD count;
868 RpcConnection* conn;
869
870 if (BindingVector)
871 TRACE("(*BindingVector == ^%p)\n", *BindingVector);
872 else
873 ERR("(BindingVector == NULL!!?)\n");
874
876 /* count connections */
877 count = 0;
880 LIST_FOR_EACH_ENTRY(conn, &ps->listeners, RpcConnection, protseq_entry)
881 count++;
883 }
884 if (count) {
885 /* export bindings */
886 *BindingVector = malloc(sizeof(RPC_BINDING_VECTOR) + sizeof(RPC_BINDING_HANDLE) * (count - 1));
887 (*BindingVector)->Count = count;
888 count = 0;
891 LIST_FOR_EACH_ENTRY(conn, &ps->listeners, RpcConnection, protseq_entry) {
892 RPCRT4_MakeBinding((RpcBinding**)&(*BindingVector)->BindingH[count],
893 conn);
894 count++;
895 }
897 }
899 } else {
900 *BindingVector = NULL;
902 }
904 return status;
905}
906
907/***********************************************************************
908 * RpcServerUseProtseqEpA (RPCRT4.@)
909 */
911{
913
914 TRACE( "(%s,%u,%s,%p)\n", Protseq, MaxCalls, Endpoint, SecurityDescriptor );
915
916 /* This should provide the default behaviour */
917 policy.Length = sizeof( policy );
918 policy.EndpointFlags = 0;
919 policy.NICFlags = 0;
920
921 return RpcServerUseProtseqEpExA( Protseq, MaxCalls, Endpoint, SecurityDescriptor, &policy );
922}
923
924/***********************************************************************
925 * RpcServerUseProtseqEpW (RPCRT4.@)
926 */
928{
930
931 TRACE( "(%s,%u,%s,%p)\n", debugstr_w( Protseq ), MaxCalls, debugstr_w( Endpoint ), SecurityDescriptor );
932
933 /* This should provide the default behaviour */
934 policy.Length = sizeof( policy );
935 policy.EndpointFlags = 0;
936 policy.NICFlags = 0;
937
938 return RpcServerUseProtseqEpExW( Protseq, MaxCalls, Endpoint, SecurityDescriptor, &policy );
939}
940
941/***********************************************************************
942 * alloc_serverprotoseq (internal)
943 *
944 * Must be called with server_cs held.
945 */
946static RPC_STATUS alloc_serverprotoseq(UINT MaxCalls, const char *Protseq, RpcServerProtseq **ps)
947{
948 const struct protseq_ops *ops = rpcrt4_get_protseq_ops(Protseq);
949
950 if (!ops)
951 {
952 FIXME("protseq %s not supported\n", debugstr_a(Protseq));
954 }
955
956 *ps = ops->alloc();
957 if (!*ps)
959 (*ps)->MaxCalls = MaxCalls;
960 (*ps)->Protseq = strdup(Protseq);
961 (*ps)->ops = ops;
962 list_init(&(*ps)->listeners);
963 list_init(&(*ps)->connections);
965 (*ps)->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": RpcServerProtseq.cs");
966
967 list_add_head(&protseqs, &(*ps)->entry);
968
969 TRACE("new protseq %p created for %s\n", *ps, Protseq);
970
971 return RPC_S_OK;
972}
973
974/* must be called with server_cs held */
976{
977 free(ps->Protseq);
978 ps->cs.DebugInfo->Spare[0] = 0;
982 list_remove(&ps->entry);
983 free(ps);
984}
985
986/* Finds a given protseq or creates a new one if one doesn't already exist */
987static RPC_STATUS RPCRT4_get_or_create_serverprotseq(UINT MaxCalls, const char *Protseq, RpcServerProtseq **ps)
988{
990 RpcServerProtseq *cps;
991
993
995 if (!strcmp(cps->Protseq, Protseq))
996 {
997 TRACE("found existing protseq object for %s\n", Protseq);
998 *ps = cps;
1000 return S_OK;
1001 }
1002
1003 status = alloc_serverprotoseq(MaxCalls, Protseq, ps);
1004
1006
1007 return status;
1008}
1009
1010/***********************************************************************
1011 * RpcServerUseProtseqEpExA (RPCRT4.@)
1012 */
1014 PRPC_POLICY lpPolicy )
1015{
1016 RpcServerProtseq* ps;
1018
1019 TRACE("(%s,%u,%s,%p,{%u,%lu,%lu})\n", debugstr_a((const char *)Protseq),
1020 MaxCalls, debugstr_a((const char *)Endpoint), SecurityDescriptor,
1021 lpPolicy->Length, lpPolicy->EndpointFlags, lpPolicy->NICFlags );
1022
1023 status = RPCRT4_get_or_create_serverprotseq(MaxCalls, (const char *)Protseq, &ps);
1024 if (status != RPC_S_OK)
1025 return status;
1026
1027 return RPCRT4_use_protseq(ps, (const char *)Endpoint);
1028}
1029
1030/***********************************************************************
1031 * RpcServerUseProtseqEpExW (RPCRT4.@)
1032 */
1034 PRPC_POLICY lpPolicy )
1035{
1036 RpcServerProtseq* ps;
1038 LPSTR ProtseqA;
1039 LPSTR EndpointA;
1040
1041 TRACE("(%s,%u,%s,%p,{%u,%lu,%lu})\n", debugstr_w( Protseq ), MaxCalls,
1042 debugstr_w( Endpoint ), SecurityDescriptor,
1043 lpPolicy->Length, lpPolicy->EndpointFlags, lpPolicy->NICFlags );
1044
1045 ProtseqA = RPCRT4_strdupWtoA(Protseq);
1046 status = RPCRT4_get_or_create_serverprotseq(MaxCalls, ProtseqA, &ps);
1047 free(ProtseqA);
1048 if (status != RPC_S_OK)
1049 return status;
1050
1051 EndpointA = RPCRT4_strdupWtoA(Endpoint);
1052 status = RPCRT4_use_protseq(ps, EndpointA);
1053 free(EndpointA);
1054 return status;
1055}
1056
1057/***********************************************************************
1058 * RpcServerUseProtseqA (RPCRT4.@)
1059 */
1061{
1063 RpcServerProtseq* ps;
1064
1065 TRACE("(Protseq == %s, MaxCalls == %d, SecurityDescriptor == ^%p)\n", debugstr_a((char*)Protseq), MaxCalls, SecurityDescriptor);
1066
1067 status = RPCRT4_get_or_create_serverprotseq(MaxCalls, (const char *)Protseq, &ps);
1068 if (status != RPC_S_OK)
1069 return status;
1070
1071 return RPCRT4_use_protseq(ps, NULL);
1072}
1073
1074/***********************************************************************
1075 * RpcServerUseProtseqW (RPCRT4.@)
1076 */
1078{
1080 RpcServerProtseq* ps;
1081 LPSTR ProtseqA;
1082
1083 TRACE("Protseq == %s, MaxCalls == %d, SecurityDescriptor == ^%p)\n", debugstr_w(Protseq), MaxCalls, SecurityDescriptor);
1084
1085 ProtseqA = RPCRT4_strdupWtoA(Protseq);
1086 status = RPCRT4_get_or_create_serverprotseq(MaxCalls, ProtseqA, &ps);
1087 free(ProtseqA);
1088 if (status != RPC_S_OK)
1089 return status;
1090
1091 return RPCRT4_use_protseq(ps, NULL);
1092}
1093
1095{
1096 RpcServerProtseq *cps, *cursor2;
1097
1098 if (listen_count != 0)
1099 std_listen = FALSE;
1100
1103 {
1104 if (listen_count != 0)
1107 }
1111}
1112
1113/***********************************************************************
1114 * RpcServerRegisterIf (RPCRT4.@)
1115 */
1117{
1118 TRACE("(%p,%s,%p)\n", IfSpec, debugstr_guid(MgrTypeUuid), MgrEpv);
1119 return RpcServerRegisterIf3( IfSpec, MgrTypeUuid, MgrEpv, 0, RPC_C_LISTEN_MAX_CALLS_DEFAULT, (UINT)-1, NULL, NULL );
1120}
1121
1122/***********************************************************************
1123 * RpcServerRegisterIfEx (RPCRT4.@)
1124 */
1126 UINT Flags, UINT MaxCalls, RPC_IF_CALLBACK_FN* IfCallbackFn )
1127{
1128 TRACE("(%p,%s,%p,%u,%u,%p)\n", IfSpec, debugstr_guid(MgrTypeUuid), MgrEpv, Flags, MaxCalls, IfCallbackFn);
1129 return RpcServerRegisterIf3( IfSpec, MgrTypeUuid, MgrEpv, Flags, MaxCalls, (UINT)-1, IfCallbackFn, NULL );
1130}
1131
1132/***********************************************************************
1133 * RpcServerRegisterIf2 (RPCRT4.@)
1134 */
1136 UINT Flags, UINT MaxCalls, UINT MaxRpcSize, RPC_IF_CALLBACK_FN* IfCallbackFn )
1137{
1138 return RpcServerRegisterIf3( IfSpec, MgrTypeUuid, MgrEpv, Flags, MaxCalls, MaxRpcSize, IfCallbackFn, NULL );
1139}
1140
1141/***********************************************************************
1142 * RpcServerRegisterIf3 (RPCRT4.@)
1143 */
1145 UINT Flags, UINT MaxCalls, UINT MaxRpcSize, RPC_IF_CALLBACK_FN* IfCallbackFn, void* SecurityDescriptor)
1146{
1147 PRPC_SERVER_INTERFACE If = IfSpec;
1148 RpcServerInterface* sif;
1149 unsigned int i;
1150
1151 TRACE("(%p,%s,%p,%u,%u,%u,%p,%p)\n", IfSpec, debugstr_guid(MgrTypeUuid), MgrEpv, Flags, MaxCalls,
1152 MaxRpcSize, IfCallbackFn, SecurityDescriptor);
1153
1155 FIXME("Unsupported SecurityDescriptor argument.\n");
1156
1157 TRACE(" interface id: %s %d.%d\n", debugstr_guid(&If->InterfaceId.SyntaxGUID),
1160 TRACE(" transfer syntax: %s %d.%d\n", debugstr_guid(&If->TransferSyntax.SyntaxGUID),
1163 TRACE(" dispatch table: %p\n", If->DispatchTable);
1164 if (If->DispatchTable) {
1165 TRACE(" dispatch table count: %d\n", If->DispatchTable->DispatchTableCount);
1166 for (i=0; i<If->DispatchTable->DispatchTableCount; i++) {
1167 TRACE(" entry %d: %p\n", i, If->DispatchTable->DispatchTable[i]);
1168 }
1169 TRACE(" reserved: %Id\n", If->DispatchTable->Reserved);
1170 }
1171 TRACE(" protseq endpoint count: %d\n", If->RpcProtseqEndpointCount);
1172 TRACE(" default manager epv: %p\n", If->DefaultManagerEpv);
1173 TRACE(" interpreter info: %p\n", If->InterpreterInfo);
1174
1175 sif = calloc(1, sizeof(RpcServerInterface));
1176 sif->If = If;
1177 if (MgrTypeUuid) {
1178 sif->MgrTypeUuid = *MgrTypeUuid;
1179 sif->MgrEpv = MgrEpv;
1180 } else {
1181 memset(&sif->MgrTypeUuid, 0, sizeof(UUID));
1182 sif->MgrEpv = If->DefaultManagerEpv;
1183 }
1184 sif->Flags = Flags;
1185 sif->MaxCalls = MaxCalls;
1186 sif->MaxRpcSize = MaxRpcSize;
1187 sif->IfCallbackFn = IfCallbackFn;
1188
1192
1193 if (sif->Flags & RPC_IF_AUTOLISTEN)
1195
1196 return RPC_S_OK;
1197}
1198
1199/***********************************************************************
1200 * RpcServerUnregisterIf (RPCRT4.@)
1201 */
1202RPC_STATUS WINAPI RpcServerUnregisterIf( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, UINT WaitForCallsToComplete )
1203{
1204 PRPC_SERVER_INTERFACE If = IfSpec;
1205 HANDLE event = NULL;
1206 BOOL found = FALSE;
1207 BOOL completed = TRUE;
1208 RpcServerInterface *cif;
1210
1211 TRACE("(IfSpec == (RPC_IF_HANDLE)^%p (%s), MgrTypeUuid == %s, WaitForCallsToComplete == %u)\n",
1212 IfSpec, debugstr_guid(&If->InterfaceId.SyntaxGUID), debugstr_guid(MgrTypeUuid), WaitForCallsToComplete);
1213
1216 if (((!IfSpec && !(cif->Flags & RPC_IF_AUTOLISTEN)) ||
1217 (IfSpec && !memcmp(&If->InterfaceId, &cif->If->InterfaceId, sizeof(RPC_SYNTAX_IDENTIFIER)))) &&
1218 UuidEqual(MgrTypeUuid, &cif->MgrTypeUuid, &status)) {
1219 list_remove(&cif->entry);
1220 TRACE("unregistering cif %p\n", cif);
1221 if (cif->CurrentCalls) {
1222 completed = FALSE;
1223 cif->Delete = TRUE;
1224 if (WaitForCallsToComplete)
1226 }
1227 found = TRUE;
1228 break;
1229 }
1230 }
1232
1233 if (!found) {
1234 ERR("not found for object %s\n", debugstr_guid(MgrTypeUuid));
1235 return RPC_S_UNKNOWN_IF;
1236 }
1237
1238 if (completed)
1239 free(cif);
1240 else if (event) {
1241 /* sif will be freed when the last call is completed, so be careful not to
1242 * touch that memory here as that could happen before we get here */
1245 }
1246
1247 return RPC_S_OK;
1248}
1249
1250/***********************************************************************
1251 * RpcServerUnregisterIfEx (RPCRT4.@)
1252 */
1253RPC_STATUS WINAPI RpcServerUnregisterIfEx( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, int RundownContextHandles )
1254{
1255 FIXME("(IfSpec == (RPC_IF_HANDLE)^%p, MgrTypeUuid == %s, RundownContextHandles == %d): stub\n",
1256 IfSpec, debugstr_guid(MgrTypeUuid), RundownContextHandles);
1257
1258 return RPC_S_OK;
1259}
1260
1261/***********************************************************************
1262 * RpcObjectSetType (RPCRT4.@)
1263 *
1264 * PARAMS
1265 * ObjUuid [I] "Object" UUID
1266 * TypeUuid [I] "Type" UUID
1267 *
1268 * RETURNS
1269 * RPC_S_OK The call succeeded
1270 * RPC_S_INVALID_OBJECT The provided object (nil) is not valid
1271 * RPC_S_ALREADY_REGISTERED The provided object is already registered
1272 *
1273 * Maps "Object" UUIDs to "Type" UUIDs. Passing the nil UUID as the type
1274 * resets the mapping for the specified object UUID to nil (the default).
1275 * The nil object is always associated with the nil type and cannot be
1276 * reassigned. Servers can support multiple implementations on the same
1277 * interface by registering different end-point vectors for the different
1278 * types. There's no need to call this if a server only supports the nil
1279 * type, as is typical.
1280 */
1282{
1285
1286 TRACE("(ObjUUID == %s, TypeUuid == %s).\n", debugstr_guid(ObjUuid), debugstr_guid(TypeUuid));
1287 if ((! ObjUuid) || UuidIsNil(ObjUuid, &dummy)) {
1288 /* nil uuid cannot be remapped */
1289 return RPC_S_INVALID_OBJECT;
1290 }
1291
1292 /* find the mapping for this object if there is one ... */
1293 while (map) {
1294 if (! UuidCompare(ObjUuid, &map->Object, &dummy)) break;
1295 prev = map;
1296 map = map->next;
1297 }
1298 if ((! TypeUuid) || UuidIsNil(TypeUuid, &dummy)) {
1299 /* ... and drop it from the list */
1300 if (map) {
1301 if (prev)
1302 prev->next = map->next;
1303 else
1304 RpcObjTypeMaps = map->next;
1305 free(map);
1306 }
1307 } else {
1308 /* ... , fail if we found it ... */
1309 if (map)
1311 /* ... otherwise create a new one and add it in. */
1312 map = malloc(sizeof(RpcObjTypeMap));
1313 map->Object = *ObjUuid;
1314 map->Type = *TypeUuid;
1315 map->next = NULL;
1316 if (prev)
1317 prev->next = map; /* prev is the last map in the linklist */
1318 else
1320 }
1321
1322 return RPC_S_OK;
1323}
1324
1326{
1327 struct list entry;
1332};
1333
1335{
1336 SECURITY_STATUS sec_status;
1337 SecPkgInfoW *packages;
1338 ULONG package_count;
1339 ULONG i;
1340
1341 sec_status = EnumerateSecurityPackagesW(&package_count, &packages);
1342 if (sec_status != SEC_E_OK)
1343 {
1344 ERR("EnumerateSecurityPackagesW failed with error 0x%08lx\n", sec_status);
1345 return RPC_S_SEC_PKG_ERROR;
1346 }
1347
1348 for (i = 0; i < package_count; i++)
1349 if (packages[i].wRPCID == auth_type)
1350 break;
1351
1352 if (i == package_count)
1353 {
1354 WARN("unsupported AuthnSvc %lu\n", auth_type);
1355 FreeContextBuffer(packages);
1357 }
1358
1359 TRACE("found package %s for service %lu\n", debugstr_w(packages[i].Name), auth_type);
1360 *packages_buf = packages;
1361 *ret = packages + i;
1362 return RPC_S_OK;
1363}
1364
1366 USHORT auth_type, CredHandle *cred, TimeStamp *exp, ULONG *max_token)
1367{
1369 struct rpc_server_registered_auth_info *auth_info;
1370 SECURITY_STATUS sec_status;
1371
1374 {
1375 if (auth_info->auth_type == auth_type)
1376 {
1377 sec_status = AcquireCredentialsHandleW((SEC_WCHAR *)auth_info->principal, auth_info->package_name,
1379 cred, exp);
1380 if (sec_status != SEC_E_OK)
1381 {
1383 break;
1384 }
1385
1386 *max_token = auth_info->max_token;
1387 status = RPC_S_OK;
1388 break;
1389 }
1390 }
1392
1393 return status;
1394}
1395
1397{
1398 struct rpc_server_registered_auth_info *auth_info, *cursor2;
1399
1402 {
1403 free(auth_info->package_name);
1404 free(auth_info->principal);
1405 free(auth_info);
1406 }
1409}
1410
1411/***********************************************************************
1412 * RpcServerRegisterAuthInfoA (RPCRT4.@)
1413 */
1415 LPVOID Arg )
1416{
1417 WCHAR *principal_name = NULL;
1419
1420 TRACE("(%s,%lu,%p,%p)\n", ServerPrincName, AuthnSvc, GetKeyFn, Arg);
1421
1422 if(ServerPrincName && !(principal_name = RPCRT4_strdupAtoW((const char*)ServerPrincName)))
1424
1425 status = RpcServerRegisterAuthInfoW(principal_name, AuthnSvc, GetKeyFn, Arg);
1426
1427 free(principal_name);
1428 return status;
1429}
1430
1431/***********************************************************************
1432 * RpcServerRegisterAuthInfoW (RPCRT4.@)
1433 */
1435 LPVOID Arg )
1436{
1437 struct rpc_server_registered_auth_info *auth_info;
1438 SecPkgInfoW *packages, *package;
1442
1443 TRACE("(%s,%lu,%p,%p)\n", debugstr_w(ServerPrincName), AuthnSvc, GetKeyFn, Arg);
1444
1445 status = find_security_package(AuthnSvc, &packages, &package);
1446 if (status != RPC_S_OK)
1447 return status;
1448
1449 package_name = wcsdup(package->Name);
1450 max_token = package->cbMaxToken;
1451 FreeContextBuffer(packages);
1452 if (!package_name)
1454
1455 auth_info = calloc(1, sizeof(*auth_info));
1456 if (!auth_info) {
1459 }
1460
1461 if (ServerPrincName && !(auth_info->principal = wcsdup(ServerPrincName))) {
1463 free(auth_info);
1465 }
1466
1467 auth_info->auth_type = AuthnSvc;
1468 auth_info->package_name = package_name;
1469 auth_info->max_token = max_token;
1470
1474
1475 return RPC_S_OK;
1476}
1477
1478/******************************************************************************
1479 * RpcServerInqDefaultPrincNameA (rpcrt4.@)
1480 */
1482{
1484 RPC_WSTR principalW;
1485
1486 TRACE("%lu, %p\n", AuthnSvc, PrincName);
1487
1488 if ((ret = RpcServerInqDefaultPrincNameW( AuthnSvc, &principalW )) == RPC_S_OK)
1489 {
1490 if (!(*PrincName = (RPC_CSTR)RPCRT4_strdupWtoA( principalW ))) return RPC_S_OUT_OF_MEMORY;
1491 RpcStringFreeW( &principalW );
1492 }
1493 return ret;
1494}
1495
1496/******************************************************************************
1497 * RpcServerInqDefaultPrincNameW (rpcrt4.@)
1498 */
1500{
1501 ULONG len = 0;
1502
1503 FIXME("%lu, %p\n", AuthnSvc, PrincName);
1504
1505 if (AuthnSvc != RPC_C_AUTHN_WINNT) return RPC_S_UNKNOWN_AUTHN_SERVICE;
1506
1507 GetUserNameExW( NameSamCompatible, NULL, &len );
1509
1510 if (!(*PrincName = malloc(len * sizeof(WCHAR))))
1511 return RPC_S_OUT_OF_MEMORY;
1512
1513 GetUserNameExW( NameSamCompatible, *PrincName, &len );
1514 return RPC_S_OK;
1515}
1516
1517/***********************************************************************
1518 * RpcServerListen (RPCRT4.@)
1519 */
1520RPC_STATUS WINAPI RpcServerListen( UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait )
1521{
1523
1524 TRACE("(%u,%u,%u)\n", MinimumCallThreads, MaxCalls, DontWait);
1525
1526 if (list_empty(&protseqs))
1528
1530
1531 if (DontWait || (status != RPC_S_OK)) return status;
1532
1533 return RpcMgmtWaitServerListen();
1534}
1535
1536/***********************************************************************
1537 * RpcMgmtServerWaitListen (RPCRT4.@)
1538 */
1540{
1541 RpcServerProtseq *protseq;
1542 HANDLE event, wait_thread;
1543
1544 TRACE("()\n");
1545
1547 event = listen_done_event;
1549
1550 if (!event)
1551 return RPC_S_NOT_LISTENING;
1552
1553 TRACE( "waiting for server calls to finish\n" );
1555 TRACE( "done waiting\n" );
1556
1558 /* wait for server threads to finish */
1559 while(1)
1560 {
1561 if (listen_count)
1562 break;
1563
1564 wait_thread = NULL;
1567 {
1568 if ((wait_thread = protseq->server_thread))
1569 {
1570 protseq->server_thread = NULL;
1571 break;
1572 }
1573 }
1575 if (!wait_thread)
1576 break;
1577
1578 TRACE("waiting for thread %lu\n", GetThreadId(wait_thread));
1580 WaitForSingleObject(wait_thread, INFINITE);
1581 CloseHandle(wait_thread);
1583 }
1584 if (listen_done_event == event)
1585 {
1587 CloseHandle( event );
1588 }
1590 return RPC_S_OK;
1591}
1592
1593/***********************************************************************
1594 * RpcMgmtStopServerListening (RPCRT4.@)
1595 */
1597{
1598 TRACE("(Binding == (RPC_BINDING_HANDLE)^%p)\n", Binding);
1599
1600 if (Binding) {
1601 FIXME("client-side invocation not implemented.\n");
1603 }
1604
1605 return RPCRT4_stop_listen(FALSE);
1606}
1607
1608/***********************************************************************
1609 * RpcMgmtEnableIdleCleanup (RPCRT4.@)
1610 */
1612{
1613 FIXME("(): stub\n");
1614 return RPC_S_OK;
1615}
1616
1617/***********************************************************************
1618 * I_RpcServerStartListening (RPCRT4.@)
1619 */
1621{
1622 FIXME( "(%p): stub\n", hWnd );
1623
1624 return RPC_S_OK;
1625}
1626
1627/***********************************************************************
1628 * I_RpcServerStopListening (RPCRT4.@)
1629 */
1631{
1632 FIXME( "(): stub\n" );
1633
1634 return RPC_S_OK;
1635}
1636
1637/***********************************************************************
1638 * I_RpcWindowProc (RPCRT4.@)
1639 */
1641{
1642 FIXME( "(%p,%08x,%08x,%08lx): stub\n", hWnd, Message, wParam, lParam );
1643
1644 return 0;
1645}
1646
1647/***********************************************************************
1648 * RpcMgmtInqIfIds (RPCRT4.@)
1649 */
1651{
1652 FIXME("(%p,%p): stub\n", Binding, IfIdVector);
1653 return RPC_S_INVALID_BINDING;
1654}
1655
1656/***********************************************************************
1657 * RpcMgmtInqStats (RPCRT4.@)
1658 */
1660{
1661 RPC_STATS_VECTOR *stats;
1662
1663 FIXME("(%p,%p)\n", Binding, Statistics);
1664
1665 if ((stats = malloc(sizeof(RPC_STATS_VECTOR))))
1666 {
1667 stats->Count = 1;
1668 stats->Stats[0] = 0;
1669 *Statistics = stats;
1670 return RPC_S_OK;
1671 }
1673}
1674
1675/***********************************************************************
1676 * RpcMgmtStatsVectorFree (RPCRT4.@)
1677 */
1679{
1680 FIXME("(%p)\n", StatsVector);
1681
1682 if (StatsVector)
1683 {
1684 free(*StatsVector);
1685 *StatsVector = NULL;
1686 }
1687 return RPC_S_OK;
1688}
1689
1690/***********************************************************************
1691 * RpcMgmtEpEltInqBegin (RPCRT4.@)
1692 */
1694 RPC_IF_ID *IfId, ULONG VersOption, UUID *ObjectUuid, RPC_EP_INQ_HANDLE* InquiryContext)
1695{
1696 FIXME("(%p,%lu,%p,%lu,%p,%p): stub\n",
1697 Binding, InquiryType, IfId, VersOption, ObjectUuid, InquiryContext);
1698 return RPC_S_INVALID_BINDING;
1699}
1700
1701/***********************************************************************
1702 * RpcMgmtIsServerListening (RPCRT4.@)
1703 */
1705{
1707
1708 TRACE("(%p)\n", Binding);
1709
1710 if (Binding) {
1711 RpcBinding *rpc_binding = (RpcBinding*)Binding;
1712 status = RPCRT4_IsServerListening(rpc_binding->Protseq, rpc_binding->Endpoint);
1713 }else {
1717 }
1718
1719 return status;
1720}
1721
1722/***********************************************************************
1723 * RpcMgmtSetAuthorizationFn (RPCRT4.@)
1724 */
1726{
1727 FIXME("(%p): stub\n", fn);
1728 return RPC_S_OK;
1729}
1730
1731/***********************************************************************
1732 * RpcMgmtSetServerStackSize (RPCRT4.@)
1733 */
1735{
1736 FIXME("(0x%lx): stub\n", ThreadStackSize);
1737 return RPC_S_OK;
1738}
1739
1740/***********************************************************************
1741 * I_RpcGetCurrentCallHandle (RPCRT4.@)
1742 */
1744{
1745 TRACE("\n");
1747}
static struct _test_info results[8]
Definition: SetCursorPos.c:31
HRESULT WINAPI DECLSPEC_HOTPATCH SetThreadDescription(HANDLE thread, PCWSTR description)
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
WINBASEAPI _Check_return_ _Out_ AppPolicyProcessTerminationMethod * policy
Definition: appmodel.h:73
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static int list_empty(struct list_entry *head)
Definition: list.h:58
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
static HANDLE thread
Definition: service.c:33
Definition: list.h:37
Definition: _map.h:48
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
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 CloseHandle
Definition: compat.h:739
#define __TRY
Definition: compat.h:80
#define __ENDTRY
Definition: compat.h:82
#define CALLBACK
Definition: compat.h:35
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
BOOL WINAPI QueueUserWorkItem(IN LPTHREAD_START_ROUTINE Function, IN PVOID Context, IN ULONG Flags)
Definition: thread.c:1076
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
DWORD WINAPI GetThreadId(IN HANDLE Thread)
Definition: thread.c:913
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:107
static const WCHAR Message[]
Definition: register.c:74
#define assert(x)
Definition: debug.h:53
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
switch(r->id)
Definition: btrfs.c:3046
#define INFINITE
Definition: serial.h:102
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define STATUS_ACCESS_VIOLATION
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum func
Definition: glext.h:6028
struct _cl_event * event
Definition: glext.h:7739
GLuint res
Definition: glext.h:9613
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
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
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 GLint GLint j
Definition: glfuncs.h:250
#define exception
Definition: math.h:26
#define GetExceptionCode
Definition: excpt.h:83
#define S_OK
Definition: intsafe.h:52
char hdr[14]
Definition: iptest.cpp:33
uint32_t entry
Definition: isohybrid.c:63
#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
DWORD exp
Definition: msg.c:16058
#define NCA_S_UNK_IF
Definition: ncastatus.h:25
#define NCA_S_OP_RNG_ERROR
Definition: ncastatus.h:24
unsigned int UINT
Definition: ndis.h:50
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
LONG SECURITY_STATUS
Definition: sspi.h:34
#define SECPKG_CRED_INBOUND
Definition: sspi.h:290
WCHAR SEC_WCHAR
Definition: sspi.h:29
#define err(...)
#define calloc
Definition: rosglue.h:14
unsigned int RpcServerAssoc_ReleaseContextHandle(RpcAssoc *assoc, NDR_SCONTEXT SContext, BOOL release_lock)
Definition: rpc_assoc.c:565
RPC_STATUS RpcServerAssoc_GetAssociation(LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, ULONG assoc_gid, RpcAssoc **assoc_out)
Definition: rpc_assoc.c:137
LPSTR RPCRT4_strdupWtoA(LPCWSTR src)
Definition: rpc_binding.c:46
RPC_STATUS RPCRT4_MakeBinding(RpcBinding **Binding, RpcConnection *Connection)
Definition: rpc_binding.c:215
LPWSTR RPCRT4_strdupAtoW(LPCSTR src)
Definition: rpc_binding.c:57
RPC_STATUS RPCRT4_SetBindingObject(RpcBinding *Binding, const UUID *ObjectUuid)
Definition: rpc_binding.c:207
RPC_STATUS RPCRT4_IsServerListening(const char *protseq, const char *endpoint)
static const char * rpcrt4_conn_get_name(const RpcConnection *Connection)
Definition: rpc_binding.h:179
static void rpcrt4_conn_close_read(RpcConnection *connection)
Definition: rpc_binding.h:201
RpcConnection * RPCRT4_GrabConnection(RpcConnection *conn)
NDR_SCONTEXT RPCRT4_PopThreadContextHandle(void)
Definition: rpcrt4_main.c:1047
RPC_STATUS RPCRT4_CloseConnection(RpcConnection *Connection)
void RPCRT4_ReleaseConnection(RpcConnection *Connection)
void RPCRT4_SetThreadCurrentCallHandle(RpcBinding *Binding)
Definition: rpcrt4_main.c:995
void rpcrt4_conn_release_and_wait(RpcConnection *connection)
RpcBinding * RPCRT4_GetThreadCurrentCallHandle(void)
Definition: rpcrt4_main.c:1003
#define REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED
Definition: rpc_defs.h:216
#define REJECT_PROTOCOL_VERSION_NOT_SUPPORTED
Definition: rpc_defs.h:224
#define RPC_VER_MAJOR
Definition: rpc_defs.h:176
#define REJECT_INVALID_CHECKSUM
Definition: rpc_defs.h:229
#define REJECT_LOCAL_LIMIT_EXCEEDED
Definition: rpc_defs.h:222
#define REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED
Definition: rpc_defs.h:217
#define RESULT_ACCEPT
Definition: rpc_defs.h:211
#define REJECT_REASON_NOT_SPECIFIED
Definition: rpc_defs.h:220
#define REJECT_UNKNOWN_AUTHN_SERVICE
Definition: rpc_defs.h:228
#define REASON_NONE
Definition: rpc_defs.h:215
#define RESULT_PROVIDER_REJECTION
Definition: rpc_defs.h:213
#define RPC_MAX_PACKET_SIZE
Definition: rpc_defs.h:184
@ PKT_REQUEST
Definition: rpc_defs.h:188
@ PKT_BIND
Definition: rpc_defs.h:199
@ PKT_AUTH3
Definition: rpc_defs.h:204
#define REJECT_TEMPORARY_CONGESTION
Definition: rpc_defs.h:221
#define RPC_VER_MINOR
Definition: rpc_defs.h:177
#define RPC_FLG_OBJECT_UUID
Definition: rpc_defs.h:181
#define RPC_MIN_PACKET_SIZE
Definition: rpc_defs.h:183
RPC_STATUS RPCRT4_ReceiveWithAuth(RpcConnection *Connection, RpcPktHdr **Header, PRPC_MESSAGE pMsg, unsigned char **auth_data_out, ULONG *auth_length_out)
Definition: rpc_message.c:1372
RpcPktHdr * RPCRT4_BuildFaultHeader(ULONG DataRepresentation, RPC_STATUS Status)
Definition: rpc_message.c:170
RpcPktHdr * RPCRT4_BuildBindAckHeader(ULONG DataRepresentation, unsigned short MaxTransmissionSize, unsigned short MaxReceiveSize, ULONG AssocGroupId, LPCSTR ServerAddress, unsigned char ResultCount, const RpcResult *Results)
Definition: rpc_message.c:254
NCA_STATUS RPC2NCA_STATUS(RPC_STATUS status)
Definition: rpc_message.c:404
RpcPktHdr * RPCRT4_BuildBindNackHeader(ULONG DataRepresentation, unsigned char RpcVersion, unsigned char RpcVersionMinor, unsigned short RejectReason)
Definition: rpc_message.c:229
RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header, void *Buffer, unsigned int BufferLength)
Definition: rpc_message.c:1219
RpcPktHdr * RPCRT4_BuildResponseHeader(ULONG DataRepresentation, ULONG BufferLength)
Definition: rpc_message.c:154
RPC_STATUS RPCRT4_ServerConnectionAuth(RpcConnection *conn, BOOL start, RpcAuthVerifier *auth_data_in, ULONG auth_length_in, unsigned char **auth_data_out, ULONG *auth_length_out)
Definition: rpc_message.c:1021
RPC_STATUS RPCRT4_SendWithAuth(RpcConnection *Connection, RpcPktHdr *Header, void *Buffer, unsigned int BufferLength, const void *Auth, unsigned int AuthLength)
Definition: rpc_message.c:757
RPC_STATUS WINAPI RpcServerListen(UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait)
Definition: rpc_server.c:1520
static RPC_STATUS process_bind_packet_no_send(RpcConnection *conn, RpcPktBindHdr *hdr, RPC_MESSAGE *msg, unsigned char *auth_data, ULONG auth_length, RpcPktHdr **ack_response, unsigned char **auth_data_out, ULONG *auth_length_out)
Definition: rpc_server.c:205
RPC_STATUS WINAPI RpcServerRegisterIfEx(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv, UINT Flags, UINT MaxCalls, RPC_IF_CALLBACK_FN *IfCallbackFn)
Definition: rpc_server.c:1125
static LONG listen_count
Definition: rpc_server.c:103
RPC_STATUS WINAPI RpcMgmtEpEltInqBegin(RPC_BINDING_HANDLE Binding, ULONG InquiryType, RPC_IF_ID *IfId, ULONG VersOption, UUID *ObjectUuid, RPC_EP_INQ_HANDLE *InquiryContext)
Definition: rpc_server.c:1693
static RPC_STATUS RPCRT4_start_listen_protseq(RpcServerProtseq *ps, BOOL auto_listen)
Definition: rpc_server.c:725
static struct list server_interfaces
Definition: rpc_server.c:70
RPC_STATUS WINAPI RpcMgmtEnableIdleCleanup(void)
Definition: rpc_server.c:1611
RPC_STATUS WINAPI RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv)
Definition: rpc_server.c:1116
static RPC_STATUS find_security_package(ULONG auth_type, SecPkgInfoW **packages_buf, SecPkgInfoW **ret)
Definition: rpc_server.c:1334
static struct list server_registered_auth_info
Definition: rpc_server.c:71
RPC_STATUS RPCRT4_ServerGetRegisteredAuthInfo(USHORT auth_type, CredHandle *cred, TimeStamp *exp, ULONG *max_token)
Definition: rpc_server.c:1365
RPC_STATUS WINAPI RpcMgmtInqIfIds(RPC_BINDING_HANDLE Binding, RPC_IF_ID_VECTOR **IfIdVector)
Definition: rpc_server.c:1650
RPC_STATUS WINAPI RpcServerUseProtseqW(RPC_WSTR Protseq, unsigned int MaxCalls, void *SecurityDescriptor)
Definition: rpc_server.c:1077
RPC_STATUS WINAPI RpcMgmtWaitServerListen(void)
Definition: rpc_server.c:1539
RPC_STATUS WINAPI RpcServerUseProtseqEpW(RPC_WSTR Protseq, UINT MaxCalls, RPC_WSTR Endpoint, LPVOID SecurityDescriptor)
Definition: rpc_server.c:927
RPC_STATUS WINAPI I_RpcServerStopListening(void)
Definition: rpc_server.c:1630
RPC_STATUS RPC_ENTRY RpcServerInqDefaultPrincNameA(ULONG AuthnSvc, RPC_CSTR *PrincName)
Definition: rpc_server.c:1481
RPC_STATUS WINAPI RpcServerUseProtseqEpExW(RPC_WSTR Protseq, UINT MaxCalls, RPC_WSTR Endpoint, LPVOID SecurityDescriptor, PRPC_POLICY lpPolicy)
Definition: rpc_server.c:1033
RPC_STATUS WINAPI RpcServerUseProtseqEpA(RPC_CSTR Protseq, UINT MaxCalls, RPC_CSTR Endpoint, LPVOID SecurityDescriptor)
Definition: rpc_server.c:910
RPC_STATUS WINAPI RpcServerInqBindings(RPC_BINDING_VECTOR **BindingVector)
Definition: rpc_server.c:863
static RPC_STATUS process_auth3_packet(RpcConnection *conn, RpcPktCommonHdr *hdr, RPC_MESSAGE *msg, unsigned char *auth_data, ULONG auth_length)
Definition: rpc_server.c:475
static RpcServerInterface * RPCRT4_find_interface(UUID *object, const RPC_SYNTAX_IDENTIFIER *if_id, const RPC_SYNTAX_IDENTIFIER *transfer_syntax, BOOL check_object)
Definition: rpc_server.c:131
RPC_STATUS WINAPI RpcMgmtInqStats(RPC_BINDING_HANDLE Binding, RPC_STATS_VECTOR **Statistics)
Definition: rpc_server.c:1659
static RpcObjTypeMap * RpcObjTypeMaps
Definition: rpc_server.c:66
RPC_STATUS WINAPI RpcServerRegisterAuthInfoW(RPC_WSTR ServerPrincName, ULONG AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, LPVOID Arg)
Definition: rpc_server.c:1434
void RPCRT4_new_client(RpcConnection *conn)
Definition: rpc_server.c:626
static CRITICAL_SECTION server_cs
Definition: rpc_server.c:73
static RPC_STATUS process_request_packet(RpcConnection *conn, RpcPktRequestHdr *hdr, RPC_MESSAGE *msg)
Definition: rpc_server.c:362
static CRITICAL_SECTION_DEBUG server_cs_debug
Definition: rpc_server.c:74
RPC_STATUS WINAPI RpcMgmtSetAuthorizationFn(RPC_MGMT_AUTHORIZATION_FN fn)
Definition: rpc_server.c:1725
RPC_STATUS WINAPI RpcMgmtIsServerListening(RPC_BINDING_HANDLE Binding)
Definition: rpc_server.c:1704
static RpcObjTypeMap * LookupObjTypeMap(UUID *ObjUuid)
Definition: rpc_server.c:109
RPC_STATUS WINAPI RpcObjectSetType(UUID *ObjUuid, UUID *TypeUuid)
Definition: rpc_server.c:1281
RPC_BINDING_HANDLE WINAPI I_RpcGetCurrentCallHandle(void)
Definition: rpc_server.c:1743
static RPC_STATUS RPCRT4_get_or_create_serverprotseq(UINT MaxCalls, const char *Protseq, RpcServerProtseq **ps)
Definition: rpc_server.c:987
static void RPCRT4_release_server_interface(RpcServerInterface *sif)
Definition: rpc_server.c:160
RPC_STATUS WINAPI RpcServerUseProtseqEpExA(RPC_CSTR Protseq, UINT MaxCalls, RPC_CSTR Endpoint, LPVOID SecurityDescriptor, PRPC_POLICY lpPolicy)
Definition: rpc_server.c:1013
static DWORD CALLBACK RPCRT4_server_thread(LPVOID the_arg)
Definition: rpc_server.c:642
RPC_STATUS RPC_ENTRY RpcServerInqDefaultPrincNameW(ULONG AuthnSvc, RPC_WSTR *PrincName)
Definition: rpc_server.c:1499
static RPC_STATUS alloc_serverprotoseq(UINT MaxCalls, const char *Protseq, RpcServerProtseq **ps)
Definition: rpc_server.c:946
static void RPCRT4_sync_with_server_thread(RpcServerProtseq *ps)
Definition: rpc_server.c:710
static CRITICAL_SECTION server_auth_info_cs
Definition: rpc_server.c:91
void RPCRT4_destroy_all_protseqs(void)
Definition: rpc_server.c:1094
RPC_STATUS WINAPI RpcMgmtStatsVectorFree(RPC_STATS_VECTOR **StatsVector)
Definition: rpc_server.c:1678
static RPC_STATUS process_bind_packet(RpcConnection *conn, RpcPktBindHdr *hdr, RPC_MESSAGE *msg, unsigned char *auth_data, ULONG auth_length)
Definition: rpc_server.c:337
static BOOL RPCRT4_protseq_is_endpoint_registered(RpcServerProtseq *protseq, const char *endpoint)
Definition: rpc_server.c:819
static RPC_STATUS RPCRT4_stop_listen(BOOL auto_listen)
Definition: rpc_server.c:781
static BOOL std_listen
Definition: rpc_server.c:101
struct _RpcObjTypeMap RpcObjTypeMap
static void destroy_serverprotoseq(RpcServerProtseq *ps)
Definition: rpc_server.c:975
static HANDLE listen_done_event
Definition: rpc_server.c:105
UINT WINAPI I_RpcWindowProc(void *hWnd, UINT Message, UINT wParam, ULONG lParam)
Definition: rpc_server.c:1640
static DWORD CALLBACK RPCRT4_io_thread(LPVOID the_arg)
Definition: rpc_server.c:543
static UUID * LookupObjType(UUID *ObjUuid)
Definition: rpc_server.c:122
RPC_STATUS WINAPI RpcServerRegisterIf2(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv, UINT Flags, UINT MaxCalls, UINT MaxRpcSize, RPC_IF_CALLBACK_FN *IfCallbackFn)
Definition: rpc_server.c:1135
static void RPCRT4_process_packet(RpcConnection *conn, RpcPktHdr *hdr, RPC_MESSAGE *msg, unsigned char *auth_data, ULONG auth_length)
Definition: rpc_server.c:500
static CRITICAL_SECTION_DEBUG listen_cs_debug
Definition: rpc_server.c:83
static struct list protseqs
Definition: rpc_server.c:69
struct _RpcPacket RpcPacket
RPC_STATUS WINAPI RpcServerUseProtseqA(RPC_CSTR Protseq, unsigned int MaxCalls, void *SecurityDescriptor)
Definition: rpc_server.c:1060
RPC_STATUS WINAPI RpcServerRegisterIf3(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv, UINT Flags, UINT MaxCalls, UINT MaxRpcSize, RPC_IF_CALLBACK_FN *IfCallbackFn, void *SecurityDescriptor)
Definition: rpc_server.c:1144
RPC_STATUS WINAPI I_RpcServerStartListening(HWND hWnd)
Definition: rpc_server.c:1620
static CRITICAL_SECTION listen_cs
Definition: rpc_server.c:82
RPC_STATUS WINAPI RpcMgmtSetServerStackSize(ULONG ThreadStackSize)
Definition: rpc_server.c:1734
static CRITICAL_SECTION_DEBUG server_auth_info_cs_debug
Definition: rpc_server.c:92
void RPCRT4_ServerFreeAllRegisteredAuthInfo(void)
Definition: rpc_server.c:1396
static RpcPktHdr * handle_bind_error(RpcConnection *conn, RPC_STATUS error)
Definition: rpc_server.c:172
RPC_STATUS WINAPI RpcServerRegisterAuthInfoA(RPC_CSTR ServerPrincName, ULONG AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, LPVOID Arg)
Definition: rpc_server.c:1414
static UUID uuid_nil
Definition: rpc_server.c:107
static DWORD CALLBACK RPCRT4_worker_thread(LPVOID the_arg)
Definition: rpc_server.c:533
static RPC_STATUS RPCRT4_use_protseq(RpcServerProtseq *ps, const char *endpoint)
Definition: rpc_server.c:834
RPC_STATUS WINAPI RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, UINT WaitForCallsToComplete)
Definition: rpc_server.c:1202
RPC_STATUS WINAPI RpcMgmtStopServerListening(RPC_BINDING_HANDLE Binding)
Definition: rpc_server.c:1596
RPC_STATUS WINAPI RpcServerUnregisterIfEx(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, int RundownContextHandles)
Definition: rpc_server.c:1253
static RPC_STATUS RPCRT4_start_listen(BOOL auto_listen)
Definition: rpc_server.c:743
const struct protseq_ops * rpcrt4_get_protseq_ops(const char *protseq)
#define RPC_C_LISTEN_MAX_CALLS_DEFAULT
Definition: rpcdce.h:122
I_RPC_HANDLE RPC_BINDING_HANDLE
Definition: rpcdce.h:50
unsigned short * RPC_WSTR
Definition: rpcdce.h:46
void(__RPC_USER * RPC_AUTH_KEY_RETRIEVAL_FN)(void *, RPC_WSTR, ULONG, void **, RPC_STATUS *)
Definition: rpcdce.h:212
unsigned char * RPC_CSTR
Definition: rpcdce.h:45
#define RPC_MGR_EPV
Definition: rpcdce.h:53
#define RPC_IF_AUTOLISTEN
Definition: rpcdce.h:313
RPC_STATUS RPC_ENTRY RPC_IF_CALLBACK_FN(RPC_IF_HANDLE InterfaceUuid, void *Context)
Definition: rpcdce.h:211
#define RPC_C_AUTHN_WINNT
Definition: rpcdce.h:158
int(__RPC_API * RPC_MGMT_AUTHORIZATION_FN)(RPC_BINDING_HANDLE, ULONG, RPC_STATUS *)
Definition: rpcdce.h:414
#define RPC_IF_OLE
Definition: rpcdce.h:314
void(__RPC_STUB * RPC_DISPATCH_FUNCTION)(PRPC_MESSAGE Message)
Definition: rpcdcep.h:82
#define NDR_LOCAL_DATA_REPRESENTATION
Definition: rpcndr.h:68
#define RPC_S_OUT_OF_MEMORY
Definition: rpcnterr.h:24
#define RPC_S_OK
Definition: rpcnterr.h:22
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
int WINAPI UuidEqual(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status)
Definition: rpcrt4_main.c:277
void WINAPI I_RpcFree(void *Object)
Definition: rpcrt4_main.c:755
int WINAPI UuidCompare(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status)
Definition: rpcrt4_main.c:234
_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 LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
#define exit(n)
Definition: config.h:202
#define memset(x, y, z)
Definition: compat.h:39
#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
BOOLEAN WINAPI GetUserNameExW(EXTENDED_NAME_FORMAT NameFormat, LPWSTR lpNameBuffer, PULONG nSize)
Definition: sspi.c:1079
unsigned int DispatchTableCount
Definition: rpcdcep.h:87
LONG_PTR Reserved
Definition: rpcdcep.h:89
RPC_DISPATCH_FUNCTION * DispatchTable
Definition: rpcdcep.h:88
unsigned int Count
Definition: rpcdce.h:84
ULONG Stats[1]
Definition: rpcdce.h:85
RPC_SYNTAX_IDENTIFIER transfer_syntaxes[ANYSIZE_ARRAY]
Definition: rpc_defs.h:72
RPC_SYNTAX_IDENTIFIER abstract_syntax
Definition: rpc_defs.h:71
unsigned char num_syntaxes
Definition: rpc_defs.h:69
unsigned int Length
Definition: rpcdce.h:216
ULONG EndpointFlags
Definition: rpcdce.h:217
ULONG NICFlags
Definition: rpcdce.h:218
unsigned int RpcProtseqEndpointCount
Definition: rpcdcep.h:107
RPC_SYNTAX_IDENTIFIER InterfaceId
Definition: rpcdcep.h:104
RPC_MGR_EPV * DefaultManagerEpv
Definition: rpcdcep.h:109
RPC_SYNTAX_IDENTIFIER TransferSyntax
Definition: rpcdcep.h:105
PRPC_DISPATCH_TABLE DispatchTable
Definition: rpcdcep.h:106
void const * InterpreterInfo
Definition: rpcdcep.h:110
RPC_VERSION SyntaxVersion
Definition: rpcdcep.h:33
unsigned short MajorVersion
Definition: rpcdcep.h:27
unsigned short MinorVersion
Definition: rpcdcep.h:28
PRTL_CRITICAL_SECTION_DEBUG DebugInfo
Definition: rtltypes.h:1450
LPSTR Endpoint
Definition: rpc_binding.h:133
LPSTR Protseq
Definition: rpc_binding.h:131
LPSTR NetworkAddr
Definition: rpc_binding.h:67
LPWSTR NetworkOptions
Definition: rpc_binding.h:69
RPC_SYNTAX_IDENTIFIER ActiveInterface
Definition: rpc_binding.h:92
struct _RpcBinding * server_binding
Definition: rpc_binding.h:96
USHORT MaxTransmissionSize
Definition: rpc_binding.h:71
struct _RpcObjTypeMap * next
Definition: rpc_server.c:61
ULONG auth_length
Definition: rpc_server.c:55
struct _RpcConnection * conn
Definition: rpc_server.c:51
RPC_MESSAGE * msg
Definition: rpc_server.c:53
RpcPktHdr * hdr
Definition: rpc_server.c:52
unsigned char * auth_data
Definition: rpc_server.c:54
RPC_SERVER_INTERFACE * If
Definition: rpc_server.h:66
struct list entry
Definition: rpc_server.h:65
HANDLE CallsCompletedEvent
Definition: rpc_server.h:76
RPC_MGR_EPV * MgrEpv
Definition: rpc_server.h:68
RPC_IF_CALLBACK_FN * IfCallbackFn
Definition: rpc_server.h:72
struct list entry
Definition: rpc_server.h:32
const struct protseq_ops * ops
Definition: rpc_server.h:31
struct list connections
Definition: rpc_server.h:37
struct list listeners
Definition: rpc_server.h:36
CRITICAL_SECTION cs
Definition: rpc_server.h:38
HANDLE server_thread
Definition: rpc_server.h:41
HANDLE server_ready_event
Definition: rpc_server.h:45
ULONG cbMaxToken
Definition: sspi.h:117
SEC_WCHAR * Name
Definition: sspi.h:118
struct define * next
Definition: compiler.c:65
Definition: nis.h:10
Definition: list.h:15
Definition: dhcpd.h:135
RpcServerProtseq *(* alloc)(void)
Definition: rpc_server.h:51
Definition: ps.c:97
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:576
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:618
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
#define LIST_INIT(head)
Definition: queue.h:197
#define LIST_ENTRY(type)
Definition: queue.h:175
#define DWORD_PTR
Definition: treelist.c:76
#define MAKEWORD(a, b)
Definition: typedefs.h:248
#define MAKELONG(a, b)
Definition: typedefs.h:249
uint32_t ULONG
Definition: typedefs.h:59
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
HANDLE WINAPI GetCurrentThread(void)
Definition: proc.c:1148
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define WINAPI
Definition: msvc.h:6
#define __EXCEPT_ALL
Definition: exception.h:65
#define RPC_S_SERVER_TOO_BUSY
Definition: winerror.h:1390
#define RPC_S_PROTSEQ_NOT_SUPPORTED
Definition: winerror.h:1370
#define SEC_E_OK
Definition: winerror.h:3450
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1388
#define RPC_S_INVALID_BOUND
Definition: winerror.h:1400
#define RPC_S_WRONG_KIND_OF_BINDING
Definition: winerror.h:1368
#define RPC_S_ALREADY_LISTENING
Definition: winerror.h:1380
#define RPC_S_UNKNOWN_IF
Definition: winerror.h:1384
#define RPC_S_PROTOCOL_ERROR
Definition: winerror.h:1395
#define RPC_S_NO_BINDINGS
Definition: winerror.h:1385
#define RPC_S_NOT_LISTENING
Definition: winerror.h:1382
#define RPC_S_UNKNOWN_AUTHN_SERVICE
Definition: winerror.h:1412
#define RPC_S_INTERNAL_ERROR
Definition: winerror.h:1431
#define RPC_S_ALREADY_REGISTERED
Definition: winerror.h:1378
#define RPC_S_SEC_PKG_ERROR
Definition: winerror.h:1489
#define RPC_S_INVALID_BINDING
Definition: winerror.h:1369
#define RPC_S_INVALID_OBJECT
Definition: winerror.h:1503
#define ERROR_NOACCESS
Definition: winerror.h:902
#define RPC_S_NO_PROTSEQS_REGISTERED
Definition: winerror.h:1381
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
Definition: winnt_old.h:1138
#define WT_EXECUTELONGFUNCTION
Definition: winnt_old.h:1089
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
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:191
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
__wchar_t WCHAR
Definition: xmlstorage.h:180
char * LPSTR
Definition: xmlstorage.h:182