ReactOS 0.4.15-dev-7788-g1ad9096
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
98/***********************************************************************
99 * DllMain
100 *
101 * PARAMS
102 * hinstDLL [I] handle to the DLL's instance
103 * fdwReason [I]
104 * lpvReserved [I] reserved, must be NULL
105 *
106 * RETURNS
107 * Success: TRUE
108 * Failure: FALSE
109 */
110
112{
113 struct threaddata *tdata;
114
115 switch (fdwReason) {
117 break;
118
120 tdata = NtCurrentTeb()->ReservedForNtRpc;
121 if (tdata)
122 {
124 list_remove(&tdata->entry);
126
127 tdata->cs.DebugInfo->Spare[0] = 0;
128 DeleteCriticalSection(&tdata->cs);
129 if (tdata->connection)
130 ERR("tdata->connection should be NULL but is still set to %p\n", tdata->connection);
131 if (tdata->server_binding)
132 ERR("tdata->server_binding should be NULL but is still set to %p\n", tdata->server_binding);
133 HeapFree(GetProcessHeap(), 0, tdata);
134 }
135 break;
136
138 if (lpvReserved) break; /* do nothing if process is shutting down */
143 break;
144 }
145
146 return TRUE;
147}
148
149/*************************************************************************
150 * RpcStringFreeA [RPCRT4.@]
151 *
152 * Frees a character string allocated by the RPC run-time library.
153 *
154 * RETURNS
155 *
156 * S_OK if successful.
157 */
159{
161 if (String) *String = NULL;
162
163 return RPC_S_OK;
164}
165
166/*************************************************************************
167 * RpcStringFreeW [RPCRT4.@]
168 *
169 * Frees a character string allocated by the RPC run-time library.
170 *
171 * RETURNS
172 *
173 * S_OK if successful.
174 */
176{
178 if (String) *String = NULL;
179
180 return RPC_S_OK;
181}
182
183/*************************************************************************
184 * RpcRaiseException [RPCRT4.@]
185 *
186 * Raises an exception.
187 */
189{
190 /* shouldn't return */
192 ERR("handler continued execution\n");
193 ExitProcess(1);
194}
195
196/*************************************************************************
197 * UuidCompare [RPCRT4.@]
198 *
199 * PARAMS
200 * UUID *Uuid1 [I] Uuid to compare
201 * UUID *Uuid2 [I] Uuid to compare
202 * RPC_STATUS *Status [O] returns RPC_S_OK
203 *
204 * RETURNS
205 * -1 if Uuid1 is less than Uuid2
206 * 0 if Uuid1 and Uuid2 are equal
207 * 1 if Uuid1 is greater than Uuid2
208 */
210{
211 int i;
212
213 TRACE("(%s,%s)\n", debugstr_guid(Uuid1), debugstr_guid(Uuid2));
214
215 *Status = RPC_S_OK;
216
217 if (!Uuid1) Uuid1 = &uuid_nil;
218 if (!Uuid2) Uuid2 = &uuid_nil;
219
220 if (Uuid1 == Uuid2) return 0;
221
222 if (Uuid1->Data1 != Uuid2->Data1)
223 return Uuid1->Data1 < Uuid2->Data1 ? -1 : 1;
224
225 if (Uuid1->Data2 != Uuid2->Data2)
226 return Uuid1->Data2 < Uuid2->Data2 ? -1 : 1;
227
228 if (Uuid1->Data3 != Uuid2->Data3)
229 return Uuid1->Data3 < Uuid2->Data3 ? -1 : 1;
230
231 for (i = 0; i < 8; i++) {
232 if (Uuid1->Data4[i] < Uuid2->Data4[i])
233 return -1;
234 if (Uuid1->Data4[i] > Uuid2->Data4[i])
235 return 1;
236 }
237
238 return 0;
239}
240
241/*************************************************************************
242 * UuidEqual [RPCRT4.@]
243 *
244 * PARAMS
245 * UUID *Uuid1 [I] Uuid to compare
246 * UUID *Uuid2 [I] Uuid to compare
247 * RPC_STATUS *Status [O] returns RPC_S_OK
248 *
249 * RETURNS
250 * TRUE/FALSE
251 */
253{
254 TRACE("(%s,%s)\n", debugstr_guid(Uuid1), debugstr_guid(Uuid2));
255 return !UuidCompare(Uuid1, Uuid2, Status);
256}
257
258/*************************************************************************
259 * UuidIsNil [RPCRT4.@]
260 *
261 * PARAMS
262 * UUID *Uuid [I] Uuid to compare
263 * RPC_STATUS *Status [O] returns RPC_S_OK
264 *
265 * RETURNS
266 * TRUE/FALSE
267 */
269{
270 TRACE("(%s)\n", debugstr_guid(Uuid));
271 if (!Uuid) return TRUE;
272 return !UuidCompare(Uuid, &uuid_nil, Status);
273}
274
275 /*************************************************************************
276 * UuidCreateNil [RPCRT4.@]
277 *
278 * PARAMS
279 * UUID *Uuid [O] returns a nil UUID
280 *
281 * RETURNS
282 * RPC_S_OK
283 */
285{
286 *Uuid = uuid_nil;
287 return RPC_S_OK;
288}
289
290/*************************************************************************
291 * UuidCreate [RPCRT4.@]
292 *
293 * Creates a 128bit UUID.
294 *
295 * RETURNS
296 *
297 * RPC_S_OK if successful.
298 * RPC_S_UUID_LOCAL_ONLY if UUID is only locally unique.
299 *
300 * NOTES
301 *
302 * Follows RFC 4122, section 4.4 (Algorithms for Creating a UUID from
303 * Truly Random or Pseudo-Random Numbers)
304 */
306{
307 RtlGenRandom(Uuid, sizeof(*Uuid));
308 /* Clear the version bits and set the version (4) */
309 Uuid->Data3 &= 0x0fff;
310 Uuid->Data3 |= (4 << 12);
311 /* Set the topmost bits of Data4 (clock_seq_hi_and_reserved) as
312 * specified in RFC 4122, section 4.4.
313 */
314 Uuid->Data4[0] &= 0x3f;
315 Uuid->Data4[0] |= 0x80;
316
317 TRACE("%s\n", debugstr_guid(Uuid));
318
319 return RPC_S_OK;
320}
321
322/* Number of 100ns ticks per clock tick. To be safe, assume that the clock
323 resolution is at least 1000 * 100 * (1/1000000) = 1/10 of a second */
324#define TICKS_PER_CLOCK_TICK 1000
325#define SECSPERDAY 86400
326#define TICKSPERSEC 10000000
327/* UUID system time starts at October 15, 1582 */
328#define SECS_15_OCT_1582_TO_1601 ((17 + 30 + 31 + 365 * 18 + 5) * SECSPERDAY)
329#define TICKS_15_OCT_1582_TO_1601 ((ULONGLONG)SECS_15_OCT_1582_TO_1601 * TICKSPERSEC)
330
332{
333 FILETIME ft;
334
336
337 *time = ((ULONGLONG)ft.dwHighDateTime << 32) | ft.dwLowDateTime;
339}
340
341/* Assume that a hardware address is at least 6 bytes long */
342#define ADDRESS_BYTES_NEEDED 6
343
345{
346 int i;
348
349 ULONG buflen = sizeof(IP_ADAPTER_INFO);
351
354 adapter = HeapAlloc(GetProcessHeap(), 0, buflen);
355 }
356
357 if (GetAdaptersInfo(adapter, &buflen) == NO_ERROR) {
358 for (i = 0; i < ADDRESS_BYTES_NEEDED; i++) {
359 address[i] = adapter->Address[i];
360 }
361 }
362 /* We can't get a hardware address, just use random numbers.
363 Set the multicast bit to prevent conflicts with real cards. */
364 else {
366 address[0] |= 0x01;
368 }
369
371 return status;
372}
373
374/*************************************************************************
375 * UuidCreateSequential [RPCRT4.@]
376 *
377 * Creates a 128bit UUID.
378 *
379 * RETURNS
380 *
381 * RPC_S_OK if successful.
382 * RPC_S_UUID_LOCAL_ONLY if UUID is only locally unique.
383 *
384 * FIXME: No compensation for changes across reloading
385 * this dll or across reboots (e.g. clock going
386 * backwards and swapped network cards). The RFC
387 * suggests using NVRAM for storing persistent
388 * values.
389 */
391{
392 static BOOL initialised;
393 static int count;
394
396 static ULONGLONG timelast;
397 static WORD sequence;
398
399 static DWORD status;
401
403
404 if (!initialised) {
405 RPC_UuidGetSystemTime(&timelast);
407
408 sequence = ((rand() & 0xff) << 8) + (rand() & 0xff);
409 sequence &= 0x1fff;
410
412 initialised = TRUE;
413 }
414
415 /* Generate time element of the UUID. Account for going faster
416 than our clock as well as the clock going backwards. */
417 while (1) {
419 if (time > timelast) {
420 count = 0;
421 break;
422 }
423 if (time < timelast) {
424 sequence = (sequence + 1) & 0x1fff;
425 count = 0;
426 break;
427 }
429 count++;
430 break;
431 }
432 }
433
434 timelast = time;
435 time += count;
436
437 /* Pack the information into the UUID structure. */
438
439 Uuid->Data1 = (ULONG)(time & 0xffffffff);
440 Uuid->Data2 = (unsigned short)((time >> 32) & 0xffff);
441 Uuid->Data3 = (unsigned short)((time >> 48) & 0x0fff);
442
443 /* This is a version 1 UUID */
444 Uuid->Data3 |= (1 << 12);
445
446 Uuid->Data4[0] = sequence & 0xff;
447 Uuid->Data4[1] = (sequence & 0x3f00) >> 8;
448 Uuid->Data4[1] |= 0x80;
449 memcpy(&Uuid->Data4[2], address, ADDRESS_BYTES_NEEDED);
450
452
453 TRACE("%s\n", debugstr_guid(Uuid));
454
455 return status;
456}
457
458/*************************************************************************
459 * I_UuidCreate [RPCRT4.@]
460 *
461 * See UuidCreateSequential()
462 */
464{
465 return UuidCreateSequential(Uuid);
466}
467
468/*************************************************************************
469 * UuidHash [RPCRT4.@]
470 *
471 * Generates a hash value for a given UUID
472 *
473 * Code based on FreeDCE implementation
474 *
475 */
477{
478 BYTE *data = (BYTE*)uuid;
479 short c0 = 0, c1 = 0, x, y;
480 unsigned int i;
481
482 if (!uuid) data = (BYTE*)(uuid = &uuid_nil);
483
484 TRACE("(%s)\n", debugstr_guid(uuid));
485
486 for (i=0; i<sizeof(UUID); i++) {
487 c0 += data[i];
488 c1 += c0;
489 }
490
491 x = -c1 % 255;
492 if (x < 0) x += 255;
493
494 y = (c1 - c0) % 255;
495 if (y < 0) y += 255;
496
497 *Status = RPC_S_OK;
498 return y*256 + x;
499}
500
501/*************************************************************************
502 * UuidToStringA [RPCRT4.@]
503 *
504 * Converts a UUID to a string.
505 *
506 * UUID format is 8 hex digits, followed by a hyphen then three groups of
507 * 4 hex digits each followed by a hyphen and then 12 hex digits
508 *
509 * RETURNS
510 *
511 * S_OK if successful.
512 * S_OUT_OF_MEMORY if unsuccessful.
513 */
515{
516 *StringUuid = HeapAlloc( GetProcessHeap(), 0, sizeof(char) * 37);
517
518 if(!(*StringUuid))
519 return RPC_S_OUT_OF_MEMORY;
520
521 if (!Uuid) Uuid = &uuid_nil;
522
523 sprintf( (char*)*StringUuid, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
524 Uuid->Data1, Uuid->Data2, Uuid->Data3,
525 Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2],
526 Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5],
527 Uuid->Data4[6], Uuid->Data4[7] );
528
529 return RPC_S_OK;
530}
531
532/*************************************************************************
533 * UuidToStringW [RPCRT4.@]
534 *
535 * Converts a UUID to a string.
536 *
537 * S_OK if successful.
538 * S_OUT_OF_MEMORY if unsuccessful.
539 */
541{
542 char buf[37];
543
544 if (!Uuid) Uuid = &uuid_nil;
545
546 sprintf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
547 Uuid->Data1, Uuid->Data2, Uuid->Data3,
548 Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2],
549 Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5],
550 Uuid->Data4[6], Uuid->Data4[7] );
551
552 *StringUuid = RPCRT4_strdupAtoW(buf);
553
554 if(!(*StringUuid))
555 return RPC_S_OUT_OF_MEMORY;
556
557 return RPC_S_OK;
558}
559
560static const BYTE hex2bin[] =
561{
562 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x00 */
563 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x10 */
564 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x20 */
565 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, /* 0x30 */
566 0,10,11,12,13,14,15,0,0,0,0,0,0,0,0,0, /* 0x40 */
567 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x50 */
568 0,10,11,12,13,14,15 /* 0x60 */
569};
570
571/***********************************************************************
572 * UuidFromStringA (RPCRT4.@)
573 */
575{
576 int i;
577
578 if (!s) return UuidCreateNil( uuid );
579
580 if (strlen((char*)s) != 36) return RPC_S_INVALID_STRING_UUID;
581
582 if ((s[8]!='-') || (s[13]!='-') || (s[18]!='-') || (s[23]!='-'))
584
585 for (i=0; i<36; i++)
586 {
587 if ((i == 8)||(i == 13)||(i == 18)||(i == 23)) continue;
588 if (s[i] > 'f' || (!hex2bin[s[i]] && s[i] != '0')) return RPC_S_INVALID_STRING_UUID;
589 }
590
591 /* in form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */
592
593 uuid->Data1 = (hex2bin[s[0]] << 28 | hex2bin[s[1]] << 24 | hex2bin[s[2]] << 20 | hex2bin[s[3]] << 16 |
594 hex2bin[s[4]] << 12 | hex2bin[s[5]] << 8 | hex2bin[s[6]] << 4 | hex2bin[s[7]]);
595 uuid->Data2 = hex2bin[s[9]] << 12 | hex2bin[s[10]] << 8 | hex2bin[s[11]] << 4 | hex2bin[s[12]];
596 uuid->Data3 = hex2bin[s[14]] << 12 | hex2bin[s[15]] << 8 | hex2bin[s[16]] << 4 | hex2bin[s[17]];
597
598 /* these are just sequential bytes */
599 uuid->Data4[0] = hex2bin[s[19]] << 4 | hex2bin[s[20]];
600 uuid->Data4[1] = hex2bin[s[21]] << 4 | hex2bin[s[22]];
601 uuid->Data4[2] = hex2bin[s[24]] << 4 | hex2bin[s[25]];
602 uuid->Data4[3] = hex2bin[s[26]] << 4 | hex2bin[s[27]];
603 uuid->Data4[4] = hex2bin[s[28]] << 4 | hex2bin[s[29]];
604 uuid->Data4[5] = hex2bin[s[30]] << 4 | hex2bin[s[31]];
605 uuid->Data4[6] = hex2bin[s[32]] << 4 | hex2bin[s[33]];
606 uuid->Data4[7] = hex2bin[s[34]] << 4 | hex2bin[s[35]];
607 return RPC_S_OK;
608}
609
610
611/***********************************************************************
612 * UuidFromStringW (RPCRT4.@)
613 */
615{
616 int i;
617
618 if (!s) return UuidCreateNil( uuid );
619
620 if (lstrlenW(s) != 36) return RPC_S_INVALID_STRING_UUID;
621
622 if ((s[8]!='-') || (s[13]!='-') || (s[18]!='-') || (s[23]!='-'))
624
625 for (i=0; i<36; i++)
626 {
627 if ((i == 8)||(i == 13)||(i == 18)||(i == 23)) continue;
628 if (s[i] > 'f' || (!hex2bin[s[i]] && s[i] != '0')) return RPC_S_INVALID_STRING_UUID;
629 }
630
631 /* in form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */
632
633 uuid->Data1 = (hex2bin[s[0]] << 28 | hex2bin[s[1]] << 24 | hex2bin[s[2]] << 20 | hex2bin[s[3]] << 16 |
634 hex2bin[s[4]] << 12 | hex2bin[s[5]] << 8 | hex2bin[s[6]] << 4 | hex2bin[s[7]]);
635 uuid->Data2 = hex2bin[s[9]] << 12 | hex2bin[s[10]] << 8 | hex2bin[s[11]] << 4 | hex2bin[s[12]];
636 uuid->Data3 = hex2bin[s[14]] << 12 | hex2bin[s[15]] << 8 | hex2bin[s[16]] << 4 | hex2bin[s[17]];
637
638 /* these are just sequential bytes */
639 uuid->Data4[0] = hex2bin[s[19]] << 4 | hex2bin[s[20]];
640 uuid->Data4[1] = hex2bin[s[21]] << 4 | hex2bin[s[22]];
641 uuid->Data4[2] = hex2bin[s[24]] << 4 | hex2bin[s[25]];
642 uuid->Data4[3] = hex2bin[s[26]] << 4 | hex2bin[s[27]];
643 uuid->Data4[4] = hex2bin[s[28]] << 4 | hex2bin[s[29]];
644 uuid->Data4[5] = hex2bin[s[30]] << 4 | hex2bin[s[31]];
645 uuid->Data4[6] = hex2bin[s[32]] << 4 | hex2bin[s[33]];
646 uuid->Data4[7] = hex2bin[s[34]] << 4 | hex2bin[s[35]];
647 return RPC_S_OK;
648}
649
650/***********************************************************************
651 * DllRegisterServer (RPCRT4.@)
652 */
653
655{
656 FIXME( "(): stub\n" );
657 return S_OK;
658}
659
660#define MAX_RPC_ERROR_TEXT 256
661
662/******************************************************************************
663 * DceErrorInqTextW (rpcrt4.@)
664 *
665 * Notes
666 * 1. On passing a NULL pointer the code does bomb out.
667 * 2. The size of the required buffer is not defined in the documentation.
668 * It appears to be 256.
669 * 3. The function is defined to return RPC_S_INVALID_ARG but I don't know
670 * of any value for which it does.
671 * 4. The MSDN documentation currently declares that the second argument is
672 * unsigned char *, even for the W version. I don't believe it.
673 */
675{
676 DWORD count;
680 if (!count)
681 {
685 if (!count)
686 {
687 ERR ("Failed to translate error\n");
688 return RPC_S_INVALID_ARG;
689 }
690 }
691 return RPC_S_OK;
692}
693
694/******************************************************************************
695 * DceErrorInqTextA (rpcrt4.@)
696 */
698{
700 WCHAR bufferW [MAX_RPC_ERROR_TEXT];
701 if ((status = DceErrorInqTextW (e, bufferW)) == RPC_S_OK)
702 {
704 NULL, NULL))
705 {
706 ERR ("Failed to translate error\n");
708 }
709 }
710 return status;
711}
712
713/******************************************************************************
714 * I_RpcAllocate (rpcrt4.@)
715 */
716void * WINAPI I_RpcAllocate(unsigned int Size)
717{
718 return HeapAlloc(GetProcessHeap(), 0, Size);
719}
720
721/******************************************************************************
722 * I_RpcFree (rpcrt4.@)
723 */
725{
727}
728
729/******************************************************************************
730 * I_RpcMapWin32Status (rpcrt4.@)
731 *
732 * Maps Win32 RPC error codes to NT statuses.
733 *
734 * PARAMS
735 * status [I] Win32 RPC error code.
736 *
737 * RETURNS
738 * Appropriate translation into an NT status code.
739 */
741{
742 TRACE("(%d)\n", status);
743 switch (status)
744 {
851 default: return status;
852 }
853}
854
855/******************************************************************************
856 * RpcExceptionFilter (rpcrt4.@)
857 * I_RpcExceptionFilter (rpcrt4.@)
858 */
860{
861 TRACE("0x%x\n", ExceptionCode);
862 switch (ExceptionCode)
863 {
873 default:
875 }
876}
877
878/******************************************************************************
879 * RpcErrorStartEnumeration (rpcrt4.@)
880 */
882{
883 FIXME("(%p): stub\n", EnumHandle);
885}
886
887/******************************************************************************
888 * RpcErrorEndEnumeration (rpcrt4.@)
889 */
891{
892 FIXME("(%p): stub\n", EnumHandle);
893 return RPC_S_OK;
894}
895
896/******************************************************************************
897 * RpcErrorSaveErrorInfo (rpcrt4.@)
898 */
900{
901 FIXME("(%p %p %p): stub\n", EnumHandle, ErrorBlob, BlobSize);
903}
904
905/******************************************************************************
906 * RpcErrorLoadErrorInfo (rpcrt4.@)
907 */
909{
910 FIXME("(%p %lu %p): stub\n", ErrorBlob, BlobSize, EnumHandle);
912}
913
914/******************************************************************************
915 * RpcErrorGetNextRecord (rpcrt4.@)
916 */
918{
919 FIXME("(%p %x %p): stub\n", EnumHandle, CopyStrings, ErrorInfo);
921}
922
923/******************************************************************************
924 * RpcMgmtSetCancelTimeout (rpcrt4.@)
925 */
927{
928 FIXME("(%d): stub\n", Timeout);
929 return RPC_S_OK;
930}
931
933{
934 struct threaddata *tdata = NtCurrentTeb()->ReservedForNtRpc;
935 if (!tdata)
936 {
937 tdata = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*tdata));
938 if (!tdata) return NULL;
939
941 tdata->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": threaddata.cs");
942 tdata->thread_id = GetCurrentThreadId();
943
947
948 NtCurrentTeb()->ReservedForNtRpc = tdata;
949 return tdata;
950 }
951 return tdata;
952}
953
955{
956 struct threaddata *tdata = get_or_create_threaddata();
957 if (!tdata) return;
958
959 EnterCriticalSection(&tdata->cs);
960 tdata->connection = Connection;
961 LeaveCriticalSection(&tdata->cs);
962}
963
965{
966 struct threaddata *tdata = get_or_create_threaddata();
967 if (!tdata) return;
968
969 tdata->server_binding = Binding;
970}
971
973{
974 struct threaddata *tdata = get_or_create_threaddata();
975 if (!tdata) return NULL;
976
977 return tdata->server_binding;
978}
979
981{
982 struct threaddata *tdata = get_or_create_threaddata();
984
985 if (!tdata) return;
986
988 if (!context_handle_list) return;
989
993}
994
996{
997 struct threaddata *tdata = get_or_create_threaddata();
998 struct context_handle_list *current, *prev;
999
1000 if (!tdata) return;
1001
1002 for (current = tdata->context_handle_list, prev = NULL; current; prev = current, current = current->next)
1003 {
1004 if (current->context_handle == SContext)
1005 {
1006 if (prev)
1007 prev->next = current->next;
1008 else
1009 tdata->context_handle_list = current->next;
1011 return;
1012 }
1013 }
1014}
1015
1017{
1018 struct threaddata *tdata = get_or_create_threaddata();
1021
1022 if (!tdata) return NULL;
1023
1025 if (!context_handle_list) return NULL;
1027
1030 return context_handle;
1031}
1032
1034{
1035 struct threaddata *tdata;
1036
1039 if (tdata->thread_id == target_tid)
1040 {
1041 EnterCriticalSection(&tdata->cs);
1042 if (tdata->connection) rpcrt4_conn_cancel_call(tdata->connection);
1043 LeaveCriticalSection(&tdata->cs);
1044 break;
1045 }
1047
1048 return RPC_S_OK;
1049}
1050
1051/******************************************************************************
1052 * RpcCancelThread (rpcrt4.@)
1053 */
1055{
1056 TRACE("(%p)\n", ThreadHandle);
1057 return RpcCancelThreadEx(ThreadHandle, 0);
1058}
1059
1060/******************************************************************************
1061 * RpcCancelThreadEx (rpcrt4.@)
1062 */
1064{
1065 DWORD target_tid;
1066
1067 FIXME("(%p, %d)\n", ThreadHandle, Timeout);
1068
1069 target_tid = GetThreadId(ThreadHandle);
1070 if (!target_tid)
1071 return RPC_S_INVALID_ARG;
1072
1073 if (Timeout)
1074 {
1075 FIXME("(%p, %d)\n", ThreadHandle, Timeout);
1076 return RPC_S_OK;
1077 }
1078 else
1079 return rpc_cancel_thread(target_tid);
1080}
static struct recvd_message * sequence
Definition: SystemMenu.c:63
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#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: debug.h:111
#define ERR(fmt,...)
Definition: debug.h:110
_Inout_ PIRP _In_ NTSTATUS ExceptionCode
Definition: cdprocs.h:1774
Definition: list.h:37
#define NO_ERROR
Definition: dderror.h:5
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define GetProcessHeap()
Definition: compat.h:736
#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 HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define WideCharToMultiByte
Definition: compat.h:111
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#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:1487
DWORD WINAPI GetThreadId(IN HANDLE Thread)
Definition: thread.c:913
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
Definition: time.c:128
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 int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
return adapter
Status
Definition: gdiplustypes.h:25
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLdouble s
Definition: gl.h:2039
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
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:85
#define EXCEPTION_CONTINUE_SEARCH
Definition: excpt.h:86
_Check_return_ int __cdecl rand(void)
Definition: rand.c:10
Definition: msctf.idl:550
#define S_OK
Definition: intsafe.h:52
DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
#define NtCurrentTeb
struct _IP_ADAPTER_INFO IP_ADAPTER_INFO
#define MAX_ADAPTER_ADDRESS_LENGTH
Definition: iptypes.h:28
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(buf, format,...)
Definition: sprintf.c:55
#define DECLSPEC_NORETURN
Definition: ntbasedef.h:176
#define RtlGenRandom
Definition: ntsecapi.h:691
#define RPC_NT_INVALID_NAF_ID
Definition: ntstatus.h:1239
#define EPT_NT_INVALID_ENTRY
Definition: ntstatus.h:1227
#define RPC_NT_SERVER_UNAVAILABLE
Definition: ntstatus.h:1201
#define RPC_NT_UNSUPPORTED_TYPE
Definition: ntstatus.h:1209
#define STATUS_WRONG_PASSWORD
Definition: ntstatus.h:342
#define RPC_NT_INTERFACE_NOT_FOUND
Definition: ntstatus.h:1235
#define STATUS_ILLEGAL_INSTRUCTION
Definition: ntstatus.h:266
#define RPC_NT_INVALID_NETWORK_OPTIONS
Definition: ntstatus.h:1203
#define RPC_NT_INVALID_RPC_PROTSEQ
Definition: ntstatus.h:1183
#define RPC_NT_BAD_STUB_DATA
Definition: ntstatus.h:1276
#define STATUS_INVALID_LOGON_HOURS
Definition: ntstatus.h:347
#define RPC_NT_INTERNAL_ERROR
Definition: ntstatus.h:1242
#define RPC_NT_UNKNOWN_AUTHN_LEVEL
Definition: ntstatus.h:1224
#define RPC_NT_SS_IN_NULL_CONTEXT
Definition: ntstatus.h:1268
#define RPC_NT_ENUM_VALUE_OUT_OF_RANGE
Definition: ntstatus.h:1274
#define RPC_NT_PIPE_CLOSED
Definition: ntstatus.h:1283
#define STATUS_POSSIBLE_DEADLOCK
Definition: ntstatus.h:637
#define RPC_NT_ENTRY_ALREADY_EXISTS
Definition: ntstatus.h:1236
#define RPC_NT_DUPLICATE_ENDPOINT
Definition: ntstatus.h:1216
#define RPC_NT_CALL_IN_PROGRESS
Definition: ntstatus.h:1248
#define RPC_NT_NO_CALL_ACTIVE
Definition: ntstatus.h:1204
#define RPC_NT_NO_ENDPOINT_FOUND
Definition: ntstatus.h:1187
#define RPC_NT_STRING_TOO_LONG
Definition: ntstatus.h:1219
#define STATUS_INSTRUCTION_MISALIGNMENT
Definition: ntstatus.h:406
#define RPC_NT_PROCNUM_OUT_OF_RANGE
Definition: ntstatus.h:1221
#define STATUS_ACCOUNT_DISABLED
Definition: ntstatus.h:350
#define RPC_NT_PIPE_EMPTY
Definition: ntstatus.h:1285
#define RPC_NT_NO_MORE_ENTRIES
Definition: ntstatus.h:1265
#define STATUS_PASSWORD_MUST_CHANGE
Definition: ntstatus.h:680
#define RPC_NT_BYTE_COUNT_TOO_SMALL
Definition: ntstatus.h:1275
#define RPC_NT_SS_CONTEXT_MISMATCH
Definition: ntstatus.h:1269
#define RPC_NT_WRONG_KIND_OF_BINDING
Definition: ntstatus.h:1180
#define RPC_NT_ALREADY_REGISTERED
Definition: ntstatus.h:1190
#define EPT_NT_NOT_REGISTERED
Definition: ntstatus.h:1229
#define RPC_NT_INVALID_ASYNC_HANDLE
Definition: ntstatus.h:1262
#define RPC_NT_INVALID_NAME_SYNTAX
Definition: ntstatus.h:1213
#define RPC_NT_NOTHING_TO_EXPORT
Definition: ntstatus.h:1230
#define STATUS_STACK_OVERFLOW
Definition: ntstatus.h:489
#define RPC_NT_UNKNOWN_IF
Definition: ntstatus.h:1196
#define RPC_NT_PROTOCOL_ERROR
Definition: ntstatus.h:1207
#define RPC_NT_ENTRY_NOT_FOUND
Definition: ntstatus.h:1237
#define RPC_NT_NO_PROTSEQS_REGISTERED
Definition: ntstatus.h:1193
#define RPC_NT_NULL_REF_POINTER
Definition: ntstatus.h:1273
#define RPC_NT_GROUP_MEMBER_NOT_FOUND
Definition: ntstatus.h:1250
#define RPC_NT_SS_CHAR_TRANS_OPEN_FAIL
Definition: ntstatus.h:1266
#define RPC_NT_UNSUPPORTED_TRANS_SYN
Definition: ntstatus.h:1208
#define RPC_NT_INVALID_STRING_UUID
Definition: ntstatus.h:1184
#define RPC_NT_NOT_LISTENING
Definition: ntstatus.h:1194
#define RPC_NT_OBJECT_NOT_FOUND
Definition: ntstatus.h:1189
#define STATUS_INSUFF_SERVER_RESOURCES
Definition: ntstatus.h:649
#define RPC_NT_INVALID_AUTH_IDENTITY
Definition: ntstatus.h:1225
#define RPC_NT_INVALID_ASYNC_CALL
Definition: ntstatus.h:1263
#define RPC_NT_SS_CHAR_TRANS_SHORT_FILE
Definition: ntstatus.h:1267
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define RPC_NT_PROTSEQ_NOT_FOUND
Definition: ntstatus.h:1220
#define RPC_NT_SS_CANNOT_GET_CALL_HANDLE
Definition: ntstatus.h:1272
#define RPC_NT_NO_ENTRY_NAME
Definition: ntstatus.h:1212
#define RPC_NT_CALL_CANCELLED
Definition: ntstatus.h:1254
#define RPC_NT_TYPE_ALREADY_REGISTERED
Definition: ntstatus.h:1191
#define RPC_NT_UUID_NO_ADDRESS
Definition: ntstatus.h:1215
#define RPC_NT_OUT_OF_RESOURCES
Definition: ntstatus.h:1200
#define STATUS_INVALID_SECURITY_DESCR
Definition: ntstatus.h:357
#define STATUS_PRIVILEGED_INSTRUCTION
Definition: ntstatus.h:386
#define STATUS_BREAKPOINT
Definition: ntstatus.h:184
#define RPC_NT_NO_CONTEXT_AVAILABLE
Definition: ntstatus.h:1241
#define RPC_NT_PIPE_DISCIPLINE_ERROR
Definition: ntstatus.h:1284
#define RPC_NT_MAX_CALLS_TOO_SMALL
Definition: ntstatus.h:1218
#define RPC_NT_INVALID_STRING_BINDING
Definition: ntstatus.h:1179
#define RPC_NT_NO_PROTSEQS
Definition: ntstatus.h:1198
#define RPC_NT_SS_HANDLES_MISMATCH
Definition: ntstatus.h:1271
#define STATUS_PASSWORD_EXPIRED
Definition: ntstatus.h:349
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
#define RPC_NT_NO_BINDINGS
Definition: ntstatus.h:1197
#define RPC_NT_FP_DIV_ZERO
Definition: ntstatus.h:1245
#define RPC_NT_FP_UNDERFLOW
Definition: ntstatus.h:1246
#define RPC_NT_INCOMPLETE_NAME
Definition: ntstatus.h:1231
#define RPC_NT_SS_CONTEXT_DAMAGED
Definition: ntstatus.h:1270
#define RPC_NT_SERVER_TOO_BUSY
Definition: ntstatus.h:1202
#define RPC_NT_FP_OVERFLOW
Definition: ntstatus.h:1247
#define RPC_NT_UNKNOWN_AUTHN_SERVICE
Definition: ntstatus.h:1223
#define RPC_NT_INVALID_TIMEOUT
Definition: ntstatus.h:1188
#define RPC_NT_CANNOT_SUPPORT
Definition: ntstatus.h:1240
#define RPC_NT_PROTSEQ_NOT_SUPPORTED
Definition: ntstatus.h:1182
#define RPC_NT_INVALID_NET_ADDR
Definition: ntstatus.h:1186
#define STATUS_DATATYPE_MISALIGNMENT
Definition: ntstatus.h:183
#define RPC_NT_INVALID_BOUND
Definition: ntstatus.h:1211
#define RPC_NT_NO_MORE_BINDINGS
Definition: ntstatus.h:1249
#define RPC_NT_INVALID_OBJECT
Definition: ntstatus.h:1252
#define RPC_NT_ZERO_DIVIDE
Definition: ntstatus.h:1243
#define RPC_NT_UNKNOWN_AUTHZ_SERVICE
Definition: ntstatus.h:1226
#define RPC_NT_BINDING_HAS_NO_AUTH
Definition: ntstatus.h:1222
#define RPC_NT_INVALID_BINDING
Definition: ntstatus.h:1181
#define RPC_NT_UNSUPPORTED_NAME_SYNTAX
Definition: ntstatus.h:1214
#define RPC_NT_UNKNOWN_MGR_TYPE
Definition: ntstatus.h:1195
#define RPC_NT_CANT_CREATE_ENDPOINT
Definition: ntstatus.h:1199
#define STATUS_ACCOUNT_LOCKED_OUT
Definition: ntstatus.h:696
#define RPC_NT_NAME_SERVICE_UNAVAILABLE
Definition: ntstatus.h:1238
#define EPT_NT_CANT_PERFORM_OP
Definition: ntstatus.h:1228
#define RPC_NT_NOT_ALL_OBJS_UNEXPORTED
Definition: ntstatus.h:1234
#define RPC_NT_NO_MORE_MEMBERS
Definition: ntstatus.h:1233
#define RPC_NT_INVALID_ENDPOINT_FORMAT
Definition: ntstatus.h:1185
#define RPC_NT_ALREADY_LISTENING
Definition: ntstatus.h:1192
#define RPC_NT_UNKNOWN_AUTHN_TYPE
Definition: ntstatus.h:1217
#define EPT_NT_CANT_CREATE
Definition: ntstatus.h:1251
#define RPC_NT_ADDRESS_ERROR
Definition: ntstatus.h:1244
#define RPC_NT_CALL_FAILED
Definition: ntstatus.h:1205
#define RPC_NT_CALL_FAILED_DNE
Definition: ntstatus.h:1206
#define RPC_NT_INVALID_TAG
Definition: ntstatus.h:1210
#define RPC_NT_INVALID_VERS_OPTION
Definition: ntstatus.h:1232
long LONG
Definition: pedump.c:60
static ULONG Timeout
Definition: ping.c:61
LPWSTR RPCRT4_strdupAtoW(LPCSTR src)
Definition: rpc_binding.c:69
static void rpcrt4_conn_cancel_call(RpcConnection *Connection)
Definition: rpc_binding.h:210
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:740
RPC_STATUS RPC_ENTRY RpcErrorLoadErrorInfo(void *ErrorBlob, SIZE_T BlobSize, RPC_ERROR_ENUM_HANDLE *EnumHandle)
Definition: rpcrt4_main.c:908
static const BYTE hex2bin[]
Definition: rpcrt4_main.c:560
#define TICKS_15_OCT_1582_TO_1601
Definition: rpcrt4_main.c:329
HRESULT WINAPI DllRegisterServer(void)
Definition: rpcrt4_main.c:654
int WINAPI RpcExceptionFilter(ULONG ExceptionCode)
Definition: rpcrt4_main.c:859
static CRITICAL_SECTION uuid_cs
Definition: rpcrt4_main.c:62
RPC_STATUS WINAPI UuidCreateSequential(UUID *Uuid)
Definition: rpcrt4_main.c:390
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
Definition: rpcrt4_main.c:111
RPC_STATUS WINAPI UuidCreateNil(UUID *Uuid)
Definition: rpcrt4_main.c:284
RPC_STATUS WINAPI UuidToStringA(UUID *Uuid, RPC_CSTR *StringUuid)
Definition: rpcrt4_main.c:514
RPC_STATUS RPC_ENTRY RpcErrorEndEnumeration(RPC_ERROR_ENUM_HANDLE *EnumHandle)
Definition: rpcrt4_main.c:890
static CRITICAL_SECTION_DEBUG critsect_debug
Definition: rpcrt4_main.c:63
static RPC_STATUS RPC_UuidGetNodeAddress(BYTE *address)
Definition: rpcrt4_main.c:344
void RPCRT4_RemoveThreadContextHandle(NDR_SCONTEXT SContext)
Definition: rpcrt4_main.c:995
RPC_STATUS WINAPI UuidToStringW(UUID *Uuid, RPC_WSTR *StringUuid)
Definition: rpcrt4_main.c:540
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:899
int WINAPI UuidIsNil(UUID *Uuid, RPC_STATUS *Status)
Definition: rpcrt4_main.c:268
RPC_STATUS RPC_ENTRY DceErrorInqTextA(RPC_STATUS e, RPC_CSTR buffer)
Definition: rpcrt4_main.c:697
RPC_STATUS WINAPI I_UuidCreate(UUID *Uuid)
Definition: rpcrt4_main.c:463
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:175
RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR *String)
Definition: rpcrt4_main.c:158
static struct list threaddata_list
Definition: rpcrt4_main.c:80
NDR_SCONTEXT RPCRT4_PopThreadContextHandle(void)
Definition: rpcrt4_main.c:1016
RPC_STATUS RPC_ENTRY RpcErrorGetNextRecord(RPC_ERROR_ENUM_HANDLE *EnumHandle, BOOL CopyStrings, RPC_EXTENDED_ERROR_INFO *ErrorInfo)
Definition: rpcrt4_main.c:917
static void RPC_UuidGetSystemTime(ULONGLONG *time)
Definition: rpcrt4_main.c:331
RPC_STATUS RPC_ENTRY DceErrorInqTextW(RPC_STATUS e, RPC_WSTR buffer)
Definition: rpcrt4_main.c:674
RPC_STATUS RPC_ENTRY RpcCancelThreadEx(void *ThreadHandle, LONG Timeout)
Definition: rpcrt4_main.c:1063
RPC_STATUS WINAPI UuidFromStringW(RPC_WSTR s, UUID *uuid)
Definition: rpcrt4_main.c:614
void RPCRT4_PushThreadContextHandle(NDR_SCONTEXT SContext)
Definition: rpcrt4_main.c:980
int WINAPI UuidEqual(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status)
Definition: rpcrt4_main.c:252
void RPCRT4_SetThreadCurrentCallHandle(RpcBinding *Binding)
Definition: rpcrt4_main.c:964
void WINAPI I_RpcFree(void *Object)
Definition: rpcrt4_main.c:724
RPC_STATUS WINAPI UuidFromStringA(RPC_CSTR s, UUID *uuid)
Definition: rpcrt4_main.c:574
RpcBinding * RPCRT4_GetThreadCurrentCallHandle(void)
Definition: rpcrt4_main.c:972
RPC_STATUS RPC_ENTRY RpcErrorStartEnumeration(RPC_ERROR_ENUM_HANDLE *EnumHandle)
Definition: rpcrt4_main.c:881
RPC_STATUS RPC_ENTRY RpcMgmtSetCancelTimeout(LONG Timeout)
Definition: rpcrt4_main.c:926
RPC_STATUS RPC_ENTRY RpcCancelThread(void *ThreadHandle)
Definition: rpcrt4_main.c:1054
RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
Definition: rpcrt4_main.c:305
#define TICKS_PER_CLOCK_TICK
Definition: rpcrt4_main.c:324
void *WINAPI I_RpcAllocate(unsigned int Size)
Definition: rpcrt4_main.c:716
int WINAPI UuidCompare(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status)
Definition: rpcrt4_main.c:209
static UUID uuid_nil
Definition: rpcrt4_main.c:60
#define MAX_RPC_ERROR_TEXT
Definition: rpcrt4_main.c:660
unsigned short WINAPI UuidHash(UUID *uuid, RPC_STATUS *Status)
Definition: rpcrt4_main.c:476
static struct threaddata * get_or_create_threaddata(void)
Definition: rpcrt4_main.c:932
void RPCRT4_SetThreadCurrentConnection(RpcConnection *Connection)
Definition: rpcrt4_main.c:954
#define ADDRESS_BYTES_NEEDED
Definition: rpcrt4_main.c:342
static RPC_STATUS rpc_cancel_thread(DWORD target_tid)
Definition: rpcrt4_main.c:1033
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:188
static CRITICAL_SECTION threaddata_cs
Definition: rpcrt4_main.c:71
#define RPC_ENTRY
Definition: rpc.h:67
long RPC_STATUS
Definition: rpc.h:52
#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_PTR Spare[8/sizeof(DWORD_PTR)]
Definition: winbase.h:887
LIST_ENTRY ProcessLocksList
Definition: winbase.h:883
PCRITICAL_SECTION_DEBUG DebugInfo
Definition: winbase.h:894
DWORD dwHighDateTime
Definition: mapidefs.h:66
DWORD dwLowDateTime
Definition: mapidefs.h:65
NDR_SCONTEXT context_handle
Definition: rpcrt4_main.c:85
struct context_handle_list * next
Definition: rpcrt4_main.c:84
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
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
#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:4533
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:420
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:423
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:1034
#define EPT_S_INVALID_ENTRY
Definition: winerror.h:1059
#define RPC_S_PROTSEQ_NOT_SUPPORTED
Definition: winerror.h:1014
#define RPC_S_TYPE_ALREADY_REGISTERED
Definition: winerror.h:1023
#define RPC_S_NOTHING_TO_EXPORT
Definition: winerror.h:1062
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:185
#define RPC_S_NO_MORE_MEMBERS
Definition: winerror.h:1065
#define ERROR_INVALID_SECURITY_DESCR
Definition: winerror.h:820
#define RPC_S_CALL_IN_PROGRESS
Definition: winerror.h:1098
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1032
#define RPC_S_CALL_FAILED_DNE
Definition: winerror.h:1038
#define RPC_S_ADDRESS_ERROR
Definition: winerror.h:1076
#define RPC_S_INVALID_NAME_SYNTAX
Definition: winerror.h:1045
#define RPC_X_SS_HANDLES_MISMATCH
Definition: winerror.h:1085
#define ERROR_INVALID_LOGON_HOURS
Definition: winerror.h:810
#define EPT_S_NOT_REGISTERED
Definition: winerror.h:1061
#define RPC_S_UNSUPPORTED_TRANS_SYN
Definition: winerror.h:1040
#define RPC_S_INVALID_BOUND
Definition: winerror.h:1043
#define RPC_S_CALL_FAILED
Definition: winerror.h:1037
#define RPC_S_WRONG_KIND_OF_BINDING
Definition: winerror.h:1012
#define RPC_S_NO_CALL_ACTIVE
Definition: winerror.h:1036
#define RPC_S_INVALID_STRING_BINDING
Definition: winerror.h:1011
#define RPC_S_ENTRY_ALREADY_EXISTS
Definition: winerror.h:1068
#define RPC_S_INVALID_TAG
Definition: winerror.h:1042
#define RPC_S_INVALID_ASYNC_CALL
Definition: winerror.h:1157
#define EPT_S_CANT_PERFORM_OP
Definition: winerror.h:1060
#define RPC_S_NOT_ALL_OBJS_UNEXPORTED
Definition: winerror.h:1066
#define RPC_X_ENUM_VALUE_OUT_OF_RANGE
Definition: winerror.h:1088
#define RPC_S_ALREADY_LISTENING
Definition: winerror.h:1024
#define RPC_X_SS_IN_NULL_CONTEXT
Definition: winerror.h:1083
#define RPC_S_INVALID_AUTH_IDENTITY
Definition: winerror.h:1057
#define RPC_S_FP_DIV_ZERO
Definition: winerror.h:1077
#define RPC_X_PIPE_DISCIPLINE_ERROR
Definition: winerror.h:1159
#define RPC_S_NAME_SERVICE_UNAVAILABLE
Definition: winerror.h:1070
#define RPC_S_UNSUPPORTED_TYPE
Definition: winerror.h:1041
#define RPC_S_UNKNOWN_IF
Definition: winerror.h:1028
#define RPC_X_BAD_STUB_DATA
Definition: winerror.h:1090
#define RPC_S_BINDING_HAS_NO_AUTH
Definition: winerror.h:1054
#define RPC_S_NO_MORE_BINDINGS
Definition: winerror.h:1113
#define RPC_S_OBJECT_NOT_FOUND
Definition: winerror.h:1021
#define RPC_S_CANT_CREATE_ENDPOINT
Definition: winerror.h:1031
#define RPC_S_INVALID_STRING_UUID
Definition: winerror.h:1016
#define RPC_S_CANNOT_SUPPORT
Definition: winerror.h:1072
#define RPC_S_INVALID_ASYNC_HANDLE
Definition: winerror.h:1156
#define RPC_X_SS_CHAR_TRANS_OPEN_FAIL
Definition: winerror.h:1081
#define RPC_S_INVALID_NAF_ID
Definition: winerror.h:1071
#define RPC_S_FP_UNDERFLOW
Definition: winerror.h:1078
#define RPC_S_CALL_CANCELLED
Definition: winerror.h:1125
#define RPC_X_NO_MORE_ENTRIES
Definition: winerror.h:1080
#define RPC_S_PROTOCOL_ERROR
Definition: winerror.h:1039
#define RPC_S_NO_BINDINGS
Definition: winerror.h:1029
#define RPC_X_NULL_REF_POINTER
Definition: winerror.h:1087
#define RPC_S_INVALID_TIMEOUT
Definition: winerror.h:1020
#define RPC_X_PIPE_CLOSED
Definition: winerror.h:1158
#define RPC_S_ZERO_DIVIDE
Definition: winerror.h:1075
#define RPC_S_ENTRY_NOT_FOUND
Definition: winerror.h:1069
#define RPC_X_PIPE_EMPTY
Definition: winerror.h:1160
#define RPC_S_NO_CONTEXT_AVAILABLE
Definition: winerror.h:1073
#define RPC_S_UNKNOWN_AUTHN_TYPE
Definition: winerror.h:1049
#define RPC_S_NO_ENDPOINT_FOUND
Definition: winerror.h:1019
#define EPT_S_CANT_CREATE
Definition: winerror.h:1141
#define RPC_S_GROUP_MEMBER_NOT_FOUND
Definition: winerror.h:1140
#define ERROR_ACCOUNT_LOCKED_OUT
Definition: winerror.h:1151
#define RPC_S_UNKNOWN_AUTHN_LEVEL
Definition: winerror.h:1056
#define RPC_S_INVALID_VERS_OPTION
Definition: winerror.h:1064
#define RPC_S_NOT_LISTENING
Definition: winerror.h:1026
#define RPC_S_UNSUPPORTED_NAME_SYNTAX
Definition: winerror.h:1046
#define ERROR_ACCOUNT_DISABLED
Definition: winerror.h:813
#define RPC_S_UNKNOWN_AUTHN_SERVICE
Definition: winerror.h:1055
#define RPC_X_SS_CANNOT_GET_CALL_HANDLE
Definition: winerror.h:1086
#define RPC_X_BYTE_COUNT_TOO_SMALL
Definition: winerror.h:1089
#define ERROR_WRONG_PASSWORD
Definition: winerror.h:805
#define RPC_S_UUID_LOCAL_ONLY
Definition: winerror.h:1131
#define ERROR_PASSWORD_MUST_CHANGE
Definition: winerror.h:1149
#define RPC_S_INCOMPLETE_NAME
Definition: winerror.h:1063
#define RPC_S_NO_PROTSEQS
Definition: winerror.h:1030
#define RPC_S_PROTSEQ_NOT_FOUND
Definition: winerror.h:1052
#define ERROR_MAX_THRDS_REACHED
Definition: winerror.h:235
#define RPC_S_STRING_TOO_LONG
Definition: winerror.h:1051
#define RPC_S_INTERNAL_ERROR
Definition: winerror.h:1074
#define RPC_S_SERVER_UNAVAILABLE
Definition: winerror.h:1033
#define RPC_X_SS_CONTEXT_DAMAGED
Definition: winerror.h:1084
#define RPC_S_INVALID_NETWORK_OPTIONS
Definition: winerror.h:1035
#define ERROR_PASSWORD_EXPIRED
Definition: winerror.h:812
#define RPC_S_ALREADY_REGISTERED
Definition: winerror.h:1022
#define RPC_S_INVALID_NET_ADDR
Definition: winerror.h:1018
#define RPC_S_INTERFACE_NOT_FOUND
Definition: winerror.h:1067
#define RPC_S_INVALID_ENDPOINT_FORMAT
Definition: winerror.h:1017
#define RPC_S_INVALID_BINDING
Definition: winerror.h:1013
#define RPC_S_INVALID_OBJECT
Definition: winerror.h:1142
#define RPC_S_UUID_NO_ADDRESS
Definition: winerror.h:1047
#define RPC_S_DUPLICATE_ENDPOINT
Definition: winerror.h:1048
#define ERROR_NOACCESS
Definition: winerror.h:578
#define RPC_S_MAX_CALLS_TOO_SMALL
Definition: winerror.h:1050
#define RPC_S_INVALID_RPC_PROTSEQ
Definition: winerror.h:1015
#define RPC_S_NO_ENTRY_NAME
Definition: winerror.h:1044
#define RPC_S_UNKNOWN_AUTHZ_SERVICE
Definition: winerror.h:1058
#define RPC_S_NOT_RPC_ERROR
Definition: winerror.h:1130
#define RPC_S_PROCNUM_OUT_OF_RANGE
Definition: winerror.h:1053
#define RPC_X_SS_CHAR_TRANS_SHORT_FILE
Definition: winerror.h:1082
#define RPC_S_FP_OVERFLOW
Definition: winerror.h:1079
#define RPC_S_UNKNOWN_MGR_TYPE
Definition: winerror.h:1027
#define RPC_S_NO_PROTSEQS_REGISTERED
Definition: winerror.h:1025
#define ERROR_NOT_ENOUGH_SERVER_MEMORY
Definition: winerror.h:666
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193