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