ReactOS 0.4.16-dev-1946-g52006dd
rpc_assoc.c
Go to the documentation of this file.
1/*
2 * Associations
3 *
4 * Copyright 2007 Robert Shearman (for CodeWeavers)
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 *
20 */
21
22#include <stdarg.h>
23#include <stdlib.h>
24#include <assert.h>
25
26#include "rpc.h"
27#include "rpcndr.h"
28
29#include "wine/debug.h"
30
31#include "rpc_binding.h"
32#include "rpc_assoc.h"
33#include "rpc_message.h"
34
36
39{
40 0, 0, &assoc_list_cs,
42 0, 0, { (DWORD_PTR)(__FILE__ ": assoc_list_cs") }
43};
44static CRITICAL_SECTION assoc_list_cs = { &assoc_list_cs_debug, -1, 0, 0, 0, 0 };
45
48
50
51typedef struct _RpcContextHandle
52{
53 struct list entry;
56 void *ctx_guard;
59 unsigned int refs;
61
62static void RpcContextHandle_Destroy(RpcContextHandle *context_handle);
63
64static RPC_STATUS RpcAssoc_Alloc(LPCSTR Protseq, LPCSTR NetworkAddr,
65 LPCSTR Endpoint, LPCWSTR NetworkOptions,
66 RpcAssoc **assoc_out)
67{
68 RpcAssoc *assoc;
69 assoc = malloc(sizeof(*assoc));
70 if (!assoc)
72 assoc->refs = 1;
76 assoc->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": RpcAssoc.cs");
77 assoc->Protseq = strdup(Protseq);
78 assoc->NetworkAddr = strdup(NetworkAddr);
79 assoc->Endpoint = strdup(Endpoint);
80 assoc->NetworkOptions = wcsdup(NetworkOptions);
81 assoc->assoc_group_id = 0;
82 assoc->connection_cnt = 0;
83 UuidCreate(&assoc->http_uuid);
84 list_init(&assoc->entry);
85 *assoc_out = assoc;
86 return RPC_S_OK;
87}
88
90{
91 if ((opts1 == NULL) && (opts2 == NULL))
92 return TRUE;
93 if ((opts1 == NULL) || (opts2 == NULL))
94 return FALSE;
95 return !wcscmp(opts1, opts2);
96}
97
99 LPCSTR Endpoint, LPCWSTR NetworkOptions,
100 RpcAssoc **assoc_out)
101{
102 RpcAssoc *assoc;
104
107 {
108 if (!strcmp(Protseq, assoc->Protseq) &&
109 !strcmp(NetworkAddr, assoc->NetworkAddr) &&
110 !strcmp(Endpoint, assoc->Endpoint) &&
111 compare_networkoptions(NetworkOptions, assoc->NetworkOptions))
112 {
113 assoc->refs++;
114 *assoc_out = assoc;
116 TRACE("using existing assoc %p\n", assoc);
117 return RPC_S_OK;
118 }
119 }
120
121 status = RpcAssoc_Alloc(Protseq, NetworkAddr, Endpoint, NetworkOptions, &assoc);
122 if (status != RPC_S_OK)
123 {
125 return status;
126 }
128 *assoc_out = assoc;
129
131
132 TRACE("new assoc %p\n", assoc);
133
134 return RPC_S_OK;
135}
136
138 LPCSTR Endpoint, LPCWSTR NetworkOptions,
139 ULONG assoc_gid,
140 RpcAssoc **assoc_out)
141{
142 RpcAssoc *assoc;
144
146 if (assoc_gid)
147 {
149 {
150 /* FIXME: NetworkAddr shouldn't be NULL */
151 if (assoc->assoc_group_id == assoc_gid &&
152 !strcmp(Protseq, assoc->Protseq) &&
153 (!NetworkAddr || !assoc->NetworkAddr || !strcmp(NetworkAddr, assoc->NetworkAddr)) &&
154 !strcmp(Endpoint, assoc->Endpoint) &&
155 ((!assoc->NetworkOptions == !NetworkOptions) &&
156 (!NetworkOptions || !wcscmp(NetworkOptions, assoc->NetworkOptions))))
157 {
158 assoc->refs++;
159 *assoc_out = assoc;
161 TRACE("using existing assoc %p\n", assoc);
162 return RPC_S_OK;
163 }
164 }
165 *assoc_out = NULL;
168 }
169
170 status = RpcAssoc_Alloc(Protseq, NetworkAddr, Endpoint, NetworkOptions, &assoc);
171 if (status != RPC_S_OK)
172 {
174 return status;
175 }
178 *assoc_out = assoc;
179
181
182 TRACE("new assoc %p\n", assoc);
183
184 return RPC_S_OK;
185}
186
188{
189 ULONG refs;
190
192 refs = --assoc->refs;
193 if (!refs)
194 list_remove(&assoc->entry);
196
197 if (!refs)
198 {
199 RpcConnection *Connection, *cursor2;
200 RpcContextHandle *context_handle, *context_handle_cursor;
201
202 TRACE("destroying assoc %p\n", assoc);
203
204 LIST_FOR_EACH_ENTRY_SAFE(Connection, cursor2, &assoc->free_connection_pool, RpcConnection, conn_pool_entry)
205 {
206 list_remove(&Connection->conn_pool_entry);
207 RPCRT4_ReleaseConnection(Connection);
208 }
209
210 LIST_FOR_EACH_ENTRY_SAFE(context_handle, context_handle_cursor, &assoc->context_handle_list, RpcContextHandle, entry)
211 RpcContextHandle_Destroy(context_handle);
212
213 free(assoc->NetworkOptions);
214 free(assoc->Endpoint);
215 free(assoc->NetworkAddr);
216 free(assoc->Protseq);
217
218 assoc->cs.DebugInfo->Spare[0] = 0;
219 DeleteCriticalSection(&assoc->cs);
220
221 free(assoc);
222 }
223
224 return refs;
225}
226
227#define ROUND_UP(value, alignment) (((value) + ((alignment) - 1)) & ~((alignment)-1))
228
230 const RPC_SYNTAX_IDENTIFIER *InterfaceId,
231 const RPC_SYNTAX_IDENTIFIER *TransferSyntax)
232{
233 RpcPktHdr *hdr;
234 RpcPktHdr *response_hdr;
237 unsigned char *auth_data = NULL;
238 ULONG auth_length;
239
240 TRACE("sending bind request to server\n");
241
244 assoc->assoc_group_id,
245 InterfaceId, TransferSyntax);
246
247 status = RPCRT4_Send(conn, hdr, NULL, 0);
248 free(hdr);
249 if (status != RPC_S_OK)
250 return status;
251
252 status = RPCRT4_ReceiveWithAuth(conn, &response_hdr, &msg, &auth_data, &auth_length);
253 if (status != RPC_S_OK)
254 {
255 ERR("receive failed with error %ld\n", status);
256 return status;
257 }
258
259 switch (response_hdr->common.ptype)
260 {
261 case PKT_BIND_ACK:
262 {
263 RpcAddressString *server_address = msg.Buffer;
264 if ((msg.BufferLength >= FIELD_OFFSET(RpcAddressString, string[0])) ||
265 (msg.BufferLength >= ROUND_UP(FIELD_OFFSET(RpcAddressString, string[server_address->length]), 4)))
266 {
267 unsigned short remaining = msg.BufferLength -
268 ROUND_UP(FIELD_OFFSET(RpcAddressString, string[server_address->length]), 4);
269 RpcResultList *results = (RpcResultList*)((ULONG_PTR)server_address +
270 ROUND_UP(FIELD_OFFSET(RpcAddressString, string[server_address->length]), 4));
271 if ((results->num_results == 1) &&
272 (remaining >= FIELD_OFFSET(RpcResultList, results[results->num_results])))
273 {
274 switch (results->results[0].result)
275 {
276 case RESULT_ACCEPT:
277 /* respond to authorization request */
278 if (auth_length > sizeof(RpcAuthVerifier))
280 auth_data + sizeof(RpcAuthVerifier),
281 auth_length);
282 if (status == RPC_S_OK)
283 {
284 conn->assoc_group_id = response_hdr->bind_ack.assoc_gid;
285 conn->MaxTransmissionSize = response_hdr->bind_ack.max_tsize;
286 conn->ActiveInterface = *InterfaceId;
287 }
288 break;
290 switch (results->results[0].reason)
291 {
293 ERR("syntax %s, %d.%d not supported\n",
294 debugstr_guid(&InterfaceId->SyntaxGUID),
295 InterfaceId->SyntaxVersion.MajorVersion,
296 InterfaceId->SyntaxVersion.MinorVersion);
298 break;
300 ERR("transfer syntax not supported\n");
302 break;
303 case REASON_NONE:
304 default:
306 }
307 break;
309 default:
310 ERR("rejection result %d\n", results->results[0].result);
312 }
313 }
314 else
315 {
316 ERR("incorrect results size\n");
318 }
319 }
320 else
321 {
322 ERR("bind ack packet too small (%d)\n", msg.BufferLength);
324 }
325 break;
326 }
327 case PKT_BIND_NACK:
328 switch (response_hdr->bind_nack.reject_reason)
329 {
332 ERR("server too busy\n");
334 break;
336 ERR("protocol version not supported\n");
338 break;
340 ERR("unknown authentication service\n");
342 break;
344 ERR("invalid checksum\n");
346 break;
347 default:
348 ERR("rejected bind for reason %d\n", response_hdr->bind_nack.reject_reason);
350 }
351 break;
352 default:
353 ERR("wrong packet type received %d\n", response_hdr->common.ptype);
355 break;
356 }
357
358 I_RpcFree(msg.Buffer);
359 free(response_hdr);
360 free(auth_data);
361 return status;
362}
363
365 const RPC_SYNTAX_IDENTIFIER *InterfaceId,
366 const RPC_SYNTAX_IDENTIFIER *TransferSyntax, const RpcAuthInfo *AuthInfo,
368{
369 RpcConnection *Connection;
370 EnterCriticalSection(&assoc->cs);
371 /* try to find a compatible connection from the connection pool */
372 LIST_FOR_EACH_ENTRY(Connection, &assoc->free_connection_pool, RpcConnection, conn_pool_entry)
373 {
374 if (!memcmp(&Connection->ActiveInterface, InterfaceId,
375 sizeof(RPC_SYNTAX_IDENTIFIER)) &&
376 RpcAuthInfo_IsEqual(Connection->AuthInfo, AuthInfo) &&
377 RpcQualityOfService_IsEqual(Connection->QOS, QOS))
378 {
379 list_remove(&Connection->conn_pool_entry);
380 LeaveCriticalSection(&assoc->cs);
381 TRACE("got connection from pool %p\n", Connection);
382 return Connection;
383 }
384 }
385
386 LeaveCriticalSection(&assoc->cs);
387 return NULL;
388}
389
391 const RPC_SYNTAX_IDENTIFIER *InterfaceId,
392 const RPC_SYNTAX_IDENTIFIER *TransferSyntax, RpcAuthInfo *AuthInfo,
393 RpcQualityOfService *QOS, LPCWSTR CookieAuth,
394 RpcConnection **Connection, BOOL *from_cache)
395{
396 RpcConnection *NewConnection;
398
399 *Connection = RpcAssoc_GetIdleConnection(assoc, InterfaceId, TransferSyntax, AuthInfo, QOS);
400 if (*Connection) {
401 TRACE("return idle connection %p for association %p\n", *Connection, assoc);
402 if (from_cache) *from_cache = TRUE;
403 return RPC_S_OK;
404 }
405
406 /* create a new connection */
407 status = RPCRT4_CreateConnection(&NewConnection, FALSE /* is this a server connection? */,
408 assoc->Protseq, assoc->NetworkAddr,
409 assoc->Endpoint, assoc->NetworkOptions,
410 AuthInfo, QOS, CookieAuth);
411 if (status != RPC_S_OK)
412 return status;
413
414 NewConnection->assoc = assoc;
415 status = RPCRT4_OpenClientConnection(NewConnection);
416 if (status != RPC_S_OK)
417 {
418 RPCRT4_ReleaseConnection(NewConnection);
419 return status;
420 }
421
422 status = RpcAssoc_BindConnection(assoc, NewConnection, InterfaceId, TransferSyntax);
423 if (status != RPC_S_OK)
424 {
425 RPCRT4_ReleaseConnection(NewConnection);
426 return status;
427 }
428
430
431 TRACE("return new connection %p for association %p\n", *Connection, assoc);
432 *Connection = NewConnection;
433 if (from_cache) *from_cache = FALSE;
434 return RPC_S_OK;
435}
436
438{
439 assert(!Connection->server);
440 Connection->async_state = NULL;
441 EnterCriticalSection(&assoc->cs);
442 if (!assoc->assoc_group_id) assoc->assoc_group_id = Connection->assoc_group_id;
444 LeaveCriticalSection(&assoc->cs);
445}
446
448{
450 return;
451
452 TRACE("Last %p connection released\n", assoc);
453 assoc->assoc_group_id = 0;
454}
455
457 NDR_SCONTEXT *SContext)
458{
459 RpcContextHandle *context_handle;
460
461 context_handle = calloc(1, sizeof(*context_handle));
462 if (!context_handle)
463 return RPC_S_OUT_OF_MEMORY;
464
465 context_handle->ctx_guard = CtxGuard;
467 context_handle->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": RpcContextHandle.lock");
468 context_handle->refs = 1;
469
470 /* lock here to mirror unmarshall, so we don't need to special-case the
471 * freeing of a non-marshalled context handle */
472 EnterCriticalSection(&context_handle->lock);
473
474 EnterCriticalSection(&assoc->cs);
475 list_add_tail(&assoc->context_handle_list, &context_handle->entry);
476 LeaveCriticalSection(&assoc->cs);
477
478 *SContext = (NDR_SCONTEXT)context_handle;
479 return RPC_S_OK;
480}
481
483{
484 RpcContextHandle *context_handle = (RpcContextHandle *)SContext;
485 return context_handle->ctx_guard == CtxGuard;
486}
487
489 void *CtxGuard, ULONG Flags, NDR_SCONTEXT *SContext)
490{
491 RpcContextHandle *context_handle;
492
493 EnterCriticalSection(&assoc->cs);
495 {
496 if (RpcContextHandle_IsGuardCorrect((NDR_SCONTEXT)context_handle, CtxGuard) &&
497 !memcmp(&context_handle->uuid, uuid, sizeof(*uuid)))
498 {
499 *SContext = (NDR_SCONTEXT)context_handle;
500 if (context_handle->refs++)
501 {
502 LeaveCriticalSection(&assoc->cs);
503 TRACE("found %p\n", context_handle);
504 EnterCriticalSection(&context_handle->lock);
505 return RPC_S_OK;
506 }
507 }
508 }
509 LeaveCriticalSection(&assoc->cs);
510
511 ERR("no context handle found for uuid %s, guard %p\n",
512 debugstr_guid(uuid), CtxGuard);
514}
515
517 NDR_SCONTEXT SContext,
518 void *CtxGuard,
519 NDR_RUNDOWN rundown_routine)
520{
521 RpcContextHandle *context_handle = (RpcContextHandle *)SContext;
523
524 if (!RpcContextHandle_IsGuardCorrect((NDR_SCONTEXT)context_handle, CtxGuard))
526
527 EnterCriticalSection(&assoc->cs);
528 if (UuidIsNil(&context_handle->uuid, &status))
529 {
530 /* add a ref for the data being valid */
531 context_handle->refs++;
532 UuidCreate(&context_handle->uuid);
533 context_handle->rundown_routine = rundown_routine;
534 TRACE("allocated uuid %s for context handle %p\n",
535 debugstr_guid(&context_handle->uuid), context_handle);
536 }
537 LeaveCriticalSection(&assoc->cs);
538
539 return RPC_S_OK;
540}
541
543{
544 RpcContextHandle *context_handle = (RpcContextHandle *)SContext;
545 *uuid = context_handle->uuid;
546}
547
548static void RpcContextHandle_Destroy(RpcContextHandle *context_handle)
549{
550 TRACE("freeing %p\n", context_handle);
551
552 if (context_handle->user_context && context_handle->rundown_routine)
553 {
554 TRACE("calling rundown routine %p with user context %p\n",
555 context_handle->rundown_routine, context_handle->user_context);
556 context_handle->rundown_routine(context_handle->user_context);
557 }
558
559 context_handle->lock.DebugInfo->Spare[0] = 0;
560 DeleteCriticalSection(&context_handle->lock);
561
562 free(context_handle);
563}
564
565unsigned int RpcServerAssoc_ReleaseContextHandle(RpcAssoc *assoc, NDR_SCONTEXT SContext, BOOL release_lock)
566{
567 RpcContextHandle *context_handle = (RpcContextHandle *)SContext;
568 unsigned int refs;
569
570 if (release_lock)
571 LeaveCriticalSection(&context_handle->lock);
572
573 EnterCriticalSection(&assoc->cs);
574 refs = --context_handle->refs;
575 if (!refs)
576 list_remove(&context_handle->entry);
577 LeaveCriticalSection(&assoc->cs);
578
579 if (!refs)
580 RpcContextHandle_Destroy(context_handle);
581
582 return refs;
583}
static struct _test_info results[8]
Definition: SetCursorPos.c:31
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
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define msg(x)
Definition: auth_time.c:54
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
static void list_remove(struct list_entry *entry)
Definition: list.h:90
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 ERR(fmt,...)
Definition: precomp.h:57
Definition: list.h:37
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:107
#define assert(x)
Definition: debug.h:53
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: msctf.idl:532
char hdr[14]
Definition: iptest.cpp:33
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_guid
Definition: kernel32.h:35
long LONG
Definition: pedump.c:60
#define calloc
Definition: rosglue.h:14
struct _RpcContextHandle RpcContextHandle
RPC_STATUS RpcServerAssoc_FindContextHandle(RpcAssoc *assoc, const UUID *uuid, void *CtxGuard, ULONG Flags, NDR_SCONTEXT *SContext)
Definition: rpc_assoc.c:488
RPC_STATUS RPCRT4_GetAssociation(LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, RpcAssoc **assoc_out)
Definition: rpc_assoc.c:98
void RpcAssoc_ConnectionReleased(RpcAssoc *assoc)
Definition: rpc_assoc.c:447
static LONG last_assoc_group_id
Definition: rpc_assoc.c:49
#define ROUND_UP(value, alignment)
Definition: rpc_assoc.c:227
void RpcAssoc_ReleaseIdleConnection(RpcAssoc *assoc, RpcConnection *Connection)
Definition: rpc_assoc.c:437
static CRITICAL_SECTION_DEBUG assoc_list_cs_debug
Definition: rpc_assoc.c:38
void RpcContextHandle_GetUuid(NDR_SCONTEXT SContext, UUID *uuid)
Definition: rpc_assoc.c:542
RPC_STATUS RpcServerAssoc_UpdateContextHandle(RpcAssoc *assoc, NDR_SCONTEXT SContext, void *CtxGuard, NDR_RUNDOWN rundown_routine)
Definition: rpc_assoc.c:516
static void RpcContextHandle_Destroy(RpcContextHandle *context_handle)
Definition: rpc_assoc.c:548
static RpcConnection * RpcAssoc_GetIdleConnection(RpcAssoc *assoc, const RPC_SYNTAX_IDENTIFIER *InterfaceId, const RPC_SYNTAX_IDENTIFIER *TransferSyntax, const RpcAuthInfo *AuthInfo, const RpcQualityOfService *QOS)
Definition: rpc_assoc.c:364
BOOL RpcContextHandle_IsGuardCorrect(NDR_SCONTEXT SContext, void *CtxGuard)
Definition: rpc_assoc.c:482
static BOOL compare_networkoptions(LPCWSTR opts1, LPCWSTR opts2)
Definition: rpc_assoc.c:89
static struct list server_assoc_list
Definition: rpc_assoc.c:47
static RPC_STATUS RpcAssoc_Alloc(LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, RpcAssoc **assoc_out)
Definition: rpc_assoc.c:64
unsigned int RpcServerAssoc_ReleaseContextHandle(RpcAssoc *assoc, NDR_SCONTEXT SContext, BOOL release_lock)
Definition: rpc_assoc.c:565
ULONG RpcAssoc_Release(RpcAssoc *assoc)
Definition: rpc_assoc.c:187
static RPC_STATUS RpcAssoc_BindConnection(const RpcAssoc *assoc, RpcConnection *conn, const RPC_SYNTAX_IDENTIFIER *InterfaceId, const RPC_SYNTAX_IDENTIFIER *TransferSyntax)
Definition: rpc_assoc.c:229
RPC_STATUS RpcServerAssoc_GetAssociation(LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, ULONG assoc_gid, RpcAssoc **assoc_out)
Definition: rpc_assoc.c:137
RPC_STATUS RpcServerAssoc_AllocateContextHandle(RpcAssoc *assoc, void *CtxGuard, NDR_SCONTEXT *SContext)
Definition: rpc_assoc.c:456
static struct list client_assoc_list
Definition: rpc_assoc.c:46
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 CRITICAL_SECTION assoc_list_cs
Definition: rpc_assoc.c:37
BOOL RpcAuthInfo_IsEqual(const RpcAuthInfo *AuthInfo1, const RpcAuthInfo *AuthInfo2)
Definition: rpc_binding.c:1191
BOOL RpcQualityOfService_IsEqual(const RpcQualityOfService *qos1, const RpcQualityOfService *qos2)
Definition: rpc_binding.c:1372
RPC_STATUS RPCRT4_CreateConnection(RpcConnection **Connection, BOOL server, LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, RpcAuthInfo *AuthInfo, RpcQualityOfService *QOS, LPCWSTR CookieAuth)
RPC_STATUS RPCRT4_OpenClientConnection(RpcConnection *Connection)
void RPCRT4_ReleaseConnection(RpcConnection *Connection)
#define REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED
Definition: rpc_defs.h:216
#define REJECT_PROTOCOL_VERSION_NOT_SUPPORTED
Definition: rpc_defs.h:224
#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_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_BIND_NACK
Definition: rpc_defs.h:201
@ PKT_BIND_ACK
Definition: rpc_defs.h:200
#define REJECT_TEMPORARY_CONGESTION
Definition: rpc_defs.h:221
#define RESULT_USER_REJECTION
Definition: rpc_defs.h:212
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_BuildBindHeader(ULONG DataRepresentation, unsigned short MaxTransmissionSize, unsigned short MaxReceiveSize, ULONG AssocGroupId, const RPC_SYNTAX_IDENTIFIER *AbstractId, const RPC_SYNTAX_IDENTIFIER *TransferId)
Definition: rpc_message.c:186
RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header, void *Buffer, unsigned int BufferLength)
Definition: rpc_message.c:1219
RPC_STATUS RPCRT4_ClientConnectionAuth(RpcConnection *conn, BYTE *challenge, ULONG count)
Definition: rpc_message.c:988
#define NDR_LOCAL_DATA_REPRESENTATION
Definition: rpcndr.h:68
struct _NDR_SCONTEXT * NDR_SCONTEXT
void(__RPC_USER * NDR_RUNDOWN)(void *context)
Definition: rpcndr.h:118
#define RPC_S_OUT_OF_MEMORY
Definition: rpcnterr.h:24
#define RPC_S_OK
Definition: rpcnterr.h:22
#define RPC_S_ACCESS_DENIED
Definition: rpcnterr.h:29
int WINAPI UuidIsNil(UUID *Uuid, RPC_STATUS *Status)
Definition: rpcrt4_main.c:293
void WINAPI I_RpcFree(void *Object)
Definition: rpcrt4_main.c:755
RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
Definition: rpcrt4_main.c:330
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_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)
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 TRACE(s)
Definition: solgame.cpp:4
unsigned short length
Definition: rpc_defs.h:91
unsigned int assoc_gid
Definition: rpc_defs.h:114
unsigned short max_tsize
Definition: rpc_defs.h:112
unsigned short reject_reason
Definition: rpc_defs.h:126
unsigned char ptype
Definition: rpc_defs.h:30
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
struct list free_connection_pool
Definition: rpc_assoc.h:45
LONG refs
Definition: rpc_assoc.h:30
LONG connection_cnt
Definition: rpc_assoc.h:46
struct list context_handle_list
Definition: rpc_assoc.h:49
LPSTR Protseq
Definition: rpc_assoc.h:32
UUID http_uuid
Definition: rpc_assoc.h:39
LPWSTR NetworkOptions
Definition: rpc_assoc.h:35
CRITICAL_SECTION cs
Definition: rpc_assoc.h:41
struct list entry
Definition: rpc_assoc.h:29
LPSTR Endpoint
Definition: rpc_assoc.h:34
ULONG assoc_group_id
Definition: rpc_assoc.h:38
LPSTR NetworkAddr
Definition: rpc_assoc.h:33
struct _RpcAssoc * assoc
Definition: rpc_binding.h:88
struct list conn_pool_entry
Definition: rpc_binding.h:85
RpcAuthInfo * AuthInfo
Definition: rpc_binding.h:77
RPC_SYNTAX_IDENTIFIER ActiveInterface
Definition: rpc_binding.h:92
USHORT MaxTransmissionSize
Definition: rpc_binding.h:71
ULONG assoc_group_id
Definition: rpc_binding.h:86
RPC_ASYNC_STATE * async_state
Definition: rpc_binding.h:87
RpcQualityOfService * QOS
Definition: rpc_binding.h:81
struct list entry
Definition: rpc_assoc.c:53
void * ctx_guard
Definition: rpc_assoc.c:56
NDR_RUNDOWN rundown_routine
Definition: rpc_assoc.c:55
unsigned int refs
Definition: rpc_assoc.c:59
void * user_context
Definition: rpc_assoc.c:54
CRITICAL_SECTION lock
Definition: rpc_assoc.c:58
Definition: ps.c:97
#define LIST_INIT(head)
Definition: queue.h:197
#define DWORD_PTR
Definition: treelist.c:76
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
RpcPktCommonHdr common
Definition: rpc_defs.h:152
RpcPktBindAckHdr bind_ack
Definition: rpc_defs.h:157
RpcPktBindNAckHdr bind_nack
Definition: rpc_defs.h:158
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define RPC_S_SERVER_TOO_BUSY
Definition: winerror.h:1390
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1388
#define RPC_S_CALL_FAILED_DNE
Definition: winerror.h:1394
#define RPC_S_UNKNOWN_IF
Definition: winerror.h:1384
#define RPC_S_PROTOCOL_ERROR
Definition: winerror.h:1395
#define RPC_S_NO_CONTEXT_AVAILABLE
Definition: winerror.h:1430
#define RPC_S_UNKNOWN_AUTHN_SERVICE
Definition: winerror.h:1412
#define RPC_S_SERVER_UNAVAILABLE
Definition: winerror.h:1389
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
Definition: winnt_old.h:1138
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
const char * LPCSTR
Definition: xmlstorage.h:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185