ReactOS 0.4.16-dev-1946-g52006dd
rpcrt4_main.c
Go to the documentation of this file.
1/*
2 * RPCRT4
3 *
4 * Copyright 2000 Huw D M Davies 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 * WINE RPC TODO's (and a few TODONT's)
21 *
22 * - Statistics: we are supposed to be keeping various counters. we aren't.
23 *
24 * - Async RPC: Unimplemented.
25 *
26 * - The NT "ports" API, aka LPC. Greg claims this is on his radar. Might (or
27 * might not) enable users to get some kind of meaningful result out of
28 * NT-based native rpcrt4's. Commonly-used transport for self-to-self RPC's.
29 */
30
31#include <stdarg.h>
32#include <stdio.h>
33#include <stdlib.h>
34#include <string.h>
35
36#include "ntstatus.h"
37#define WIN32_NO_STATUS
38#include "windef.h"
39#include "winerror.h"
40#include "winbase.h"
41#include "winuser.h"
42#include "winnt.h"
43#include "wine/winternl.h"
44#include "ntsecapi.h"
45#include "iptypes.h"
46#include "iphlpapi.h"
47#include "rpc.h"
48
49#include "ole2.h"
50#include "rpcndr.h"
51#include "rpcproxy.h"
52
53#include "rpc_binding.h"
54#include "rpc_server.h"
55
56#include "wine/debug.h"
57
59
61
64{
65 0, 0, &uuid_cs,
67 0, 0, { (DWORD_PTR)(__FILE__ ": uuid_cs") }
68};
69static CRITICAL_SECTION uuid_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
70
73{
74 0, 0, &threaddata_cs,
76 0, 0, { (DWORD_PTR)(__FILE__ ": threaddata_cs") }
77};
78static CRITICAL_SECTION threaddata_cs = { &threaddata_cs_debug, -1, 0, 0, 0, 0 };
79
81
83{
86};
87
89{
90 struct list entry;
96};
97
99{
100 unsigned int length;
102};
103
104/***********************************************************************
105 * DllMain
106 *
107 * PARAMS
108 * hinstDLL [I] handle to the DLL's instance
109 * fdwReason [I]
110 * lpvReserved [I] reserved, must be NULL
111 *
112 * RETURNS
113 * Success: TRUE
114 * Failure: FALSE
115 */
116
118{
119 struct threaddata *tdata;
120
121 switch (fdwReason) {
123 break;
124
126 tdata = NtCurrentTeb()->ReservedForNtRpc;
127 if (tdata)
128 {
130 list_remove(&tdata->entry);
132
133 tdata->cs.DebugInfo->Spare[0] = 0;
134 DeleteCriticalSection(&tdata->cs);
135 if (tdata->connection)
136 ERR("tdata->connection should be NULL but is still set to %p\n", tdata->connection);
137 if (tdata->server_binding)
138 ERR("tdata->server_binding should be NULL but is still set to %p\n", tdata->server_binding);
139 free(tdata);
140 }
141 break;
142
144 if (lpvReserved) break; /* do nothing if process is shutting down */
149 break;
150 }
151
152 return TRUE;
153}
154
155/*************************************************************************
156 * RpcStringFreeA [RPCRT4.@]
157 *
158 * Frees a character string allocated by the RPC run-time library.
159 *
160 * RETURNS
161 *
162 * S_OK if successful.
163 */
165{
166 free(*String);
167 if (String) *String = NULL;
168
169 return RPC_S_OK;
170}
171
172/*************************************************************************
173 * RpcStringFreeW [RPCRT4.@]
174 *
175 * Frees a character string allocated by the RPC run-time library.
176 *
177 * RETURNS
178 *
179 * S_OK if successful.
180 */
182{
183 free(*String);
184 if (String) *String = NULL;
185
186 return RPC_S_OK;
187}
188
189/*************************************************************************
190 * RpcIfInqId [RPCRT4.@]
191 *
192 * Get interface UUID and version.
193 */
195{
196 struct interface_header *header = (struct interface_header *)if_handle;
197
198 TRACE("(%p,%p)\n", if_handle, if_id);
199
200 if_id->Uuid = header->id.SyntaxGUID;
201 if_id->VersMajor = header->id.SyntaxVersion.MajorVersion;
202 if_id->VersMinor = header->id.SyntaxVersion.MinorVersion;
203 TRACE("UUID:%s VersMajor:%hu VersMinor:%hu.\n", debugstr_guid(&if_id->Uuid), if_id->VersMajor,
204 if_id->VersMinor);
205 return RPC_S_OK;
206}
207
208/*************************************************************************
209 * RpcRaiseException [RPCRT4.@]
210 *
211 * Raises an exception.
212 */
214{
215 /* shouldn't return */
217 ERR("handler continued execution\n");
218 ExitProcess(1);
219}
220
221/*************************************************************************
222 * UuidCompare [RPCRT4.@]
223 *
224 * PARAMS
225 * UUID *Uuid1 [I] Uuid to compare
226 * UUID *Uuid2 [I] Uuid to compare
227 * RPC_STATUS *Status [O] returns RPC_S_OK
228 *
229 * RETURNS
230 * -1 if Uuid1 is less than Uuid2
231 * 0 if Uuid1 and Uuid2 are equal
232 * 1 if Uuid1 is greater than Uuid2
233 */
235{
236 int i;
237
238 TRACE("(%s,%s)\n", debugstr_guid(Uuid1), debugstr_guid(Uuid2));
239
240 *Status = RPC_S_OK;
241
242 if (!Uuid1) Uuid1 = &uuid_nil;
243 if (!Uuid2) Uuid2 = &uuid_nil;
244
245 if (Uuid1 == Uuid2) return 0;
246
247 if (Uuid1->Data1 != Uuid2->Data1)
248 return Uuid1->Data1 < Uuid2->Data1 ? -1 : 1;
249
250 if (Uuid1->Data2 != Uuid2->Data2)
251 return Uuid1->Data2 < Uuid2->Data2 ? -1 : 1;
252
253 if (Uuid1->Data3 != Uuid2->Data3)
254 return Uuid1->Data3 < Uuid2->Data3 ? -1 : 1;
255
256 for (i = 0; i < 8; i++) {
257 if (Uuid1->Data4[i] < Uuid2->Data4[i])
258 return -1;
259 if (Uuid1->Data4[i] > Uuid2->Data4[i])
260 return 1;
261 }
262
263 return 0;
264}
265
266/*************************************************************************
267 * UuidEqual [RPCRT4.@]
268 *
269 * PARAMS
270 * UUID *Uuid1 [I] Uuid to compare
271 * UUID *Uuid2 [I] Uuid to compare
272 * RPC_STATUS *Status [O] returns RPC_S_OK
273 *
274 * RETURNS
275 * TRUE/FALSE
276 */
278{
279 TRACE("(%s,%s)\n", debugstr_guid(Uuid1), debugstr_guid(Uuid2));
280 return !UuidCompare(Uuid1, Uuid2, Status);
281}
282
283/*************************************************************************
284 * UuidIsNil [RPCRT4.@]
285 *
286 * PARAMS
287 * UUID *Uuid [I] Uuid to compare
288 * RPC_STATUS *Status [O] returns RPC_S_OK
289 *
290 * RETURNS
291 * TRUE/FALSE
292 */
294{
295 TRACE("(%s)\n", debugstr_guid(Uuid));
296 if (!Uuid) return TRUE;
297 return !UuidCompare(Uuid, &uuid_nil, Status);
298}
299
300 /*************************************************************************
301 * UuidCreateNil [RPCRT4.@]
302 *
303 * PARAMS
304 * UUID *Uuid [O] returns a nil UUID
305 *
306 * RETURNS
307 * RPC_S_OK
308 */
310{
311 *Uuid = uuid_nil;
312 return RPC_S_OK;
313}
314
315/*************************************************************************
316 * UuidCreate [RPCRT4.@]
317 *
318 * Creates a 128bit UUID.
319 *
320 * RETURNS
321 *
322 * RPC_S_OK if successful.
323 * RPC_S_UUID_LOCAL_ONLY if UUID is only locally unique.
324 *
325 * NOTES
326 *
327 * Follows RFC 4122, section 4.4 (Algorithms for Creating a UUID from
328 * Truly Random or Pseudo-Random Numbers)
329 */
331{
332 RtlGenRandom(Uuid, sizeof(*Uuid));
333 /* Clear the version bits and set the version (4) */
334 Uuid->Data3 &= 0x0fff;
335 Uuid->Data3 |= (4 << 12);
336 /* Set the topmost bits of Data4 (clock_seq_hi_and_reserved) as
337 * specified in RFC 4122, section 4.4.
338 */
339 Uuid->Data4[0] &= 0x3f;
340 Uuid->Data4[0] |= 0x80;
341
342 TRACE("%s\n", debugstr_guid(Uuid));
343
344 return RPC_S_OK;
345}
346
347/* Number of 100ns ticks per clock tick. To be safe, assume that the clock
348 resolution is at least 1000 * 100 * (1/1000000) = 1/10 of a second */
349#define TICKS_PER_CLOCK_TICK 1000
350#define SECSPERDAY 86400
351#define TICKSPERSEC 10000000
352/* UUID system time starts at October 15, 1582 */
353#define SECS_15_OCT_1582_TO_1601 ((17 + 30 + 31 + 365 * 18 + 5) * SECSPERDAY)
354#define TICKS_15_OCT_1582_TO_1601 ((ULONGLONG)SECS_15_OCT_1582_TO_1601 * TICKSPERSEC)
355
357{
358 FILETIME ft;
359
361
362 *time = ((ULONGLONG)ft.dwHighDateTime << 32) | ft.dwLowDateTime;
364}
365
366/* Assume that a hardware address is at least 6 bytes long */
367#define ADDRESS_BYTES_NEEDED 6
368
370{
371 int i;
373
374 ULONG buflen = sizeof(IP_ADAPTER_INFO);
376
378 free(adapter);
379 adapter = malloc(buflen);
380 }
381
382 if (GetAdaptersInfo(adapter, &buflen) == NO_ERROR) {
383 for (i = 0; i < ADDRESS_BYTES_NEEDED; i++) {
384 address[i] = adapter->Address[i];
385 }
386 }
387 /* We can't get a hardware address, just use random numbers.
388 Set the multicast bit to prevent conflicts with real cards. */
389 else {
391 address[0] |= 0x01;
393 }
394
395 free(adapter);
396 return status;
397}
398
399/*************************************************************************
400 * UuidCreateSequential [RPCRT4.@]
401 *
402 * Creates a 128bit UUID.
403 *
404 * RETURNS
405 *
406 * RPC_S_OK if successful.
407 * RPC_S_UUID_LOCAL_ONLY if UUID is only locally unique.
408 *
409 * FIXME: No compensation for changes across reloading
410 * this dll or across reboots (e.g. clock going
411 * backwards and swapped network cards). The RFC
412 * suggests using NVRAM for storing persistent
413 * values.
414 */
416{
417 static BOOL initialised;
418 static int count;
419
421 static ULONGLONG timelast;
422 static WORD sequence;
423
424 static DWORD status;
426
428
429 if (!initialised) {
430 RPC_UuidGetSystemTime(&timelast);
432
433 sequence = ((rand() & 0xff) << 8) + (rand() & 0xff);
434 sequence &= 0x1fff;
435
437 initialised = TRUE;
438 }
439
440 /* Generate time element of the UUID. Account for going faster
441 than our clock as well as the clock going backwards. */
442 while (1) {
444 if (time > timelast) {
445 count = 0;
446 break;
447 }
448 if (time < timelast) {
449 sequence = (sequence + 1) & 0x1fff;
450 count = 0;
451 break;
452 }
454 count++;
455 break;
456 }
457 }
458
459 timelast = time;
460 time += count;
461
462 /* Pack the information into the UUID structure. */
463
464 Uuid->Data1 = (ULONG)(time & 0xffffffff);
465 Uuid->Data2 = (unsigned short)((time >> 32) & 0xffff);
466 Uuid->Data3 = (unsigned short)((time >> 48) & 0x0fff);
467
468 /* This is a version 1 UUID */
469 Uuid->Data3 |= (1 << 12);
470
471 Uuid->Data4[0] = sequence & 0xff;
472 Uuid->Data4[1] = (sequence & 0x3f00) >> 8;
473 Uuid->Data4[1] |= 0x80;
474 memcpy(&Uuid->Data4[2], address, ADDRESS_BYTES_NEEDED);
475
477
478 TRACE("%s\n", debugstr_guid(Uuid));
479
480 return status;
481}
482
483/*************************************************************************
484 * I_UuidCreate [RPCRT4.@]
485 *
486 * See UuidCreateSequential()
487 */
489{
490 return UuidCreateSequential(Uuid);
491}
492
493/*************************************************************************
494 * UuidHash [RPCRT4.@]
495 *
496 * Generates a hash value for a given UUID
497 *
498 * Code based on FreeDCE implementation
499 *
500 */
502{
503 BYTE *data = (BYTE*)uuid;
504 short c0 = 0, c1 = 0, x, y;
505 unsigned int i;
506
507 if (!uuid) data = (BYTE*)(uuid = &uuid_nil);
508
509 TRACE("(%s)\n", debugstr_guid(uuid));
510
511 for (i=0; i<sizeof(UUID); i++) {
512 c0 += data[i];
513 c1 += c0;
514 }
515
516 x = -c1 % 255;
517 if (x < 0) x += 255;
518
519 y = (c1 - c0) % 255;
520 if (y < 0) y += 255;
521
522 *Status = RPC_S_OK;
523 return y*256 + x;
524}
525
526/*************************************************************************
527 * UuidToStringA [RPCRT4.@]
528 *
529 * Converts a UUID to a string.
530 *
531 * UUID format is 8 hex digits, followed by a hyphen then three groups of
532 * 4 hex digits each followed by a hyphen and then 12 hex digits
533 *
534 * RETURNS
535 *
536 * S_OK if successful.
537 * S_OUT_OF_MEMORY if unsuccessful.
538 */
540{
541 *StringUuid = malloc(37);
542
543 if(!(*StringUuid))
544 return RPC_S_OUT_OF_MEMORY;
545
546 if (!Uuid) Uuid = &uuid_nil;
547
548#ifdef __REACTOS__
549 sprintf( (char*)*StringUuid, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
550 Uuid->Data1, Uuid->Data2, Uuid->Data3,
551 Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2],
552 Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5],
553 Uuid->Data4[6], Uuid->Data4[7] );
554#else
555 sprintf( (char*)*StringUuid, "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
556 Uuid->Data1, Uuid->Data2, Uuid->Data3,
557 Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2],
558 Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5],
559 Uuid->Data4[6], Uuid->Data4[7] );
560#endif
561
562 return RPC_S_OK;
563}
564
565/*************************************************************************
566 * UuidToStringW [RPCRT4.@]
567 *
568 * Converts a UUID to a string.
569 *
570 * S_OK if successful.
571 * S_OUT_OF_MEMORY if unsuccessful.
572 */
574{
575 char buf[37];
576
577 if (!Uuid) Uuid = &uuid_nil;
578
579#ifdef __REACTOS__
580 sprintf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
581 Uuid->Data1, Uuid->Data2, Uuid->Data3,
582 Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2],
583 Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5],
584 Uuid->Data4[6], Uuid->Data4[7] );
585#else
586 sprintf(buf, "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
587 Uuid->Data1, Uuid->Data2, Uuid->Data3,
588 Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2],
589 Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5],
590 Uuid->Data4[6], Uuid->Data4[7] );
591#endif
592
593 *StringUuid = RPCRT4_strdupAtoW(buf);
594
595 if(!(*StringUuid))
596 return RPC_S_OUT_OF_MEMORY;
597
598 return RPC_S_OK;
599}
600
601static const BYTE hex2bin[] =
602{
603 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x00 */
604 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x10 */
605 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x20 */
606 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, /* 0x30 */
607 0,10,11,12,13,14,15,0,0,0,0,0,0,0,0,0, /* 0x40 */
608 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x50 */
609 0,10,11,12,13,14,15 /* 0x60 */
610};
611
612/***********************************************************************
613 * UuidFromStringA (RPCRT4.@)
614 */
616{
617 int i;
618
619 if (!s) return UuidCreateNil( uuid );
620
621 if (strlen((char*)s) != 36) return RPC_S_INVALID_STRING_UUID;
622
623 if ((s[8]!='-') || (s[13]!='-') || (s[18]!='-') || (s[23]!='-'))
625
626 for (i=0; i<36; i++)
627 {
628 if ((i == 8)||(i == 13)||(i == 18)||(i == 23)) continue;
629 if (s[i] > 'f' || (!hex2bin[s[i]] && s[i] != '0')) return RPC_S_INVALID_STRING_UUID;
630 }
631
632 /* in form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */
633
634 uuid->Data1 = (hex2bin[s[0]] << 28 | hex2bin[s[1]] << 24 | hex2bin[s[2]] << 20 | hex2bin[s[3]] << 16 |
635 hex2bin[s[4]] << 12 | hex2bin[s[5]] << 8 | hex2bin[s[6]] << 4 | hex2bin[s[7]]);
636 uuid->Data2 = hex2bin[s[9]] << 12 | hex2bin[s[10]] << 8 | hex2bin[s[11]] << 4 | hex2bin[s[12]];
637 uuid->Data3 = hex2bin[s[14]] << 12 | hex2bin[s[15]] << 8 | hex2bin[s[16]] << 4 | hex2bin[s[17]];
638
639 /* these are just sequential bytes */
640 uuid->Data4[0] = hex2bin[s[19]] << 4 | hex2bin[s[20]];
641 uuid->Data4[1] = hex2bin[s[21]] << 4 | hex2bin[s[22]];
642 uuid->Data4[2] = hex2bin[s[24]] << 4 | hex2bin[s[25]];
643 uuid->Data4[3] = hex2bin[s[26]] << 4 | hex2bin[s[27]];
644 uuid->Data4[4] = hex2bin[s[28]] << 4 | hex2bin[s[29]];
645 uuid->Data4[5] = hex2bin[s[30]] << 4 | hex2bin[s[31]];
646 uuid->Data4[6] = hex2bin[s[32]] << 4 | hex2bin[s[33]];
647 uuid->Data4[7] = hex2bin[s[34]] << 4 | hex2bin[s[35]];
648 return RPC_S_OK;
649}
650
651
652/***********************************************************************
653 * UuidFromStringW (RPCRT4.@)
654 */
656{
657 int i;
658
659 if (!s) return UuidCreateNil( uuid );
660
661 if (lstrlenW(s) != 36) return RPC_S_INVALID_STRING_UUID;
662
663 if ((s[8]!='-') || (s[13]!='-') || (s[18]!='-') || (s[23]!='-'))
665
666 for (i=0; i<36; i++)
667 {
668 if ((i == 8)||(i == 13)||(i == 18)||(i == 23)) continue;
669 if (s[i] > 'f' || (!hex2bin[s[i]] && s[i] != '0')) return RPC_S_INVALID_STRING_UUID;
670 }
671
672 /* in form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */
673
674 uuid->Data1 = (hex2bin[s[0]] << 28 | hex2bin[s[1]] << 24 | hex2bin[s[2]] << 20 | hex2bin[s[3]] << 16 |
675 hex2bin[s[4]] << 12 | hex2bin[s[5]] << 8 | hex2bin[s[6]] << 4 | hex2bin[s[7]]);
676 uuid->Data2 = hex2bin[s[9]] << 12 | hex2bin[s[10]] << 8 | hex2bin[s[11]] << 4 | hex2bin[s[12]];
677 uuid->Data3 = hex2bin[s[14]] << 12 | hex2bin[s[15]] << 8 | hex2bin[s[16]] << 4 | hex2bin[s[17]];
678
679 /* these are just sequential bytes */
680 uuid->Data4[0] = hex2bin[s[19]] << 4 | hex2bin[s[20]];
681 uuid->Data4[1] = hex2bin[s[21]] << 4 | hex2bin[s[22]];
682 uuid->Data4[2] = hex2bin[s[24]] << 4 | hex2bin[s[25]];
683 uuid->Data4[3] = hex2bin[s[26]] << 4 | hex2bin[s[27]];
684 uuid->Data4[4] = hex2bin[s[28]] << 4 | hex2bin[s[29]];
685 uuid->Data4[5] = hex2bin[s[30]] << 4 | hex2bin[s[31]];
686 uuid->Data4[6] = hex2bin[s[32]] << 4 | hex2bin[s[33]];
687 uuid->Data4[7] = hex2bin[s[34]] << 4 | hex2bin[s[35]];
688 return RPC_S_OK;
689}
690
691#define MAX_RPC_ERROR_TEXT 256
692
693/******************************************************************************
694 * DceErrorInqTextW (rpcrt4.@)
695 *
696 * Notes
697 * 1. On passing a NULL pointer the code does bomb out.
698 * 2. The size of the required buffer is not defined in the documentation.
699 * It appears to be 256.
700 * 3. The function is defined to return RPC_S_INVALID_ARG but I don't know
701 * of any value for which it does.
702 * 4. The MSDN documentation currently declares that the second argument is
703 * unsigned char *, even for the W version. I don't believe it.
704 */
706{
707 DWORD count;
711 if (!count)
712 {
716 if (!count)
717 {
718 ERR ("Failed to translate error\n");
719 return RPC_S_INVALID_ARG;
720 }
721 }
722 return RPC_S_OK;
723}
724
725/******************************************************************************
726 * DceErrorInqTextA (rpcrt4.@)
727 */
729{
731 WCHAR bufferW [MAX_RPC_ERROR_TEXT];
732 if ((status = DceErrorInqTextW (e, bufferW)) == RPC_S_OK)
733 {
735 NULL, NULL))
736 {
737 ERR ("Failed to translate error\n");
739 }
740 }
741 return status;
742}
743
744/******************************************************************************
745 * I_RpcAllocate (rpcrt4.@)
746 */
747void * WINAPI I_RpcAllocate(unsigned int Size)
748{
749 return malloc(Size);
750}
751
752/******************************************************************************
753 * I_RpcFree (rpcrt4.@)
754 */
756{
757 free(Object);
758}
759
760/******************************************************************************
761 * I_RpcMapWin32Status (rpcrt4.@)
762 *
763 * Maps Win32 RPC error codes to NT statuses.
764 *
765 * PARAMS
766 * status [I] Win32 RPC error code.
767 *
768 * RETURNS
769 * Appropriate translation into an NT status code.
770 */
772{
773 TRACE("(%ld)\n", status);
774 switch (status)
775 {
882 default: return status;
883 }
884}
885
886/******************************************************************************
887 * RpcExceptionFilter (rpcrt4.@)
888 * I_RpcExceptionFilter (rpcrt4.@)
889 */
891{
892 TRACE("0x%lx\n", ExceptionCode);
893 switch (ExceptionCode)
894 {
904 default:
906 }
907}
908
909/******************************************************************************
910 * RpcErrorStartEnumeration (rpcrt4.@)
911 */
913{
914 FIXME("(%p): stub\n", EnumHandle);
916}
917
918/******************************************************************************
919 * RpcErrorEndEnumeration (rpcrt4.@)
920 */
922{
923 FIXME("(%p): stub\n", EnumHandle);
924 return RPC_S_OK;
925}
926
927/******************************************************************************
928 * RpcErrorSaveErrorInfo (rpcrt4.@)
929 */
931{
932 FIXME("(%p %p %p): stub\n", EnumHandle, ErrorBlob, BlobSize);
934}
935
936/******************************************************************************
937 * RpcErrorLoadErrorInfo (rpcrt4.@)
938 */
940{
941 FIXME("(%p %Iu %p): stub\n", ErrorBlob, BlobSize, EnumHandle);
943}
944
945/******************************************************************************
946 * RpcErrorGetNextRecord (rpcrt4.@)
947 */
949{
950 FIXME("(%p %x %p): stub\n", EnumHandle, CopyStrings, ErrorInfo);
952}
953
954/******************************************************************************
955 * RpcMgmtSetCancelTimeout (rpcrt4.@)
956 */
958{
959 FIXME("(%ld): stub\n", Timeout);
960 return RPC_S_OK;
961}
962
964{
965 struct threaddata *tdata = NtCurrentTeb()->ReservedForNtRpc;
966 if (!tdata)
967 {
968 tdata = calloc(1, sizeof(*tdata));
969 if (!tdata) return NULL;
970
972 tdata->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": threaddata.cs");
973 tdata->thread_id = GetCurrentThreadId();
974
978
979 NtCurrentTeb()->ReservedForNtRpc = tdata;
980 return tdata;
981 }
982 return tdata;
983}
984
986{
987 struct threaddata *tdata = get_or_create_threaddata();
988 if (!tdata) return;
989
990 EnterCriticalSection(&tdata->cs);
991 tdata->connection = Connection;
992 LeaveCriticalSection(&tdata->cs);
993}
994
996{
997 struct threaddata *tdata = get_or_create_threaddata();
998 if (!tdata) return;
999
1000 tdata->server_binding = Binding;
1001}
1002
1004{
1005 struct threaddata *tdata = get_or_create_threaddata();
1006 if (!tdata) return NULL;
1007
1008 return tdata->server_binding;
1009}
1010
1012{
1013 struct threaddata *tdata = get_or_create_threaddata();
1015
1016 if (!tdata) return;
1017
1019 if (!context_handle_list) return;
1020
1024}
1025
1027{
1028 struct threaddata *tdata = get_or_create_threaddata();
1029 struct context_handle_list *current, *prev;
1030
1031 if (!tdata) return;
1032
1033 for (current = tdata->context_handle_list, prev = NULL; current; prev = current, current = current->next)
1034 {
1035 if (current->context_handle == SContext)
1036 {
1037 if (prev)
1038 prev->next = current->next;
1039 else
1040 tdata->context_handle_list = current->next;
1041 free(current);
1042 return;
1043 }
1044 }
1045}
1046
1048{
1049 struct threaddata *tdata = get_or_create_threaddata();
1052
1053 if (!tdata) return NULL;
1054
1056 if (!context_handle_list) return NULL;
1058
1061 return context_handle;
1062}
1063
1065{
1066 struct threaddata *tdata;
1067
1070 if (tdata->thread_id == target_tid)
1071 {
1072 EnterCriticalSection(&tdata->cs);
1073 if (tdata->connection) rpcrt4_conn_cancel_call(tdata->connection);
1074 LeaveCriticalSection(&tdata->cs);
1075 break;
1076 }
1078
1079 return RPC_S_OK;
1080}
1081
1082/******************************************************************************
1083 * RpcCancelThread (rpcrt4.@)
1084 */
1086{
1087 TRACE("(%p)\n", ThreadHandle);
1088 return RpcCancelThreadEx(ThreadHandle, 0);
1089}
1090
1091/******************************************************************************
1092 * RpcCancelThreadEx (rpcrt4.@)
1093 */
1095{
1096 DWORD target_tid;
1097
1098 FIXME("(%p, %ld)\n", ThreadHandle, Timeout);
1099
1100 target_tid = GetThreadId(ThreadHandle);
1101 if (!target_tid)
1102 return RPC_S_INVALID_ARG;
1103
1104 if (Timeout)
1105 {
1106 FIXME("(%p, %ld)\n", ThreadHandle, Timeout);
1107 return RPC_S_OK;
1108 }
1109 else
1110 return rpc_cancel_thread(target_tid);
1111}
static struct recvd_message * sequence
Definition: SystemMenu.c:63
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static DWORD const fdwReason
#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
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
_Inout_ PIRP _In_ NTSTATUS ExceptionCode
Definition: cdprocs.h:1774
Definition: list.h:37
#define STATUS_ILLEGAL_INSTRUCTION
Definition: d3dkmdt.h:41
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
#define NO_ERROR
Definition: dderror.h:5
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define DLL_THREAD_DETACH
Definition: compat.h:133
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define CP_ACP
Definition: compat.h:109
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define WideCharToMultiByte
Definition: compat.h:111
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
#define lstrlenW
Definition: compat.h:750
VOID WINAPI RaiseException(_In_ DWORD dwExceptionCode, _In_ DWORD dwExceptionFlags, _In_ DWORD nNumberOfArguments, _In_opt_ const ULONG_PTR *lpArguments)
Definition: except.c:700
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1489
DWORD WINAPI GetThreadId(IN HANDLE Thread)
Definition: thread.c:913
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
Definition: time.c:128
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:107
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define STATUS_ACCESS_VIOLATION
return adapter
Status
Definition: gdiplustypes.h:25
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint address
Definition: glext.h:9393
GLuint buffer
Definition: glext.h:5915
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
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
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define EXCEPTION_CONTINUE_SEARCH
Definition: excpt.h:91
Definition: msctf.idl:532
unsigned short Data3
Definition: widltypes.h:34
unsigned int Data1
Definition: widltypes.h:32
unsigned char Data4[8]
Definition: widltypes.h:35
unsigned short Data2
Definition: widltypes.h:33
DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
#define NtCurrentTeb
uint32_t entry
Definition: isohybrid.c:63
#define e
Definition: ke_i.h:82
#define debugstr_guid
Definition: kernel32.h:35
static IN DWORD IN LPVOID lpvReserved
__u16 time
Definition: mkdosfs.c:8
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GUID UUID
Definition: module.h:1093
struct task_struct * current
Definition: linux.c:32
#define sprintf
Definition: sprintf.c:45
#define DECLSPEC_NORETURN
Definition: ntbasedef.h:179
#define RtlGenRandom
Definition: ntsecapi.h:691
#define RPC_NT_INVALID_NAF_ID
Definition: ntstatus.h:1593
#define EPT_NT_INVALID_ENTRY
Definition: ntstatus.h:1581
#define RPC_NT_SERVER_UNAVAILABLE
Definition: ntstatus.h:1555
#define RPC_NT_UNSUPPORTED_TYPE
Definition: ntstatus.h:1563
#define STATUS_WRONG_PASSWORD
Definition: ntstatus.h:436
#define RPC_NT_INTERFACE_NOT_FOUND
Definition: ntstatus.h:1589
#define RPC_NT_INVALID_NETWORK_OPTIONS
Definition: ntstatus.h:1557
#define RPC_NT_INVALID_RPC_PROTSEQ
Definition: ntstatus.h:1537
#define RPC_NT_BAD_STUB_DATA
Definition: ntstatus.h:1632
#define STATUS_INVALID_LOGON_HOURS
Definition: ntstatus.h:441
#define RPC_NT_INTERNAL_ERROR
Definition: ntstatus.h:1596
#define RPC_NT_UNKNOWN_AUTHN_LEVEL
Definition: ntstatus.h:1578
#define RPC_NT_SS_IN_NULL_CONTEXT
Definition: ntstatus.h:1624
#define RPC_NT_ENUM_VALUE_OUT_OF_RANGE
Definition: ntstatus.h:1630
#define RPC_NT_PIPE_CLOSED
Definition: ntstatus.h:1639
#define STATUS_POSSIBLE_DEADLOCK
Definition: ntstatus.h:731
#define RPC_NT_ENTRY_ALREADY_EXISTS
Definition: ntstatus.h:1590
#define RPC_NT_DUPLICATE_ENDPOINT
Definition: ntstatus.h:1570
#define RPC_NT_CALL_IN_PROGRESS
Definition: ntstatus.h:1602
#define RPC_NT_NO_CALL_ACTIVE
Definition: ntstatus.h:1558
#define RPC_NT_NO_ENDPOINT_FOUND
Definition: ntstatus.h:1541
#define RPC_NT_STRING_TOO_LONG
Definition: ntstatus.h:1573
#define STATUS_INSTRUCTION_MISALIGNMENT
Definition: ntstatus.h:500
#define RPC_NT_PROCNUM_OUT_OF_RANGE
Definition: ntstatus.h:1575
#define STATUS_ACCOUNT_DISABLED
Definition: ntstatus.h:444
#define RPC_NT_PIPE_EMPTY
Definition: ntstatus.h:1641
#define RPC_NT_NO_MORE_ENTRIES
Definition: ntstatus.h:1621
#define STATUS_PASSWORD_MUST_CHANGE
Definition: ntstatus.h:802
#define RPC_NT_BYTE_COUNT_TOO_SMALL
Definition: ntstatus.h:1631
#define RPC_NT_SS_CONTEXT_MISMATCH
Definition: ntstatus.h:1625
#define RPC_NT_WRONG_KIND_OF_BINDING
Definition: ntstatus.h:1534
#define RPC_NT_ALREADY_REGISTERED
Definition: ntstatus.h:1544
#define EPT_NT_NOT_REGISTERED
Definition: ntstatus.h:1583
#define RPC_NT_INVALID_ASYNC_HANDLE
Definition: ntstatus.h:1616
#define RPC_NT_INVALID_NAME_SYNTAX
Definition: ntstatus.h:1567
#define RPC_NT_NOTHING_TO_EXPORT
Definition: ntstatus.h:1584
#define STATUS_STACK_OVERFLOW
Definition: ntstatus.h:583
#define RPC_NT_UNKNOWN_IF
Definition: ntstatus.h:1550
#define RPC_NT_PROTOCOL_ERROR
Definition: ntstatus.h:1561
#define RPC_NT_ENTRY_NOT_FOUND
Definition: ntstatus.h:1591
#define RPC_NT_NO_PROTSEQS_REGISTERED
Definition: ntstatus.h:1547
#define RPC_NT_NULL_REF_POINTER
Definition: ntstatus.h:1629
#define RPC_NT_GROUP_MEMBER_NOT_FOUND
Definition: ntstatus.h:1604
#define RPC_NT_SS_CHAR_TRANS_OPEN_FAIL
Definition: ntstatus.h:1622
#define RPC_NT_UNSUPPORTED_TRANS_SYN
Definition: ntstatus.h:1562
#define RPC_NT_INVALID_STRING_UUID
Definition: ntstatus.h:1538
#define RPC_NT_NOT_LISTENING
Definition: ntstatus.h:1548
#define RPC_NT_OBJECT_NOT_FOUND
Definition: ntstatus.h:1543
#define STATUS_INSUFF_SERVER_RESOURCES
Definition: ntstatus.h:771
#define RPC_NT_INVALID_AUTH_IDENTITY
Definition: ntstatus.h:1579
#define RPC_NT_INVALID_ASYNC_CALL
Definition: ntstatus.h:1617
#define RPC_NT_SS_CHAR_TRANS_SHORT_FILE
Definition: ntstatus.h:1623
#define RPC_NT_PROTSEQ_NOT_FOUND
Definition: ntstatus.h:1574
#define RPC_NT_SS_CANNOT_GET_CALL_HANDLE
Definition: ntstatus.h:1628
#define RPC_NT_NO_ENTRY_NAME
Definition: ntstatus.h:1566
#define RPC_NT_CALL_CANCELLED
Definition: ntstatus.h:1608
#define RPC_NT_TYPE_ALREADY_REGISTERED
Definition: ntstatus.h:1545
#define RPC_NT_UUID_NO_ADDRESS
Definition: ntstatus.h:1569
#define RPC_NT_OUT_OF_RESOURCES
Definition: ntstatus.h:1554
#define STATUS_INVALID_SECURITY_DESCR
Definition: ntstatus.h:451
#define STATUS_PRIVILEGED_INSTRUCTION
Definition: ntstatus.h:480
#define STATUS_BREAKPOINT
Definition: ntstatus.h:264
#define RPC_NT_NO_CONTEXT_AVAILABLE
Definition: ntstatus.h:1595
#define RPC_NT_PIPE_DISCIPLINE_ERROR
Definition: ntstatus.h:1640
#define RPC_NT_MAX_CALLS_TOO_SMALL
Definition: ntstatus.h:1572
#define RPC_NT_INVALID_STRING_BINDING
Definition: ntstatus.h:1533
#define RPC_NT_NO_PROTSEQS
Definition: ntstatus.h:1552
#define RPC_NT_SS_HANDLES_MISMATCH
Definition: ntstatus.h:1627
#define STATUS_PASSWORD_EXPIRED
Definition: ntstatus.h:443
#define RPC_NT_NO_BINDINGS
Definition: ntstatus.h:1551
#define RPC_NT_FP_DIV_ZERO
Definition: ntstatus.h:1599
#define RPC_NT_FP_UNDERFLOW
Definition: ntstatus.h:1600
#define RPC_NT_INCOMPLETE_NAME
Definition: ntstatus.h:1585
#define RPC_NT_SS_CONTEXT_DAMAGED
Definition: ntstatus.h:1626
#define RPC_NT_SERVER_TOO_BUSY
Definition: ntstatus.h:1556
#define RPC_NT_FP_OVERFLOW
Definition: ntstatus.h:1601
#define RPC_NT_UNKNOWN_AUTHN_SERVICE
Definition: ntstatus.h:1577
#define RPC_NT_INVALID_TIMEOUT
Definition: ntstatus.h:1542
#define RPC_NT_CANNOT_SUPPORT
Definition: ntstatus.h:1594
#define RPC_NT_PROTSEQ_NOT_SUPPORTED
Definition: ntstatus.h:1536
#define RPC_NT_INVALID_NET_ADDR
Definition: ntstatus.h:1540
#define STATUS_DATATYPE_MISALIGNMENT
Definition: ntstatus.h:263
#define RPC_NT_INVALID_BOUND
Definition: ntstatus.h:1565
#define RPC_NT_NO_MORE_BINDINGS
Definition: ntstatus.h:1603
#define RPC_NT_INVALID_OBJECT
Definition: ntstatus.h:1606
#define RPC_NT_ZERO_DIVIDE
Definition: ntstatus.h:1597
#define RPC_NT_UNKNOWN_AUTHZ_SERVICE
Definition: ntstatus.h:1580
#define RPC_NT_BINDING_HAS_NO_AUTH
Definition: ntstatus.h:1576
#define RPC_NT_INVALID_BINDING
Definition: ntstatus.h:1535
#define RPC_NT_UNSUPPORTED_NAME_SYNTAX
Definition: ntstatus.h:1568
#define RPC_NT_UNKNOWN_MGR_TYPE
Definition: ntstatus.h:1549
#define RPC_NT_CANT_CREATE_ENDPOINT
Definition: ntstatus.h:1553
#define STATUS_ACCOUNT_LOCKED_OUT
Definition: ntstatus.h:818
#define RPC_NT_NAME_SERVICE_UNAVAILABLE
Definition: ntstatus.h:1592
#define EPT_NT_CANT_PERFORM_OP
Definition: ntstatus.h:1582
#define RPC_NT_NOT_ALL_OBJS_UNEXPORTED
Definition: ntstatus.h:1588
#define RPC_NT_NO_MORE_MEMBERS
Definition: ntstatus.h:1587
#define RPC_NT_INVALID_ENDPOINT_FORMAT
Definition: ntstatus.h:1539
#define RPC_NT_ALREADY_LISTENING
Definition: ntstatus.h:1546
#define RPC_NT_UNKNOWN_AUTHN_TYPE
Definition: ntstatus.h:1571
#define EPT_NT_CANT_CREATE
Definition: ntstatus.h:1605
#define RPC_NT_ADDRESS_ERROR
Definition: ntstatus.h:1598
#define RPC_NT_CALL_FAILED
Definition: ntstatus.h:1559
#define RPC_NT_CALL_FAILED_DNE
Definition: ntstatus.h:1560
#define RPC_NT_INVALID_TAG
Definition: ntstatus.h:1564
#define RPC_NT_INVALID_VERS_OPTION
Definition: ntstatus.h:1586
long LONG
Definition: pedump.c:60
static ULONG Timeout
Definition: ping.c:61
struct _IP_ADAPTER_INFO IP_ADAPTER_INFO
#define MAX_ADAPTER_ADDRESS_LENGTH
Definition: iptypes.h:17
#define calloc
Definition: rosglue.h:14
LPWSTR RPCRT4_strdupAtoW(LPCSTR src)
Definition: rpc_binding.c:57
static void rpcrt4_conn_cancel_call(RpcConnection *Connection)
Definition: rpc_binding.h:206
void RPCRT4_destroy_all_protseqs(void)
Definition: rpc_server.c:1094
void RPCRT4_ServerFreeAllRegisteredAuthInfo(void)
Definition: rpc_server.c:1396
unsigned short * RPC_WSTR
Definition: rpcdce.h:46
unsigned char * RPC_CSTR
Definition: rpcdce.h:45
#define RPC_S_INVALID_ARG
Definition: rpcnterr.h:23
#define RPC_S_OUT_OF_MEMORY
Definition: rpcnterr.h:24
#define RPC_S_OK
Definition: rpcnterr.h:22
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:771
RPC_STATUS RPC_ENTRY RpcErrorLoadErrorInfo(void *ErrorBlob, SIZE_T BlobSize, RPC_ERROR_ENUM_HANDLE *EnumHandle)
Definition: rpcrt4_main.c:939
static const BYTE hex2bin[]
Definition: rpcrt4_main.c:601
#define TICKS_15_OCT_1582_TO_1601
Definition: rpcrt4_main.c:354
int WINAPI RpcExceptionFilter(ULONG ExceptionCode)
Definition: rpcrt4_main.c:890
static CRITICAL_SECTION uuid_cs
Definition: rpcrt4_main.c:62
RPC_STATUS WINAPI UuidCreateSequential(UUID *Uuid)
Definition: rpcrt4_main.c:415
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
Definition: rpcrt4_main.c:117
RPC_STATUS WINAPI UuidCreateNil(UUID *Uuid)
Definition: rpcrt4_main.c:309
RPC_STATUS WINAPI UuidToStringA(UUID *Uuid, RPC_CSTR *StringUuid)
Definition: rpcrt4_main.c:539
RPC_STATUS RPC_ENTRY RpcErrorEndEnumeration(RPC_ERROR_ENUM_HANDLE *EnumHandle)
Definition: rpcrt4_main.c:921
static CRITICAL_SECTION_DEBUG critsect_debug
Definition: rpcrt4_main.c:63
static RPC_STATUS RPC_UuidGetNodeAddress(BYTE *address)
Definition: rpcrt4_main.c:369
void RPCRT4_RemoveThreadContextHandle(NDR_SCONTEXT SContext)
Definition: rpcrt4_main.c:1026
RPC_STATUS WINAPI UuidToStringW(UUID *Uuid, RPC_WSTR *StringUuid)
Definition: rpcrt4_main.c:573
static CRITICAL_SECTION_DEBUG threaddata_cs_debug
Definition: rpcrt4_main.c:72
RPC_STATUS RPC_ENTRY RpcErrorSaveErrorInfo(RPC_ERROR_ENUM_HANDLE *EnumHandle, void **ErrorBlob, SIZE_T *BlobSize)
Definition: rpcrt4_main.c:930
int WINAPI UuidIsNil(UUID *Uuid, RPC_STATUS *Status)
Definition: rpcrt4_main.c:293
RPC_STATUS RPC_ENTRY DceErrorInqTextA(RPC_STATUS e, RPC_CSTR buffer)
Definition: rpcrt4_main.c:728
RPC_STATUS WINAPI I_UuidCreate(UUID *Uuid)
Definition: rpcrt4_main.c:488
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:181
RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR *String)
Definition: rpcrt4_main.c:164
static struct list threaddata_list
Definition: rpcrt4_main.c:80
NDR_SCONTEXT RPCRT4_PopThreadContextHandle(void)
Definition: rpcrt4_main.c:1047
RPC_STATUS RPC_ENTRY RpcErrorGetNextRecord(RPC_ERROR_ENUM_HANDLE *EnumHandle, BOOL CopyStrings, RPC_EXTENDED_ERROR_INFO *ErrorInfo)
Definition: rpcrt4_main.c:948
static void RPC_UuidGetSystemTime(ULONGLONG *time)
Definition: rpcrt4_main.c:356
RPC_STATUS RPC_ENTRY DceErrorInqTextW(RPC_STATUS e, RPC_WSTR buffer)
Definition: rpcrt4_main.c:705
RPC_STATUS RPC_ENTRY RpcCancelThreadEx(void *ThreadHandle, LONG Timeout)
Definition: rpcrt4_main.c:1094
RPC_STATUS WINAPI RpcIfInqId(RPC_IF_HANDLE if_handle, RPC_IF_ID *if_id)
Definition: rpcrt4_main.c:194
RPC_STATUS WINAPI UuidFromStringW(RPC_WSTR s, UUID *uuid)
Definition: rpcrt4_main.c:655
void RPCRT4_PushThreadContextHandle(NDR_SCONTEXT SContext)
Definition: rpcrt4_main.c:1011
int WINAPI UuidEqual(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status)
Definition: rpcrt4_main.c:277
void RPCRT4_SetThreadCurrentCallHandle(RpcBinding *Binding)
Definition: rpcrt4_main.c:995
void WINAPI I_RpcFree(void *Object)
Definition: rpcrt4_main.c:755
RPC_STATUS WINAPI UuidFromStringA(RPC_CSTR s, UUID *uuid)
Definition: rpcrt4_main.c:615
RpcBinding * RPCRT4_GetThreadCurrentCallHandle(void)
Definition: rpcrt4_main.c:1003
RPC_STATUS RPC_ENTRY RpcErrorStartEnumeration(RPC_ERROR_ENUM_HANDLE *EnumHandle)
Definition: rpcrt4_main.c:912
RPC_STATUS RPC_ENTRY RpcMgmtSetCancelTimeout(LONG Timeout)
Definition: rpcrt4_main.c:957
RPC_STATUS RPC_ENTRY RpcCancelThread(void *ThreadHandle)
Definition: rpcrt4_main.c:1085
RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
Definition: rpcrt4_main.c:330
#define TICKS_PER_CLOCK_TICK
Definition: rpcrt4_main.c:349
void *WINAPI I_RpcAllocate(unsigned int Size)
Definition: rpcrt4_main.c:747
int WINAPI UuidCompare(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status)
Definition: rpcrt4_main.c:234
static UUID uuid_nil
Definition: rpcrt4_main.c:60
#define MAX_RPC_ERROR_TEXT
Definition: rpcrt4_main.c:691
unsigned short WINAPI UuidHash(UUID *uuid, RPC_STATUS *Status)
Definition: rpcrt4_main.c:501
static struct threaddata * get_or_create_threaddata(void)
Definition: rpcrt4_main.c:963
void RPCRT4_SetThreadCurrentConnection(RpcConnection *Connection)
Definition: rpcrt4_main.c:985
#define ADDRESS_BYTES_NEEDED
Definition: rpcrt4_main.c:367
static RPC_STATUS rpc_cancel_thread(DWORD target_tid)
Definition: rpcrt4_main.c:1064
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:213
static CRITICAL_SECTION threaddata_cs
Definition: rpcrt4_main.c:71
_Check_return_ int __cdecl rand(void)
Definition: rand.c:10
#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 STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwHighDateTime
Definition: mapidefs.h:66
DWORD dwLowDateTime
Definition: mapidefs.h:65
unsigned short VersMajor
Definition: rpcdce.h:72
UUID Uuid
Definition: rpcdce.h:71
unsigned short VersMinor
Definition: rpcdce.h:73
PRTL_CRITICAL_SECTION_DEBUG DebugInfo
Definition: rtltypes.h:1450
NDR_SCONTEXT context_handle
Definition: rpcrt4_main.c:85
struct context_handle_list * next
Definition: rpcrt4_main.c:84
RPC_SYNTAX_IDENTIFIER id
Definition: rpcrt4_main.c:101
unsigned int length
Definition: rpcrt4_main.c:100
Definition: ps.c:97
RpcBinding * server_binding
Definition: rpcrt4_main.c:94
struct list entry
Definition: rpcrt4_main.c:90
struct context_handle_list * context_handle_list
Definition: rpcrt4_main.c:95
DWORD thread_id
Definition: rpcrt4_main.c:92
RpcConnection * connection
Definition: rpcrt4_main.c:93
CRITICAL_SECTION cs
Definition: rpcrt4_main.c:91
#define LIST_INIT(head)
Definition: queue.h:197
#define DWORD_PTR
Definition: treelist.c:76
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2439
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:397
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:400
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define WINAPI
Definition: msvc.h:6
#define RPC_S_SERVER_TOO_BUSY
Definition: winerror.h:1390
#define EPT_S_INVALID_ENTRY
Definition: winerror.h:1416
#define RPC_S_PROTSEQ_NOT_SUPPORTED
Definition: winerror.h:1370
#define RPC_S_TYPE_ALREADY_REGISTERED
Definition: winerror.h:1379
#define RPC_S_NOTHING_TO_EXPORT
Definition: winerror.h:1419
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:307
#define RPC_S_NO_MORE_MEMBERS
Definition: winerror.h:1422
#define ERROR_INVALID_SECURITY_DESCR
Definition: winerror.h:1165
#define RPC_S_CALL_IN_PROGRESS
Definition: winerror.h:1455
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1388
#define RPC_S_CALL_FAILED_DNE
Definition: winerror.h:1394
#define RPC_S_ADDRESS_ERROR
Definition: winerror.h:1433
#define RPC_S_INVALID_NAME_SYNTAX
Definition: winerror.h:1402
#define RPC_X_SS_HANDLES_MISMATCH
Definition: winerror.h:1442
#define ERROR_INVALID_LOGON_HOURS
Definition: winerror.h:1155
#define EPT_S_NOT_REGISTERED
Definition: winerror.h:1418
#define RPC_S_UNSUPPORTED_TRANS_SYN
Definition: winerror.h:1397
#define RPC_S_INVALID_BOUND
Definition: winerror.h:1400
#define RPC_S_CALL_FAILED
Definition: winerror.h:1393
#define RPC_S_WRONG_KIND_OF_BINDING
Definition: winerror.h:1368
#define RPC_S_NO_CALL_ACTIVE
Definition: winerror.h:1392
#define RPC_S_INVALID_STRING_BINDING
Definition: winerror.h:1367
#define RPC_S_ENTRY_ALREADY_EXISTS
Definition: winerror.h:1425
#define RPC_S_INVALID_TAG
Definition: winerror.h:1399
#define RPC_S_INVALID_ASYNC_CALL
Definition: winerror.h:1518
#define EPT_S_CANT_PERFORM_OP
Definition: winerror.h:1417
#define RPC_S_NOT_ALL_OBJS_UNEXPORTED
Definition: winerror.h:1423
#define RPC_X_ENUM_VALUE_OUT_OF_RANGE
Definition: winerror.h:1445
#define RPC_S_ALREADY_LISTENING
Definition: winerror.h:1380
#define RPC_X_SS_IN_NULL_CONTEXT
Definition: winerror.h:1440
#define RPC_S_INVALID_AUTH_IDENTITY
Definition: winerror.h:1414
#define RPC_S_FP_DIV_ZERO
Definition: winerror.h:1434
#define RPC_X_PIPE_DISCIPLINE_ERROR
Definition: winerror.h:1520
#define RPC_S_NAME_SERVICE_UNAVAILABLE
Definition: winerror.h:1427
#define RPC_S_UNSUPPORTED_TYPE
Definition: winerror.h:1398
#define RPC_S_UNKNOWN_IF
Definition: winerror.h:1384
#define RPC_X_BAD_STUB_DATA
Definition: winerror.h:1447
#define RPC_S_BINDING_HAS_NO_AUTH
Definition: winerror.h:1411
#define RPC_S_NO_MORE_BINDINGS
Definition: winerror.h:1470
#define RPC_S_OBJECT_NOT_FOUND
Definition: winerror.h:1377
#define RPC_S_CANT_CREATE_ENDPOINT
Definition: winerror.h:1387
#define RPC_S_INVALID_STRING_UUID
Definition: winerror.h:1372
#define RPC_S_CANNOT_SUPPORT
Definition: winerror.h:1429
#define RPC_S_INVALID_ASYNC_HANDLE
Definition: winerror.h:1517
#define RPC_X_SS_CHAR_TRANS_OPEN_FAIL
Definition: winerror.h:1438
#define RPC_S_INVALID_NAF_ID
Definition: winerror.h:1428
#define RPC_S_FP_UNDERFLOW
Definition: winerror.h:1435
#define RPC_S_CALL_CANCELLED
Definition: winerror.h:1482
#define RPC_X_NO_MORE_ENTRIES
Definition: winerror.h:1437
#define RPC_S_PROTOCOL_ERROR
Definition: winerror.h:1395
#define RPC_S_NO_BINDINGS
Definition: winerror.h:1385
#define RPC_X_NULL_REF_POINTER
Definition: winerror.h:1444
#define RPC_S_INVALID_TIMEOUT
Definition: winerror.h:1376
#define RPC_X_PIPE_CLOSED
Definition: winerror.h:1519
#define RPC_S_ZERO_DIVIDE
Definition: winerror.h:1432
#define RPC_S_ENTRY_NOT_FOUND
Definition: winerror.h:1426
#define RPC_X_PIPE_EMPTY
Definition: winerror.h:1521
#define RPC_S_NO_CONTEXT_AVAILABLE
Definition: winerror.h:1430
#define RPC_S_UNKNOWN_AUTHN_TYPE
Definition: winerror.h:1406
#define RPC_S_NO_ENDPOINT_FOUND
Definition: winerror.h:1375
#define EPT_S_CANT_CREATE
Definition: winerror.h:1502
#define RPC_S_GROUP_MEMBER_NOT_FOUND
Definition: winerror.h:1501
#define ERROR_ACCOUNT_LOCKED_OUT
Definition: winerror.h:1512
#define RPC_S_UNKNOWN_AUTHN_LEVEL
Definition: winerror.h:1413
#define RPC_S_INVALID_VERS_OPTION
Definition: winerror.h:1421
#define RPC_S_NOT_LISTENING
Definition: winerror.h:1382
#define RPC_S_UNSUPPORTED_NAME_SYNTAX
Definition: winerror.h:1403
#define ERROR_ACCOUNT_DISABLED
Definition: winerror.h:1158
#define RPC_S_UNKNOWN_AUTHN_SERVICE
Definition: winerror.h:1412
#define RPC_X_SS_CANNOT_GET_CALL_HANDLE
Definition: winerror.h:1443
#define RPC_X_BYTE_COUNT_TOO_SMALL
Definition: winerror.h:1446
#define ERROR_WRONG_PASSWORD
Definition: winerror.h:1150
#define RPC_S_UUID_LOCAL_ONLY
Definition: winerror.h:1488
#define ERROR_PASSWORD_MUST_CHANGE
Definition: winerror.h:1510
#define RPC_S_INCOMPLETE_NAME
Definition: winerror.h:1420
#define RPC_S_NO_PROTSEQS
Definition: winerror.h:1386
#define RPC_S_PROTSEQ_NOT_FOUND
Definition: winerror.h:1409
#define ERROR_MAX_THRDS_REACHED
Definition: winerror.h:357
#define RPC_S_STRING_TOO_LONG
Definition: winerror.h:1408
#define RPC_S_INTERNAL_ERROR
Definition: winerror.h:1431
#define RPC_S_SERVER_UNAVAILABLE
Definition: winerror.h:1389
#define RPC_X_SS_CONTEXT_DAMAGED
Definition: winerror.h:1441
#define RPC_S_INVALID_NETWORK_OPTIONS
Definition: winerror.h:1391
#define ERROR_PASSWORD_EXPIRED
Definition: winerror.h:1157
#define RPC_S_ALREADY_REGISTERED
Definition: winerror.h:1378
#define RPC_S_INVALID_NET_ADDR
Definition: winerror.h:1374
#define RPC_S_INTERFACE_NOT_FOUND
Definition: winerror.h:1424
#define RPC_S_INVALID_ENDPOINT_FORMAT
Definition: winerror.h:1373
#define RPC_S_INVALID_BINDING
Definition: winerror.h:1369
#define RPC_S_INVALID_OBJECT
Definition: winerror.h:1503
#define RPC_S_UUID_NO_ADDRESS
Definition: winerror.h:1404
#define RPC_S_DUPLICATE_ENDPOINT
Definition: winerror.h:1405
#define ERROR_NOACCESS
Definition: winerror.h:902
#define RPC_S_MAX_CALLS_TOO_SMALL
Definition: winerror.h:1407
#define RPC_S_INVALID_RPC_PROTSEQ
Definition: winerror.h:1371
#define RPC_S_NO_ENTRY_NAME
Definition: winerror.h:1401
#define RPC_S_UNKNOWN_AUTHZ_SERVICE
Definition: winerror.h:1415
#define RPC_S_NOT_RPC_ERROR
Definition: winerror.h:1487
#define RPC_S_PROCNUM_OUT_OF_RANGE
Definition: winerror.h:1410
#define RPC_X_SS_CHAR_TRANS_SHORT_FILE
Definition: winerror.h:1439
#define RPC_S_FP_OVERFLOW
Definition: winerror.h:1436
#define RPC_S_UNKNOWN_MGR_TYPE
Definition: winerror.h:1383
#define RPC_S_NO_PROTSEQS_REGISTERED
Definition: winerror.h:1381
#define ERROR_NOT_ENOUGH_SERVER_MEMORY
Definition: winerror.h:990
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
Definition: winnt_old.h:1138
__wchar_t WCHAR
Definition: xmlstorage.h:180
char * LPSTR
Definition: xmlstorage.h:182
unsigned char BYTE
Definition: xxhash.c:193