FreeRDP
winpr/include/winpr/rpc.h
1 
20 #ifndef WINPR_RPC_H
21 #define WINPR_RPC_H
22 
23 #include <winpr/wtypes.h>
24 
25 typedef struct
26 {
27  UINT32 ContextType;
28  GUID ContextUuid;
30 
31 typedef PCONTEXT_HANDLE PTUNNEL_CONTEXT_HANDLE_NOSERIALIZE;
32 typedef PCONTEXT_HANDLE PTUNNEL_CONTEXT_HANDLE_SERIALIZE;
33 
34 typedef PCONTEXT_HANDLE PCHANNEL_CONTEXT_HANDLE_NOSERIALIZE;
35 typedef PCONTEXT_HANDLE PCHANNEL_CONTEXT_HANDLE_SERIALIZE;
36 
37 #if defined(_WIN32) && !defined(_UWP)
38 
39 #include <rpc.h>
40 
41 #else
42 
43 #include <winpr/winpr.h>
44 #include <winpr/wtypes.h>
45 #include <winpr/sspi.h>
46 #include <winpr/spec.h>
47 #include <winpr/error.h>
48 
49 #define RPC_S_OK ERROR_SUCCESS
50 #define RPC_S_INVALID_ARG ERROR_INVALID_PARAMETER
51 #define RPC_S_OUT_OF_MEMORY ERROR_OUTOFMEMORY
52 #define RPC_S_OUT_OF_THREADS ERROR_MAX_THRDS_REACHED
53 #define RPC_S_INVALID_LEVEL ERROR_INVALID_PARAMETER
54 #define RPC_S_BUFFER_TOO_SMALL ERROR_INSUFFICIENT_BUFFER
55 #define RPC_S_INVALID_SECURITY_DESC ERROR_INVALID_SECURITY_DESCR
56 #define RPC_S_ACCESS_DENIED ERROR_ACCESS_DENIED
57 #define RPC_S_SERVER_OUT_OF_MEMORY ERROR_NOT_ENOUGH_SERVER_MEMORY
58 #define RPC_S_ASYNC_CALL_PENDING ERROR_IO_PENDING
59 #define RPC_S_UNKNOWN_PRINCIPAL ERROR_NONE_MAPPED
60 #define RPC_S_TIMEOUT ERROR_TIMEOUT
61 
62 #define RPC_X_NO_MEMORY RPC_S_OUT_OF_MEMORY
63 #define RPC_X_INVALID_BOUND RPC_S_INVALID_BOUND
64 #define RPC_X_INVALID_TAG RPC_S_INVALID_TAG
65 #define RPC_X_ENUM_VALUE_TOO_LARGE RPC_X_ENUM_VALUE_OUT_OF_RANGE
66 #define RPC_X_SS_CONTEXT_MISMATCH ERROR_INVALID_HANDLE
67 #define RPC_X_INVALID_BUFFER ERROR_INVALID_USER_BUFFER
68 #define RPC_X_PIPE_APP_MEMORY ERROR_OUTOFMEMORY
69 #define RPC_X_INVALID_PIPE_OPERATION RPC_X_WRONG_PIPE_ORDER
70 
71 #define RPC_VAR_ENTRY __cdecl
72 
73 typedef long RPC_STATUS;
74 
75 #ifndef _WIN32
76 typedef CHAR* RPC_CSTR;
77 typedef WCHAR* RPC_WSTR;
78 #endif
79 
80 typedef void* I_RPC_HANDLE;
81 typedef I_RPC_HANDLE RPC_BINDING_HANDLE;
82 typedef RPC_BINDING_HANDLE handle_t;
83 
84 typedef struct
85 {
86  unsigned long Count;
87  RPC_BINDING_HANDLE BindingH[1];
89 #define rpc_binding_vector_t RPC_BINDING_VECTOR
90 
91 typedef struct
92 {
93  unsigned long Count;
94  UUID* Uuid[1];
95 } UUID_VECTOR;
96 #define uuid_vector_t UUID_VECTOR
97 
98 typedef void* RPC_IF_HANDLE;
99 
100 typedef struct
101 {
102  UUID Uuid;
103  unsigned short VersMajor;
104  unsigned short VersMinor;
105 } RPC_IF_ID;
106 
107 #define RPC_C_BINDING_INFINITE_TIMEOUT 10
108 #define RPC_C_BINDING_MIN_TIMEOUT 0
109 #define RPC_C_BINDING_DEFAULT_TIMEOUT 5
110 #define RPC_C_BINDING_MAX_TIMEOUT 9
111 
112 #define RPC_C_CANCEL_INFINITE_TIMEOUT -1
113 
114 #define RPC_C_LISTEN_MAX_CALLS_DEFAULT 1234
115 #define RPC_C_PROTSEQ_MAX_REQS_DEFAULT 10
116 
117 #define RPC_C_BIND_TO_ALL_NICS 1
118 #define RPC_C_USE_INTERNET_PORT 0x1
119 #define RPC_C_USE_INTRANET_PORT 0x2
120 #define RPC_C_DONT_FAIL 0x4
121 
122 #define RPC_C_MQ_TEMPORARY 0x0000
123 #define RPC_C_MQ_PERMANENT 0x0001
124 #define RPC_C_MQ_CLEAR_ON_OPEN 0x0002
125 #define RPC_C_MQ_USE_EXISTING_SECURITY 0x0004
126 #define RPC_C_MQ_AUTHN_LEVEL_NONE 0x0000
127 #define RPC_C_MQ_AUTHN_LEVEL_PKT_INTEGRITY 0x0008
128 #define RPC_C_MQ_AUTHN_LEVEL_PKT_PRIVACY 0x0010
129 
130 #define RPC_C_OPT_MQ_DELIVERY 1
131 #define RPC_C_OPT_MQ_PRIORITY 2
132 #define RPC_C_OPT_MQ_JOURNAL 3
133 #define RPC_C_OPT_MQ_ACKNOWLEDGE 4
134 #define RPC_C_OPT_MQ_AUTHN_SERVICE 5
135 #define RPC_C_OPT_MQ_AUTHN_LEVEL 6
136 #define RPC_C_OPT_MQ_TIME_TO_REACH_QUEUE 7
137 #define RPC_C_OPT_MQ_TIME_TO_BE_RECEIVED 8
138 #define RPC_C_OPT_BINDING_NONCAUSAL 9
139 #define RPC_C_OPT_SECURITY_CALLBACK 10
140 #define RPC_C_OPT_UNIQUE_BINDING 11
141 #define RPC_C_OPT_CALL_TIMEOUT 12
142 #define RPC_C_OPT_DONT_LINGER 13
143 #define RPC_C_OPT_MAX_OPTIONS 14
144 
145 #define RPC_C_MQ_EXPRESS 0
146 #define RPC_C_MQ_RECOVERABLE 1
147 
148 #define RPC_C_MQ_JOURNAL_NONE 0
149 #define RPC_C_MQ_JOURNAL_DEADLETTER 1
150 #define RPC_C_MQ_JOURNAL_ALWAYS 2
151 
152 #define RPC_C_FULL_CERT_CHAIN 0x0001
153 
154 typedef struct
155 {
156  unsigned int Count;
157  unsigned char* Protseq[1];
159 
160 typedef struct
161 {
162  unsigned int Count;
163  unsigned short* Protseq[1];
165 
166 #ifdef UNICODE
167 #define RPC_PROTSEQ_VECTOR RPC_PROTSEQ_VECTORW
168 #else
169 #define RPC_PROTSEQ_VECTOR RPC_PROTSEQ_VECTORA
170 #endif
171 
172 typedef struct
173 {
174  unsigned int Length;
175  unsigned long EndpointFlags;
176  unsigned long NICFlags;
178 
179 typedef void RPC_OBJECT_INQ_FN(UUID* ObjectUuid, UUID* TypeUuid, RPC_STATUS* pStatus);
180 typedef RPC_STATUS RPC_IF_CALLBACK_FN(RPC_IF_HANDLE InterfaceUuid, void* Context);
181 typedef void RPC_SECURITY_CALLBACK_FN(void* Context);
182 
183 #define RPC_MGR_EPV void
184 
185 typedef struct
186 {
187  unsigned int Count;
188  unsigned long Stats[1];
190 
191 #define RPC_C_STATS_CALLS_IN 0
192 #define RPC_C_STATS_CALLS_OUT 1
193 #define RPC_C_STATS_PKTS_IN 2
194 #define RPC_C_STATS_PKTS_OUT 3
195 
196 typedef struct
197 {
198  unsigned long Count;
199  RPC_IF_ID* IfId[1];
201 
202 #ifndef _WIN32
203 
204 typedef void* RPC_AUTH_IDENTITY_HANDLE;
205 typedef void* RPC_AUTHZ_HANDLE;
206 
207 #define RPC_C_AUTHN_LEVEL_DEFAULT 0
208 #define RPC_C_AUTHN_LEVEL_NONE 1
209 #define RPC_C_AUTHN_LEVEL_CONNECT 2
210 #define RPC_C_AUTHN_LEVEL_CALL 3
211 #define RPC_C_AUTHN_LEVEL_PKT 4
212 #define RPC_C_AUTHN_LEVEL_PKT_INTEGRITY 5
213 #define RPC_C_AUTHN_LEVEL_PKT_PRIVACY 6
214 
215 #define RPC_C_IMP_LEVEL_DEFAULT 0
216 #define RPC_C_IMP_LEVEL_ANONYMOUS 1
217 #define RPC_C_IMP_LEVEL_IDENTIFY 2
218 #define RPC_C_IMP_LEVEL_IMPERSONATE 3
219 #define RPC_C_IMP_LEVEL_DELEGATE 4
220 
221 #define RPC_C_QOS_IDENTITY_STATIC 0
222 #define RPC_C_QOS_IDENTITY_DYNAMIC 1
223 
224 #define RPC_C_QOS_CAPABILITIES_DEFAULT 0x0
225 #define RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH 0x1
226 #define RPC_C_QOS_CAPABILITIES_MAKE_FULLSIC 0x2
227 #define RPC_C_QOS_CAPABILITIES_ANY_AUTHORITY 0x4
228 #define RPC_C_QOS_CAPABILITIES_IGNORE_DELEGATE_FAILURE 0x8
229 #define RPC_C_QOS_CAPABILITIES_LOCAL_MA_HINT 0x10
230 
231 #define RPC_C_PROTECT_LEVEL_DEFAULT (RPC_C_AUTHN_LEVEL_DEFAULT)
232 #define RPC_C_PROTECT_LEVEL_NONE (RPC_C_AUTHN_LEVEL_NONE)
233 #define RPC_C_PROTECT_LEVEL_CONNECT (RPC_C_AUTHN_LEVEL_CONNECT)
234 #define RPC_C_PROTECT_LEVEL_CALL (RPC_C_AUTHN_LEVEL_CALL)
235 #define RPC_C_PROTECT_LEVEL_PKT (RPC_C_AUTHN_LEVEL_PKT)
236 #define RPC_C_PROTECT_LEVEL_PKT_INTEGRITY (RPC_C_AUTHN_LEVEL_PKT_INTEGRITY)
237 #define RPC_C_PROTECT_LEVEL_PKT_PRIVACY (RPC_C_AUTHN_LEVEL_PKT_PRIVACY)
238 
239 #define RPC_C_AUTHN_NONE 0
240 #define RPC_C_AUTHN_DCE_PRIVATE 1
241 #define RPC_C_AUTHN_DCE_PUBLIC 2
242 #define RPC_C_AUTHN_DEC_PUBLIC 4
243 #define RPC_C_AUTHN_GSS_NEGOTIATE 9
244 #define RPC_C_AUTHN_WINNT 10
245 #define RPC_C_AUTHN_GSS_SCHANNEL 14
246 #define RPC_C_AUTHN_GSS_KERBEROS 16
247 #define RPC_C_AUTHN_DPA 17
248 #define RPC_C_AUTHN_MSN 18
249 #define RPC_C_AUTHN_DIGEST 21
250 #define RPC_C_AUTHN_MQ 100
251 #define RPC_C_AUTHN_DEFAULT 0xFFFFFFFFL
252 
253 #define RPC_C_NO_CREDENTIALS ((RPC_AUTH_IDENTITY_HANDLE)MAXUINT_PTR)
254 
255 #define RPC_C_SECURITY_QOS_VERSION 1L
256 #define RPC_C_SECURITY_QOS_VERSION_1 1L
257 
258 typedef struct
259 {
260  unsigned long Version;
261  unsigned long Capabilities;
262  unsigned long IdentityTracking;
263  unsigned long ImpersonationType;
265 
266 #define RPC_C_SECURITY_QOS_VERSION_2 2L
267 
268 #define RPC_C_AUTHN_INFO_TYPE_HTTP 1
269 
270 #define RPC_C_HTTP_AUTHN_TARGET_SERVER 1
271 #define RPC_C_HTTP_AUTHN_TARGET_PROXY 2
272 
273 #define RPC_C_HTTP_AUTHN_SCHEME_BASIC 0x00000001
274 #define RPC_C_HTTP_AUTHN_SCHEME_NTLM 0x00000002
275 #define RPC_C_HTTP_AUTHN_SCHEME_PASSPORT 0x00000004
276 #define RPC_C_HTTP_AUTHN_SCHEME_DIGEST 0x00000008
277 #define RPC_C_HTTP_AUTHN_SCHEME_NEGOTIATE 0x00000010
278 #define RPC_C_HTTP_AUTHN_SCHEME_CERT 0x00010000
279 
280 #define RPC_C_HTTP_FLAG_USE_SSL 1
281 #define RPC_C_HTTP_FLAG_USE_FIRST_AUTH_SCHEME 2
282 #define RPC_C_HTTP_FLAG_IGNORE_CERT_CN_INVALID 8
283 
284 typedef struct
285 {
286  SEC_WINNT_AUTH_IDENTITY_W* TransportCredentials;
287  unsigned long Flags;
288  unsigned long AuthenticationTarget;
289  unsigned long NumberOfAuthnSchemes;
290  unsigned long* AuthnSchemes;
291  unsigned short* ServerCertificateSubject;
293 
294 typedef struct
295 {
296  SEC_WINNT_AUTH_IDENTITY_A* TransportCredentials;
297  unsigned long Flags;
298  unsigned long AuthenticationTarget;
299  unsigned long NumberOfAuthnSchemes;
300  unsigned long* AuthnSchemes;
301  unsigned char* ServerCertificateSubject;
303 
304 typedef struct
305 {
306  unsigned long Version;
307  unsigned long Capabilities;
308  unsigned long IdentityTracking;
309  unsigned long ImpersonationType;
310  unsigned long AdditionalSecurityInfoType;
311  union
312  {
313  RPC_HTTP_TRANSPORT_CREDENTIALS_W* HttpCredentials;
314  } u;
316 
317 typedef struct
318 {
319  unsigned long Version;
320  unsigned long Capabilities;
321  unsigned long IdentityTracking;
322  unsigned long ImpersonationType;
323  unsigned long AdditionalSecurityInfoType;
324  union
325  {
326  RPC_HTTP_TRANSPORT_CREDENTIALS_A* HttpCredentials;
327  } u;
329 
330 #define RPC_C_SECURITY_QOS_VERSION_3 3L
331 
332 typedef struct
333 {
334  unsigned long Version;
335  unsigned long Capabilities;
336  unsigned long IdentityTracking;
337  unsigned long ImpersonationType;
338  unsigned long AdditionalSecurityInfoType;
339  union
340  {
341  RPC_HTTP_TRANSPORT_CREDENTIALS_W* HttpCredentials;
342  } u;
343  void* Sid;
345 
346 typedef struct
347 {
348  unsigned long Version;
349  unsigned long Capabilities;
350  unsigned long IdentityTracking;
351  unsigned long ImpersonationType;
352  unsigned long AdditionalSecurityInfoType;
353  union
354  {
355  RPC_HTTP_TRANSPORT_CREDENTIALS_A* HttpCredentials;
356  } u;
357  void* Sid;
359 
360 typedef enum
361 {
362  RPCHTTP_RS_REDIRECT = 1,
363  RPCHTTP_RS_ACCESS_1,
364  RPCHTTP_RS_SESSION,
365  RPCHTTP_RS_ACCESS_2,
366  RPCHTTP_RS_INTERFACE
367 } RPC_HTTP_REDIRECTOR_STAGE;
368 
369 typedef RPC_STATUS (*RPC_NEW_HTTP_PROXY_CHANNEL)(
370  RPC_HTTP_REDIRECTOR_STAGE RedirectorStage, unsigned short* ServerName,
371  unsigned short* ServerPort, unsigned short* RemoteUser, unsigned short* AuthType,
372  void* ResourceUuid, void* Metadata, void* SessionId, void* Interface, void* Reserved,
373  unsigned long Flags, unsigned short** NewServerName, unsigned short** NewServerPort);
374 
375 typedef void (*RPC_HTTP_PROXY_FREE_STRING)(unsigned short* String);
376 
377 #define RPC_C_AUTHZ_NONE 0
378 #define RPC_C_AUTHZ_NAME 1
379 #define RPC_C_AUTHZ_DCE 2
380 #define RPC_C_AUTHZ_DEFAULT 0xFFFFFFFF
381 
382 #endif
383 
384 typedef void (*RPC_AUTH_KEY_RETRIEVAL_FN)(void* Arg, unsigned short* ServerPrincName,
385  unsigned long KeyVer, void** Key, RPC_STATUS* pStatus);
386 
387 #define DCE_C_ERROR_STRING_LEN 256
388 
389 typedef I_RPC_HANDLE* RPC_EP_INQ_HANDLE;
390 
391 #define RPC_C_EP_ALL_ELTS 0
392 #define RPC_C_EP_MATCH_BY_IF 1
393 #define RPC_C_EP_MATCH_BY_OBJ 2
394 #define RPC_C_EP_MATCH_BY_BOTH 3
395 
396 #define RPC_C_VERS_ALL 1
397 #define RPC_C_VERS_COMPATIBLE 2
398 #define RPC_C_VERS_EXACT 3
399 #define RPC_C_VERS_MAJOR_ONLY 4
400 #define RPC_C_VERS_UPTO 5
401 
402 typedef int (*RPC_MGMT_AUTHORIZATION_FN)(RPC_BINDING_HANDLE ClientBinding,
403  unsigned long RequestedMgmtOperation, RPC_STATUS* pStatus);
404 
405 #define RPC_C_MGMT_INQ_IF_IDS 0
406 #define RPC_C_MGMT_INQ_PRINC_NAME 1
407 #define RPC_C_MGMT_INQ_STATS 2
408 #define RPC_C_MGMT_IS_SERVER_LISTEN 3
409 #define RPC_C_MGMT_STOP_SERVER_LISTEN 4
410 
411 #define RPC_C_PARM_MAX_PACKET_LENGTH 1
412 #define RPC_C_PARM_BUFFER_LENGTH 2
413 
414 #define RPC_IF_AUTOLISTEN 0x0001
415 #define RPC_IF_OLE 0x0002
416 #define RPC_IF_ALLOW_UNKNOWN_AUTHORITY 0x0004
417 #define RPC_IF_ALLOW_SECURE_ONLY 0x0008
418 #define RPC_IF_ALLOW_CALLBACKS_WITH_NO_AUTH 0x0010
419 #define RPC_IF_ALLOW_LOCAL_ONLY 0x0020
420 #define RPC_IF_SEC_NO_CACHE 0x0040
421 
422 typedef struct
423 {
424  unsigned long Version;
425  unsigned long Flags;
426  unsigned long ComTimeout;
427  unsigned long CallTimeout;
429 
430 typedef struct
431 {
432  unsigned long Version;
433  unsigned short* ServerPrincName;
434  unsigned long AuthnLevel;
435  unsigned long AuthnSvc;
436  SEC_WINNT_AUTH_IDENTITY* AuthIdentity;
437  RPC_SECURITY_QOS* SecurityQos;
439 
440 typedef struct
441 {
442  unsigned long Version;
443  unsigned long Flags;
444  unsigned long ProtocolSequence;
445  unsigned short* NetworkAddress;
446  unsigned short* StringEndpoint;
447  union
448  {
449  unsigned short* Reserved;
450  } u1;
451  UUID ObjectUuid;
453 
454 #define RPC_CALL_STATUS_IN_PROGRESS 0x01
455 #define RPC_CALL_STATUS_CANCELLED 0x02
456 #define RPC_CALL_STATUS_DISCONNECTED 0x03
457 
458 #ifdef __cplusplus
459 extern "C"
460 {
461 #endif
462 
463  WINPR_API RPC_STATUS RpcBindingCopy(RPC_BINDING_HANDLE SourceBinding,
464  RPC_BINDING_HANDLE* DestinationBinding);
465  WINPR_API RPC_STATUS RpcBindingFree(RPC_BINDING_HANDLE* Binding);
466  WINPR_API RPC_STATUS RpcBindingSetOption(RPC_BINDING_HANDLE hBinding, unsigned long option,
467  ULONG_PTR optionValue);
468  WINPR_API RPC_STATUS RpcBindingInqOption(RPC_BINDING_HANDLE hBinding, unsigned long option,
469  ULONG_PTR* pOptionValue);
470  WINPR_API RPC_STATUS RpcBindingFromStringBindingA(RPC_CSTR StringBinding,
471  RPC_BINDING_HANDLE* Binding);
472  WINPR_API RPC_STATUS RpcBindingFromStringBindingW(RPC_WSTR StringBinding,
473  RPC_BINDING_HANDLE* Binding);
474  WINPR_API RPC_STATUS RpcSsGetContextBinding(void* ContextHandle, RPC_BINDING_HANDLE* Binding);
475  WINPR_API RPC_STATUS RpcBindingInqObject(RPC_BINDING_HANDLE Binding, UUID* ObjectUuid);
476  WINPR_API RPC_STATUS RpcBindingReset(RPC_BINDING_HANDLE Binding);
477  WINPR_API RPC_STATUS RpcBindingSetObject(RPC_BINDING_HANDLE Binding, UUID* ObjectUuid);
478  WINPR_API RPC_STATUS RpcMgmtInqDefaultProtectLevel(unsigned long AuthnSvc,
479  unsigned long* AuthnLevel);
480  WINPR_API RPC_STATUS RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding,
481  RPC_CSTR* StringBinding);
482  WINPR_API RPC_STATUS RpcBindingToStringBindingW(RPC_BINDING_HANDLE Binding,
483  RPC_WSTR* StringBinding);
484  WINPR_API RPC_STATUS RpcBindingVectorFree(RPC_BINDING_VECTOR** BindingVector);
485  WINPR_API RPC_STATUS RpcStringBindingComposeA(RPC_CSTR ObjUuid, RPC_CSTR Protseq,
486  RPC_CSTR NetworkAddr, RPC_CSTR Endpoint,
487  RPC_CSTR Options, RPC_CSTR* StringBinding);
488  WINPR_API RPC_STATUS RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq,
489  RPC_WSTR NetworkAddr, RPC_WSTR Endpoint,
490  RPC_WSTR Options, RPC_WSTR* StringBinding);
491  WINPR_API RPC_STATUS RpcStringBindingParseA(RPC_CSTR StringBinding, RPC_CSTR* ObjUuid,
492  RPC_CSTR* Protseq, RPC_CSTR* NetworkAddr,
493  RPC_CSTR* Endpoint, RPC_CSTR* NetworkOptions);
494  WINPR_API RPC_STATUS RpcStringBindingParseW(RPC_WSTR StringBinding, RPC_WSTR* ObjUuid,
495  RPC_WSTR* Protseq, RPC_WSTR* NetworkAddr,
496  RPC_WSTR* Endpoint, RPC_WSTR* NetworkOptions);
497  WINPR_API RPC_STATUS RpcStringFreeA(RPC_CSTR* String);
498  WINPR_API RPC_STATUS RpcStringFreeW(RPC_WSTR* String);
499  WINPR_API RPC_STATUS RpcIfInqId(RPC_IF_HANDLE RpcIfHandle, RPC_IF_ID* RpcIfId);
500  WINPR_API RPC_STATUS RpcNetworkIsProtseqValidA(RPC_CSTR Protseq);
501  WINPR_API RPC_STATUS RpcNetworkIsProtseqValidW(RPC_WSTR Protseq);
502  WINPR_API RPC_STATUS RpcMgmtInqComTimeout(RPC_BINDING_HANDLE Binding, unsigned int* Timeout);
503  WINPR_API RPC_STATUS RpcMgmtSetComTimeout(RPC_BINDING_HANDLE Binding, unsigned int Timeout);
504  WINPR_API RPC_STATUS RpcMgmtSetCancelTimeout(long Timeout);
505  WINPR_API RPC_STATUS RpcNetworkInqProtseqsA(RPC_PROTSEQ_VECTORA** ProtseqVector);
506  WINPR_API RPC_STATUS RpcNetworkInqProtseqsW(RPC_PROTSEQ_VECTORW** ProtseqVector);
507  WINPR_API RPC_STATUS RpcObjectInqType(UUID* ObjUuid, UUID* TypeUuid);
508  WINPR_API RPC_STATUS RpcObjectSetInqFn(RPC_OBJECT_INQ_FN* InquiryFn);
509  WINPR_API RPC_STATUS RpcObjectSetType(UUID* ObjUuid, UUID* TypeUuid);
510  WINPR_API RPC_STATUS RpcProtseqVectorFreeA(RPC_PROTSEQ_VECTORA** ProtseqVector);
511  WINPR_API RPC_STATUS RpcProtseqVectorFreeW(RPC_PROTSEQ_VECTORW** ProtseqVector);
512  WINPR_API RPC_STATUS RpcServerInqBindings(RPC_BINDING_VECTOR** BindingVector);
513  WINPR_API RPC_STATUS RpcServerInqIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
514  RPC_MGR_EPV** MgrEpv);
515  WINPR_API RPC_STATUS RpcServerListen(unsigned int MinimumCallThreads, unsigned int MaxCalls,
516  unsigned int DontWait);
517  WINPR_API RPC_STATUS RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
518  RPC_MGR_EPV* MgrEpv);
519  WINPR_API RPC_STATUS RpcServerRegisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
520  RPC_MGR_EPV* MgrEpv, unsigned int Flags,
521  unsigned int MaxCalls,
522  RPC_IF_CALLBACK_FN* IfCallback);
523  WINPR_API RPC_STATUS RpcServerRegisterIf2(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
524  RPC_MGR_EPV* MgrEpv, unsigned int Flags,
525  unsigned int MaxCalls, unsigned int MaxRpcSize,
526  RPC_IF_CALLBACK_FN* IfCallbackFn);
527  WINPR_API RPC_STATUS RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
528  unsigned int WaitForCallsToComplete);
529  WINPR_API RPC_STATUS RpcServerUnregisterIfEx(RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid,
530  int RundownContextHandles);
531  WINPR_API RPC_STATUS RpcServerUseAllProtseqs(unsigned int MaxCalls, void* SecurityDescriptor);
532  WINPR_API RPC_STATUS RpcServerUseAllProtseqsEx(unsigned int MaxCalls, void* SecurityDescriptor,
533  PRPC_POLICY Policy);
534  WINPR_API RPC_STATUS RpcServerUseAllProtseqsIf(unsigned int MaxCalls, RPC_IF_HANDLE IfSpec,
535  void* SecurityDescriptor);
536  WINPR_API RPC_STATUS RpcServerUseAllProtseqsIfEx(unsigned int MaxCalls, RPC_IF_HANDLE IfSpec,
537  void* SecurityDescriptor, PRPC_POLICY Policy);
538  WINPR_API RPC_STATUS RpcServerUseProtseqA(RPC_CSTR Protseq, unsigned int MaxCalls,
539  void* SecurityDescriptor);
540  WINPR_API RPC_STATUS RpcServerUseProtseqExA(RPC_CSTR Protseq, unsigned int MaxCalls,
541  void* SecurityDescriptor, PRPC_POLICY Policy);
542  WINPR_API RPC_STATUS RpcServerUseProtseqW(RPC_WSTR Protseq, unsigned int MaxCalls,
543  void* SecurityDescriptor);
544  WINPR_API RPC_STATUS RpcServerUseProtseqExW(RPC_WSTR Protseq, unsigned int MaxCalls,
545  void* SecurityDescriptor, PRPC_POLICY Policy);
546  WINPR_API RPC_STATUS RpcServerUseProtseqEpA(RPC_CSTR Protseq, unsigned int MaxCalls,
547  RPC_CSTR Endpoint, void* SecurityDescriptor);
548  WINPR_API RPC_STATUS RpcServerUseProtseqEpExA(RPC_CSTR Protseq, unsigned int MaxCalls,
549  RPC_CSTR Endpoint, void* SecurityDescriptor,
550  PRPC_POLICY Policy);
551  WINPR_API RPC_STATUS RpcServerUseProtseqEpW(RPC_WSTR Protseq, unsigned int MaxCalls,
552  RPC_WSTR Endpoint, void* SecurityDescriptor);
553  WINPR_API RPC_STATUS RpcServerUseProtseqEpExW(RPC_WSTR Protseq, unsigned int MaxCalls,
554  RPC_WSTR Endpoint, void* SecurityDescriptor,
555  PRPC_POLICY Policy);
556  WINPR_API RPC_STATUS RpcServerUseProtseqIfA(RPC_CSTR Protseq, unsigned int MaxCalls,
557  RPC_IF_HANDLE IfSpec, void* SecurityDescriptor);
558  WINPR_API RPC_STATUS RpcServerUseProtseqIfExA(RPC_CSTR Protseq, unsigned int MaxCalls,
559  RPC_IF_HANDLE IfSpec, void* SecurityDescriptor,
560  PRPC_POLICY Policy);
561  WINPR_API RPC_STATUS RpcServerUseProtseqIfW(RPC_WSTR Protseq, unsigned int MaxCalls,
562  RPC_IF_HANDLE IfSpec, void* SecurityDescriptor);
563  WINPR_API RPC_STATUS RpcServerUseProtseqIfExW(RPC_WSTR Protseq, unsigned int MaxCalls,
564  RPC_IF_HANDLE IfSpec, void* SecurityDescriptor,
565  PRPC_POLICY Policy);
566  WINPR_API void RpcServerYield(void);
567  WINPR_API RPC_STATUS RpcMgmtStatsVectorFree(RPC_STATS_VECTOR** StatsVector);
568  WINPR_API RPC_STATUS RpcMgmtInqStats(RPC_BINDING_HANDLE Binding, RPC_STATS_VECTOR** Statistics);
569  WINPR_API RPC_STATUS RpcMgmtIsServerListening(RPC_BINDING_HANDLE Binding);
570  WINPR_API RPC_STATUS RpcMgmtStopServerListening(RPC_BINDING_HANDLE Binding);
571  WINPR_API RPC_STATUS RpcMgmtWaitServerListen(void);
572  WINPR_API RPC_STATUS RpcMgmtSetServerStackSize(unsigned long ThreadStackSize);
573  WINPR_API void RpcSsDontSerializeContext(void);
574  WINPR_API RPC_STATUS RpcMgmtEnableIdleCleanup(void);
575  WINPR_API RPC_STATUS RpcMgmtInqIfIds(RPC_BINDING_HANDLE Binding, RPC_IF_ID_VECTOR** IfIdVector);
576  WINPR_API RPC_STATUS RpcIfIdVectorFree(RPC_IF_ID_VECTOR** IfIdVector);
577  WINPR_API RPC_STATUS RpcMgmtInqServerPrincNameA(RPC_BINDING_HANDLE Binding,
578  unsigned long AuthnSvc,
579  RPC_CSTR* ServerPrincName);
580  WINPR_API RPC_STATUS RpcMgmtInqServerPrincNameW(RPC_BINDING_HANDLE Binding,
581  unsigned long AuthnSvc,
582  RPC_WSTR* ServerPrincName);
583  WINPR_API RPC_STATUS RpcServerInqDefaultPrincNameA(unsigned long AuthnSvc, RPC_CSTR* PrincName);
584  WINPR_API RPC_STATUS RpcServerInqDefaultPrincNameW(unsigned long AuthnSvc, RPC_WSTR* PrincName);
585  WINPR_API RPC_STATUS RpcEpResolveBinding(RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE IfSpec);
586  WINPR_API RPC_STATUS RpcNsBindingInqEntryNameA(RPC_BINDING_HANDLE Binding,
587  unsigned long EntryNameSyntax,
588  RPC_CSTR* EntryName);
589  WINPR_API RPC_STATUS RpcNsBindingInqEntryNameW(RPC_BINDING_HANDLE Binding,
590  unsigned long EntryNameSyntax,
591  RPC_WSTR* EntryName);
592 
593  WINPR_API RPC_STATUS RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle);
594  WINPR_API RPC_STATUS RpcRevertToSelfEx(RPC_BINDING_HANDLE BindingHandle);
595  WINPR_API RPC_STATUS RpcRevertToSelf(void);
596  WINPR_API RPC_STATUS RpcBindingInqAuthClientA(RPC_BINDING_HANDLE ClientBinding,
597  RPC_AUTHZ_HANDLE* Privs,
598  RPC_CSTR* ServerPrincName,
599  unsigned long* AuthnLevel,
600  unsigned long* AuthnSvc, unsigned long* AuthzSvc);
601  WINPR_API RPC_STATUS RpcBindingInqAuthClientW(RPC_BINDING_HANDLE ClientBinding,
602  RPC_AUTHZ_HANDLE* Privs,
603  RPC_WSTR* ServerPrincName,
604  unsigned long* AuthnLevel,
605  unsigned long* AuthnSvc, unsigned long* AuthzSvc);
606  WINPR_API RPC_STATUS RpcBindingInqAuthClientExA(RPC_BINDING_HANDLE ClientBinding,
607  RPC_AUTHZ_HANDLE* Privs,
608  RPC_CSTR* ServerPrincName,
609  unsigned long* AuthnLevel,
610  unsigned long* AuthnSvc,
611  unsigned long* AuthzSvc, unsigned long Flags);
612  WINPR_API RPC_STATUS RpcBindingInqAuthClientExW(RPC_BINDING_HANDLE ClientBinding,
613  RPC_AUTHZ_HANDLE* Privs,
614  RPC_WSTR* ServerPrincName,
615  unsigned long* AuthnLevel,
616  unsigned long* AuthnSvc,
617  unsigned long* AuthzSvc, unsigned long Flags);
618  WINPR_API RPC_STATUS RpcBindingInqAuthInfoA(RPC_BINDING_HANDLE Binding,
619  RPC_CSTR* ServerPrincName,
620  unsigned long* AuthnLevel, unsigned long* AuthnSvc,
621  RPC_AUTH_IDENTITY_HANDLE* AuthIdentity,
622  unsigned long* AuthzSvc);
623  WINPR_API RPC_STATUS RpcBindingInqAuthInfoW(RPC_BINDING_HANDLE Binding,
624  RPC_WSTR* ServerPrincName,
625  unsigned long* AuthnLevel, unsigned long* AuthnSvc,
626  RPC_AUTH_IDENTITY_HANDLE* AuthIdentity,
627  unsigned long* AuthzSvc);
628  WINPR_API RPC_STATUS RpcBindingSetAuthInfoA(RPC_BINDING_HANDLE Binding,
629  RPC_CSTR ServerPrincName, unsigned long AuthnLevel,
630  unsigned long AuthnSvc,
631  RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
632  unsigned long AuthzSvc);
633  WINPR_API RPC_STATUS RpcBindingSetAuthInfoExA(RPC_BINDING_HANDLE Binding,
634  RPC_CSTR ServerPrincName,
635  unsigned long AuthnLevel, unsigned long AuthnSvc,
636  RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
637  unsigned long AuthzSvc,
638  RPC_SECURITY_QOS* SecurityQos);
639  WINPR_API RPC_STATUS RpcBindingSetAuthInfoW(RPC_BINDING_HANDLE Binding,
640  RPC_WSTR ServerPrincName, unsigned long AuthnLevel,
641  unsigned long AuthnSvc,
642  RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
643  unsigned long AuthzSvc);
644  WINPR_API RPC_STATUS RpcBindingSetAuthInfoExW(RPC_BINDING_HANDLE Binding,
645  RPC_WSTR ServerPrincName,
646  unsigned long AuthnLevel, unsigned long AuthnSvc,
647  RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
648  unsigned long AuthzSvc,
649  RPC_SECURITY_QOS* SecurityQOS);
650  WINPR_API RPC_STATUS RpcBindingInqAuthInfoExA(
651  RPC_BINDING_HANDLE Binding, RPC_CSTR* ServerPrincName, unsigned long* AuthnLevel,
652  unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc,
653  unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS);
654  WINPR_API RPC_STATUS RpcBindingInqAuthInfoExW(
655  RPC_BINDING_HANDLE Binding, RPC_WSTR* ServerPrincName, unsigned long* AuthnLevel,
656  unsigned long* AuthnSvc, RPC_AUTH_IDENTITY_HANDLE* AuthIdentity, unsigned long* AuthzSvc,
657  unsigned long RpcQosVersion, RPC_SECURITY_QOS* SecurityQOS);
658 
659  WINPR_API RPC_STATUS RpcServerRegisterAuthInfoA(RPC_CSTR ServerPrincName,
660  unsigned long AuthnSvc,
661  RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg);
662  WINPR_API RPC_STATUS RpcServerRegisterAuthInfoW(RPC_WSTR ServerPrincName,
663  unsigned long AuthnSvc,
664  RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, void* Arg);
665 
666  WINPR_API RPC_STATUS RpcBindingServerFromClient(RPC_BINDING_HANDLE ClientBinding,
667  RPC_BINDING_HANDLE* ServerBinding);
668  WINPR_API DECLSPEC_NORETURN void RpcRaiseException(RPC_STATUS exception);
669  WINPR_API RPC_STATUS RpcTestCancel(void);
670  WINPR_API RPC_STATUS RpcServerTestCancel(RPC_BINDING_HANDLE BindingHandle);
671  WINPR_API RPC_STATUS RpcCancelThread(void* Thread);
672  WINPR_API RPC_STATUS RpcCancelThreadEx(void* Thread, long Timeout);
673 
674  WINPR_API RPC_STATUS UuidCreate(UUID* Uuid);
675  WINPR_API RPC_STATUS UuidCreateSequential(UUID* Uuid);
676  WINPR_API RPC_STATUS UuidToStringA(const UUID* Uuid, RPC_CSTR* StringUuid);
677  WINPR_API RPC_STATUS UuidFromStringA(RPC_CSTR StringUuid, UUID* Uuid);
678  WINPR_API RPC_STATUS UuidToStringW(const UUID* Uuid, RPC_WSTR* StringUuid);
679  WINPR_API RPC_STATUS UuidFromStringW(RPC_WSTR StringUuid, UUID* Uuid);
680  WINPR_API signed int UuidCompare(const UUID* Uuid1, const UUID* Uuid2, RPC_STATUS* Status);
681  WINPR_API RPC_STATUS UuidCreateNil(UUID* NilUuid);
682  WINPR_API int UuidEqual(const UUID* Uuid1, const UUID* Uuid2, RPC_STATUS* Status);
683  WINPR_API unsigned short UuidHash(const UUID* Uuid, RPC_STATUS* Status);
684  WINPR_API int UuidIsNil(const UUID* Uuid, RPC_STATUS* Status);
685 
686  WINPR_API RPC_STATUS RpcEpRegisterNoReplaceA(RPC_IF_HANDLE IfSpec,
687  RPC_BINDING_VECTOR* BindingVector,
688  UUID_VECTOR* UuidVector, RPC_CSTR Annotation);
689  WINPR_API RPC_STATUS RpcEpRegisterNoReplaceW(RPC_IF_HANDLE IfSpec,
690  RPC_BINDING_VECTOR* BindingVector,
691  UUID_VECTOR* UuidVector, RPC_WSTR Annotation);
692  WINPR_API RPC_STATUS RpcEpRegisterA(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
693  UUID_VECTOR* UuidVector, RPC_CSTR Annotation);
694  WINPR_API RPC_STATUS RpcEpRegisterW(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
695  UUID_VECTOR* UuidVector, RPC_WSTR Annotation);
696  WINPR_API RPC_STATUS RpcEpUnregister(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
697  UUID_VECTOR* UuidVector);
698 
699  WINPR_API RPC_STATUS DceErrorInqTextA(RPC_STATUS RpcStatus, RPC_CSTR ErrorText);
700  WINPR_API RPC_STATUS DceErrorInqTextW(RPC_STATUS RpcStatus, RPC_WSTR ErrorText);
701 
702  WINPR_API RPC_STATUS RpcMgmtEpEltInqBegin(RPC_BINDING_HANDLE EpBinding,
703  unsigned long InquiryType, RPC_IF_ID* IfId,
704  unsigned long VersOption, UUID* ObjectUuid,
705  RPC_EP_INQ_HANDLE* InquiryContext);
706  WINPR_API RPC_STATUS RpcMgmtEpEltInqDone(RPC_EP_INQ_HANDLE* InquiryContext);
707  WINPR_API RPC_STATUS RpcMgmtEpEltInqNextA(RPC_EP_INQ_HANDLE InquiryContext, RPC_IF_ID* IfId,
708  RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid,
709  RPC_CSTR* Annotation);
710  WINPR_API RPC_STATUS RpcMgmtEpEltInqNextW(RPC_EP_INQ_HANDLE InquiryContext, RPC_IF_ID* IfId,
711  RPC_BINDING_HANDLE* Binding, UUID* ObjectUuid,
712  RPC_WSTR* Annotation);
713  WINPR_API RPC_STATUS RpcMgmtEpUnregister(RPC_BINDING_HANDLE EpBinding, RPC_IF_ID* IfId,
714  RPC_BINDING_HANDLE Binding, UUID* ObjectUuid);
715  WINPR_API RPC_STATUS RpcMgmtSetAuthorizationFn(RPC_MGMT_AUTHORIZATION_FN AuthorizationFn);
716 
717  WINPR_API RPC_STATUS RpcServerInqBindingHandle(RPC_BINDING_HANDLE* Binding);
718 
719 #ifdef __cplusplus
720 }
721 #endif
722 
723 #endif
724 
725 #endif /* WINPR_RPC_H */
Definition: wtypes.h:252