1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! This module contains the DCE RPC runtime APIs.
7 use ctypes::{c_int, c_uchar, c_uint, c_ulong, c_ushort, c_void, wchar_t};
8 use shared::guiddef::GUID;
9 use shared::minwindef::DWORD;
10 use shared::rpc::{I_RPC_HANDLE, RPC_STATUS};
11 pub type RPC_CSTR = *mut c_uchar;
12 pub type RPC_WSTR = *mut wchar_t;
13 pub type RPC_CWSTR = *const wchar_t;
14 pub type RPC_BINDING_HANDLE = I_RPC_HANDLE;
15 pub type handle_t = RPC_BINDING_HANDLE;
16 pub type rpc_binding_handle_t = RPC_BINDING_HANDLE;
17 pub type UUID = GUID;
18 pub type uuid_t = UUID;
19 STRUCT!{struct RPC_BINDING_VECTOR {
20     Count: c_ulong,
21     BindingH: [RPC_BINDING_HANDLE; 1],
22 }}
23 pub type rpc_binding_vector_t = RPC_BINDING_VECTOR;
24 STRUCT!{struct UUID_VECTOR {
25     Count: c_ulong,
26     Uuid: [*mut UUID; 1],
27 }}
28 pub type uuid_vector_t = UUID_VECTOR;
29 pub type RPC_IF_HANDLE = *mut c_void;
30 STRUCT!{struct RPC_IF_ID {
31     Uuid: UUID,
32     VersMajor: c_ushort,
33     VersMinor: c_ushort,
34 }}
35 pub const RPC_C_BINDING_INFINITE_TIMEOUT: DWORD = 10;
36 pub const RPC_C_BINDING_MIN_TIMEOUT: DWORD = 0;
37 pub const RPC_C_BINDING_DEFAULT_TIMEOUT: DWORD = 5;
38 pub const RPC_C_BINDING_MAX_TIMEOUT: DWORD = 9;
39 pub const RPC_C_CANCEL_INFINITE_TIMEOUT: c_int = -1;
40 pub const RPC_C_LISTEN_MAX_CALLS_DEFAULT: DWORD = 1234;
41 pub const RPC_C_PROTSEQ_MAX_REQS_DEFAULT: DWORD = 10;
42 pub const RPC_C_BIND_TO_ALL_NICS: DWORD = 1;
43 pub const RPC_C_USE_INTERNET_PORT: DWORD = 0x1;
44 pub const RPC_C_USE_INTRANET_PORT: DWORD = 0x2;
45 pub const RPC_C_DONT_FAIL: DWORD = 0x4;
46 pub const RPC_C_RPCHTTP_USE_LOAD_BALANCE: DWORD = 0x8;
47 pub const RPC_C_MQ_TEMPORARY: DWORD = 0x0000;
48 pub const RPC_C_MQ_PERMANENT: DWORD = 0x0001;
49 pub const RPC_C_MQ_CLEAR_ON_OPEN: DWORD = 0x0002;
50 pub const RPC_C_MQ_USE_EXISTING_SECURITY: DWORD = 0x0004;
51 pub const RPC_C_MQ_AUTHN_LEVEL_NONE: DWORD = 0x0000;
52 pub const RPC_C_MQ_AUTHN_LEVEL_PKT_INTEGRITY: DWORD = 0x0008;
53 pub const RPC_C_MQ_AUTHN_LEVEL_PKT_PRIVACY: DWORD = 0x0010;
54 pub const RPC_C_OPT_MQ_DELIVERY: DWORD = 1;
55 pub const RPC_C_OPT_MQ_PRIORITY: DWORD = 2;
56 pub const RPC_C_OPT_MQ_JOURNAL: DWORD = 3;
57 pub const RPC_C_OPT_MQ_ACKNOWLEDGE: DWORD = 4;
58 pub const RPC_C_OPT_MQ_AUTHN_SERVICE: DWORD = 5;
59 pub const RPC_C_OPT_MQ_AUTHN_LEVEL: DWORD = 6;
60 pub const RPC_C_OPT_MQ_TIME_TO_REACH_QUEUE: DWORD = 7;
61 pub const RPC_C_OPT_MQ_TIME_TO_BE_RECEIVED: DWORD = 8;
62 pub const RPC_C_OPT_BINDING_NONCAUSAL: DWORD = 9;
63 pub const RPC_C_OPT_SECURITY_CALLBACK: DWORD = 10;
64 pub const RPC_C_OPT_UNIQUE_BINDING: DWORD = 11;
65 pub const RPC_C_OPT_CALL_TIMEOUT: DWORD = 12;
66 pub const RPC_C_OPT_DONT_LINGER: DWORD = 13;
67 pub const RPC_C_OPT_TRUST_PEER: DWORD = 14;
68 pub const RPC_C_OPT_ASYNC_BLOCK: DWORD = 15;
69 pub const RPC_C_OPT_OPTIMIZE_TIME: DWORD = 16;
70 pub const RPC_C_OPT_MAX_OPTIONS: DWORD = 17;
71 pub const RPC_C_MQ_EXPRESS: DWORD = 0;
72 pub const RPC_C_MQ_RECOVERABLE: DWORD = 1;
73 pub const RPC_C_MQ_JOURNAL_NONE: DWORD = 0;
74 pub const RPC_C_MQ_JOURNAL_DEADLETTER: DWORD = 1;
75 pub const RPC_C_MQ_JOURNAL_ALWAYS: DWORD = 2;
76 pub const RPC_C_FULL_CERT_CHAIN: DWORD = 0x0001;
77 STRUCT!{struct RPC_PROTSEQ_VECTORA {
78     Count: c_uint,
79     Protseq: [*mut c_uchar; 1],
80 }}
81 STRUCT!{struct RPC_PROTSEQ_VECTORW {
82     Count: c_uint,
83     Protseq: [*mut c_ushort; 1],
84 }}
85 STRUCT!{struct RPC_POLICY {
86     Length: c_uint,
87     EndpointFlags: c_ulong,
88     NICFlags: c_ulong,
89 }}
90 pub type PRPC_POLICY = *mut RPC_POLICY;
91 FN!{stdcall RPC_OBJECT_INQ_FN(
92     ObjectUuid: *mut UUID,
93     TypeUuid: *mut UUID,
94     Status: *mut RPC_STATUS,
95 ) -> ()}
96 FN!{stdcall RPC_IF_CALLBACK_FN(
97     InterfaceUuid: RPC_IF_HANDLE,
98     Context: *mut c_void,
99 ) -> RPC_STATUS}
100 FN!{stdcall RPC_SECURITY_CALLBACK_FN(
101     Context: *mut c_void,
102 ) -> ()}
103 pub type RPC_MGR_EPV = c_void;
104 STRUCT!{struct RPC_STATS_VECTOR {
105     Count: c_uint,
106     Stats: [c_ulong; 1],
107 }}
108 pub const RPC_C_STATS_CALLS_IN: c_ulong = 0;
109 pub const RPC_C_STATS_CALLS_OUT: c_ulong = 1;
110 pub const RPC_C_STATS_PKTS_IN: c_ulong = 2;
111 pub const RPC_C_STATS_PKTS_OUT: c_ulong = 3;
112 STRUCT!{struct RPC_IF_ID_VECTOR {
113     Count: c_ulong,
114     IfId: [*mut RPC_IF_ID; 1],
115 }}
116 pub type RPC_AUTH_IDENTITY_HANDLE = *mut c_void;
117 pub type RPC_AUTHZ_HANDLE = *mut c_void;
118 pub const RPC_C_AUTHN_LEVEL_DEFAULT: DWORD = 0;
119 pub const RPC_C_AUTHN_LEVEL_NONE: DWORD = 1;
120 pub const RPC_C_AUTHN_LEVEL_CONNECT: DWORD = 2;
121 pub const RPC_C_AUTHN_LEVEL_CALL: DWORD = 3;
122 pub const RPC_C_AUTHN_LEVEL_PKT: DWORD = 4;
123 pub const RPC_C_AUTHN_LEVEL_PKT_INTEGRITY: DWORD = 5;
124 pub const RPC_C_AUTHN_LEVEL_PKT_PRIVACY: DWORD = 6;
125 pub const RPC_C_IMP_LEVEL_DEFAULT: DWORD = 0;
126 pub const RPC_C_IMP_LEVEL_ANONYMOUS: DWORD = 1;
127 pub const RPC_C_IMP_LEVEL_IDENTIFY: DWORD = 2;
128 pub const RPC_C_IMP_LEVEL_IMPERSONATE: DWORD = 3;
129 pub const RPC_C_IMP_LEVEL_DELEGATE: DWORD = 4;
130 pub const RPC_C_QOS_IDENTITY_STATIC: DWORD = 0;
131 pub const RPC_C_QOS_IDENTITY_DYNAMIC: DWORD = 1;
132 pub const RPC_C_QOS_CAPABILITIES_DEFAULT: DWORD = 0x0;
133 pub const RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH: DWORD = 0x1;
134 pub const RPC_C_QOS_CAPABILITIES_MAKE_FULLSIC: DWORD = 0x2;
135 pub const RPC_C_QOS_CAPABILITIES_ANY_AUTHORITY: DWORD = 0x4;
136 pub const RPC_C_QOS_CAPABILITIES_IGNORE_DELEGATE_FAILURE: DWORD = 0x8;
137 pub const RPC_C_QOS_CAPABILITIES_LOCAL_MA_HINT: DWORD = 0x10;
138 pub const RPC_C_QOS_CAPABILITIES_SCHANNEL_FULL_AUTH_IDENTITY: DWORD = 0x20;
139 pub const RPC_C_PROTECT_LEVEL_DEFAULT: DWORD = RPC_C_AUTHN_LEVEL_DEFAULT;
140 pub const RPC_C_PROTECT_LEVEL_NONE: DWORD = RPC_C_AUTHN_LEVEL_NONE;
141 pub const RPC_C_PROTECT_LEVEL_CONNECT: DWORD = RPC_C_AUTHN_LEVEL_CONNECT;
142 pub const RPC_C_PROTECT_LEVEL_CALL: DWORD = RPC_C_AUTHN_LEVEL_CALL;
143 pub const RPC_C_PROTECT_LEVEL_PKT: DWORD = RPC_C_AUTHN_LEVEL_PKT;
144 pub const RPC_C_PROTECT_LEVEL_PKT_INTEGRITY: DWORD = RPC_C_AUTHN_LEVEL_PKT_INTEGRITY;
145 pub const RPC_C_PROTECT_LEVEL_PKT_PRIVACY: DWORD = RPC_C_AUTHN_LEVEL_PKT_PRIVACY;
146 pub const RPC_C_AUTHN_NONE: DWORD = 0;
147 pub const RPC_C_AUTHN_DCE_PRIVATE: DWORD = 1;
148 pub const RPC_C_AUTHN_DCE_PUBLIC: DWORD = 2;
149 pub const RPC_C_AUTHN_DEC_PUBLIC: DWORD = 4;
150 pub const RPC_C_AUTHN_GSS_NEGOTIATE: DWORD = 9;
151 pub const RPC_C_AUTHN_WINNT: DWORD = 10;
152 pub const RPC_C_AUTHN_GSS_SCHANNEL: DWORD = 14;
153 pub const RPC_C_AUTHN_GSS_KERBEROS: DWORD = 16;
154 pub const RPC_C_AUTHN_DPA: DWORD = 17;
155 pub const RPC_C_AUTHN_MSN: DWORD = 18;
156 pub const RPC_C_AUTHN_DIGEST: DWORD = 21;
157 pub const RPC_C_AUTHN_KERNEL: DWORD = 20;
158 pub const RPC_C_AUTHN_NEGO_EXTENDER: DWORD = 30;
159 pub const RPC_C_AUTHN_PKU2U: DWORD = 31;
160 pub const RPC_C_AUTHN_LIVE_SSP: DWORD = 32;
161 pub const RPC_C_AUTHN_LIVEXP_SSP: DWORD = 35;
162 pub const RPC_C_AUTHN_MSONLINE: DWORD = 82;
163 pub const RPC_C_AUTHN_MQ: DWORD = 100;
164 pub const RPC_C_AUTHN_DEFAULT: DWORD = 0xFFFFFFFF;
165 pub const RPC_C_NO_CREDENTIALS: DWORD = 0xFFFFFFFF;
166 pub const RPC_C_SECURITY_QOS_VERSION: DWORD = 1;
167 pub const RPC_C_SECURITY_QOS_VERSION_1: DWORD = 1;
168 STRUCT!{struct RPC_SECURITY_QOS {
169     Version: c_ulong,
170     Capabilities: c_ulong,
171     IdentityTracking: c_ulong,
172     ImpersonationType: c_ulong,
173 }}
174 pub type PRPC_SECURITY_QOS = *mut RPC_SECURITY_QOS;
175 STRUCT!{struct SEC_WINNT_AUTH_IDENTITY_W {
176     User: *mut c_ushort,
177     UserLength: c_ulong,
178     Domain: *mut c_ushort,
179     DomainLength: c_ulong,
180     Password: *mut c_ushort,
181     PasswordLength: c_ulong,
182     Flags: c_ulong,
183 }}
184 pub type PSEC_WINNT_AUTH_IDENTITY_W = *mut SEC_WINNT_AUTH_IDENTITY_W;
185 STRUCT!{struct SEC_WINNT_AUTH_IDENTITY_A {
186     User: *mut c_uchar,
187     UserLength: c_ulong,
188     Domain: *mut c_uchar,
189     DomainLength: c_ulong,
190     Password: *mut c_uchar,
191     PasswordLength: c_ulong,
192     Flags: c_ulong,
193 }}
194 pub type PSEC_WINNT_AUTH_IDENTITY_A = *mut SEC_WINNT_AUTH_IDENTITY_A;
195 pub const RPC_C_AUTHN_INFO_TYPE_HTTP: c_ulong = 1;
196 pub const RPC_C_HTTP_AUTHN_TARGET_SERVER: c_ulong = 1;
197 pub const RPC_C_HTTP_AUTHN_TARGET_PROXY: c_ulong = 2;
198 pub const RPC_C_HTTP_AUTHN_SCHEME_BASIC: c_ulong = 0x00000001;
199 pub const RPC_C_HTTP_AUTHN_SCHEME_NTLM: c_ulong = 0x00000002;
200 pub const RPC_C_HTTP_AUTHN_SCHEME_PASSPORT: c_ulong = 0x00000004;
201 pub const RPC_C_HTTP_AUTHN_SCHEME_DIGEST: c_ulong = 0x00000008;
202 pub const RPC_C_HTTP_AUTHN_SCHEME_NEGOTIATE: c_ulong = 0x00000010;
203 pub const RPC_C_HTTP_AUTHN_SCHEME_CERT: c_ulong = 0x00010000;
204 pub const RPC_C_HTTP_FLAG_USE_SSL: c_ulong = 1;
205 pub const RPC_C_HTTP_FLAG_USE_FIRST_AUTH_SCHEME: c_ulong = 2;
206 pub const RPC_C_HTTP_FLAG_IGNORE_CERT_CN_INVALID: c_ulong = 8;
207 pub const RPC_C_HTTP_FLAG_ENABLE_CERT_REVOCATION_CHECK: c_ulong = 16;
208 STRUCT!{struct RPC_HTTP_TRANSPORT_CREDENTIALS_W {
209     TransportCredentials: *mut SEC_WINNT_AUTH_IDENTITY_W,
210     Flags: c_ulong,
211     AuthenticationTarget: c_ulong,
212     NumberOfAuthnSchemes: c_ulong,
213     AuthnSchemes: *mut c_ulong,
214     ServerCertificateSubject: *mut c_ushort,
215 }}
216 pub type PRPC_HTTP_TRANSPORT_CREDENTIALS_W = *mut RPC_HTTP_TRANSPORT_CREDENTIALS_W;
217 STRUCT!{struct RPC_HTTP_TRANSPORT_CREDENTIALS_A {
218     TransportCredentials: *mut SEC_WINNT_AUTH_IDENTITY_A,
219     Flags: c_ulong,
220     AuthenticationTarget: c_ulong,
221     NumberOfAuthnSchemes: c_ulong,
222     AuthnSchemes: *mut c_ulong,
223     ServerCertificateSubject: *mut c_uchar,
224 }}
225 pub type PRPC_HTTP_TRANSPORT_CREDENTIALS_A = *mut RPC_HTTP_TRANSPORT_CREDENTIALS_A;
226 STRUCT!{struct RPC_HTTP_TRANSPORT_CREDENTIALS_V2_W {
227     TransportCredentials: *mut SEC_WINNT_AUTH_IDENTITY_W,
228     Flags: c_ulong,
229     AuthenticationTarget: c_ulong,
230     NumberOfAuthnSchemes: c_ulong,
231     AuthnSchemes: *mut c_ulong,
232     ServerCertificateSubject: *mut c_ushort,
233     ProxyCredentials: *mut SEC_WINNT_AUTH_IDENTITY_W,
234     NumberOfProxyAuthnSchemes: c_ulong,
235     ProxyAuthnSchemes: *mut c_ulong,
236 }}
237 pub type PRPC_HTTP_TRANSPORT_CREDENTIALS_V2_W = *mut RPC_HTTP_TRANSPORT_CREDENTIALS_V2_W;
238 STRUCT!{struct RPC_HTTP_TRANSPORT_CREDENTIALS_V2_A {
239     TransportCredentials: *mut SEC_WINNT_AUTH_IDENTITY_A,
240     Flags: c_ulong,
241     AuthenticationTarget: c_ulong,
242     NumberOfAuthnSchemes: c_ulong,
243     AuthnSchemes: *mut c_ulong,
244     ServerCertificateSubject: *mut c_uchar,
245     ProxyCredentials: *mut SEC_WINNT_AUTH_IDENTITY_A,
246     NumberOfProxyAuthnSchemes: c_ulong,
247     ProxyAuthnSchemes: *mut c_ulong,
248 }}
249 pub type PRPC_HTTP_TRANSPORT_CREDENTIALS_V2_A = *mut RPC_HTTP_TRANSPORT_CREDENTIALS_V2_A;
250 STRUCT!{struct RPC_HTTP_TRANSPORT_CREDENTIALS_V3_W {
251     TransportCredentials: RPC_AUTH_IDENTITY_HANDLE,
252     Flags: c_ulong,
253     AuthenticationTarget: c_ulong,
254     NumberOfAuthnSchemes: c_ulong,
255     AuthnSchemes: *mut c_ulong,
256     ServerCertificateSubject: *mut c_ushort,
257     ProxyCredentials: *mut RPC_AUTH_IDENTITY_HANDLE,
258     NumberOfProxyAuthnSchemes: c_ulong,
259     ProxyAuthnSchemes: *mut c_ulong,
260 }}
261 pub type PRPC_HTTP_TRANSPORT_CREDENTIALS_V3_W = *mut RPC_HTTP_TRANSPORT_CREDENTIALS_V3_W;
262 STRUCT!{struct RPC_HTTP_TRANSPORT_CREDENTIALS_V3_A {
263     TransportCredentials: RPC_AUTH_IDENTITY_HANDLE,
264     Flags: c_ulong,
265     AuthenticationTarget: c_ulong,
266     NumberOfAuthnSchemes: c_ulong,
267     AuthnSchemes: *mut c_ulong,
268     ServerCertificateSubject: *mut c_uchar,
269     ProxyCredentials: *mut RPC_AUTH_IDENTITY_HANDLE,
270     NumberOfProxyAuthnSchemes: c_ulong,
271     ProxyAuthnSchemes: *mut c_ulong,
272 }}
273 pub type PRPC_HTTP_TRANSPORT_CREDENTIALS_V3_A = *mut RPC_HTTP_TRANSPORT_CREDENTIALS_V3_A;
274 STRUCT!{struct RPC_SECURITY_QOS_V2_W_union {
275     HttpCredentials: *mut RPC_HTTP_TRANSPORT_CREDENTIALS_W,
276 }}
277 STRUCT!{struct RPC_SECURITY_QOS_V2_W {
278     Version: c_ulong,
279     Capabilities: c_ulong,
280     IdentityTracking: c_ulong,
281     ImpersonationType: c_ulong,
282     AdditionalSecurityInfoType: c_ulong,
283     u: RPC_SECURITY_QOS_V2_W_union,
284 }}
285 pub type PRPC_SECURITY_QOS_V2_W = *mut RPC_SECURITY_QOS_V2_W;
286 STRUCT!{struct RPC_SECURITY_QOS_V2_A_union {
287     HttpCredentials: *mut RPC_HTTP_TRANSPORT_CREDENTIALS_A,
288 }}
289 STRUCT!{struct RPC_SECURITY_QOS_V2_A {
290     Version: c_ulong,
291     Capabilities: c_ulong,
292     IdentityTracking: c_ulong,
293     ImpersonationType: c_ulong,
294     AdditionalSecurityInfoType: c_ulong,
295     u: RPC_SECURITY_QOS_V2_A_union,
296 }}
297 pub type PRPC_SECURITY_QOS_V2_A = *mut RPC_SECURITY_QOS_V2_A;
298 STRUCT!{struct RPC_SECURITY_QOS_V3_W_union {
299     HttpCredentials: *mut RPC_HTTP_TRANSPORT_CREDENTIALS_W,
300 }}
301 STRUCT!{struct RPC_SECURITY_QOS_V3_W {
302     Version: c_ulong,
303     Capabilities: c_ulong,
304     IdentityTracking: c_ulong,
305     ImpersonationType: c_ulong,
306     AdditionalSecurityInfoType: c_ulong,
307     u: RPC_SECURITY_QOS_V3_W_union,
308     Sid: *mut c_void,
309 }}
310 pub type PRPC_SECURITY_QOS_V3_W = *mut RPC_SECURITY_QOS_V3_W;
311 STRUCT!{struct RPC_SECURITY_QOS_V3_A_union {
312     HttpCredentials: *mut RPC_HTTP_TRANSPORT_CREDENTIALS_A,
313 }}
314 STRUCT!{struct RPC_SECURITY_QOS_V3_A {
315     Version: c_ulong,
316     Capabilities: c_ulong,
317     IdentityTracking: c_ulong,
318     ImpersonationType: c_ulong,
319     AdditionalSecurityInfoType: c_ulong,
320     u: RPC_SECURITY_QOS_V3_A_union,
321     Sid: *mut c_void,
322 }}
323 pub type PRPC_SECURITY_QOS_V3_A = *mut RPC_SECURITY_QOS_V3_A;
324 STRUCT!{struct RPC_SECURITY_QOS_V4_W_union {
325     HttpCredentials: *mut RPC_HTTP_TRANSPORT_CREDENTIALS_W,
326 }}
327 STRUCT!{struct RPC_SECURITY_QOS_V4_W {
328     Version: c_ulong,
329     Capabilities: c_ulong,
330     IdentityTracking: c_ulong,
331     ImpersonationType: c_ulong,
332     AdditionalSecurityInfoType: c_ulong,
333     u: RPC_SECURITY_QOS_V4_W_union,
334     Sid: *mut c_void,
335     EffectiveOnly: c_uint,
336 }}
337 pub type PRPC_SECURITY_QOS_V4_W = *mut RPC_SECURITY_QOS_V4_W;
338 STRUCT!{struct RPC_SECURITY_QOS_V4_A_union {
339     HttpCredentials: *mut RPC_HTTP_TRANSPORT_CREDENTIALS_A,
340 }}
341 STRUCT!{struct RPC_SECURITY_QOS_V4_A {
342     Version: c_ulong,
343     Capabilities: c_ulong,
344     IdentityTracking: c_ulong,
345     ImpersonationType: c_ulong,
346     AdditionalSecurityInfoType: c_ulong,
347     u: RPC_SECURITY_QOS_V4_A_union,
348     Sid: *mut c_void,
349     EffectiveOnly: c_uint,
350 }}
351 pub type PRPC_SECURITY_QOS_V4_A = *mut RPC_SECURITY_QOS_V4_A;
352 STRUCT!{struct RPC_SECURITY_QOS_V5_W_union {
353     HttpCredentials: *mut RPC_HTTP_TRANSPORT_CREDENTIALS_W,
354 }}
355 STRUCT!{struct RPC_SECURITY_QOS_V5_W {
356     Version: c_ulong,
357     Capabilities: c_ulong,
358     IdentityTracking: c_ulong,
359     ImpersonationType: c_ulong,
360     AdditionalSecurityInfoType: c_ulong,
361     u: RPC_SECURITY_QOS_V5_W_union,
362     Sid: *mut c_void,
363     EffectiveOnly: c_uint,
364     ServerSecurityDescriptor: *mut c_void,
365 }}
366 pub type PRPC_SECURITY_QOS_V5_W = *mut RPC_SECURITY_QOS_V5_W;
367 STRUCT!{struct RPC_SECURITY_QOS_V5_A_union {
368     HttpCredentials: *mut RPC_HTTP_TRANSPORT_CREDENTIALS_A,
369 }}
370 STRUCT!{struct RPC_SECURITY_QOS_V5_A {
371     Version: c_ulong,
372     Capabilities: c_ulong,
373     IdentityTracking: c_ulong,
374     ImpersonationType: c_ulong,
375     AdditionalSecurityInfoType: c_ulong,
376     u: RPC_SECURITY_QOS_V5_A_union,
377     Sid: *mut c_void,
378     EffectiveOnly: c_uint,
379     ServerSecurityDescriptor: *mut c_void,
380 }}
381 pub type PRPC_SECURITY_QOS_V5_A = *mut RPC_SECURITY_QOS_V5_A;
382 pub const RPC_PROTSEQ_TCP: c_ulong = 0x1;
383 pub const RPC_PROTSEQ_NMP: c_ulong = 0x2;
384 pub const RPC_PROTSEQ_LRPC: c_ulong = 0x3;
385 pub const RPC_PROTSEQ_HTTP: c_ulong = 0x4;
386 pub const RPC_BHT_OBJECT_UUID_VALID: c_ulong = 0x1;
387 pub const RPC_BHO_NONCAUSAL: c_ulong = 0x1;
388 pub const RPC_BHO_DONTLINGER: c_ulong = 0x2;
389 pub const RPC_BHO_EXCLUSIVE_AND_GUARANTEED: c_ulong = 0x4;
390 STRUCT!{struct RPC_BINDING_HANDLE_TEMPLATE_V1_W_union {
391     Reserved: *mut c_ushort,
392 }}
393 STRUCT!{struct RPC_BINDING_HANDLE_TEMPLATE_V1_W {
394     Version: c_ulong,
395     Flags: c_ulong,
396     ProtocolSequence: c_ulong,
397     NetworkAddress: *mut c_ushort,
398     StringEndpoint: *mut c_ushort,
399     u1: RPC_BINDING_HANDLE_TEMPLATE_V1_W_union,
400     ObjectUuid: UUID,
401 }}
402 pub type PRPC_BINDING_HANDLE_TEMPLATE_V1_W = *mut RPC_BINDING_HANDLE_TEMPLATE_V1_W;
403 STRUCT!{struct RPC_BINDING_HANDLE_TEMPLATE_V1_A_union {
404     Reserved: *mut c_uchar,
405 }}
406 STRUCT!{struct RPC_BINDING_HANDLE_TEMPLATE_V1_A {
407     Version: c_ulong,
408     Flags: c_ulong,
409     ProtocolSequence: c_ulong,
410     NetworkAddress: *mut c_uchar,
411     StringEndpoint: *mut c_uchar,
412     u1: RPC_BINDING_HANDLE_TEMPLATE_V1_A_union,
413     ObjectUuid: UUID,
414 }}
415 pub type PRPC_BINDING_HANDLE_TEMPLATE_V1_A = *mut RPC_BINDING_HANDLE_TEMPLATE_V1_A;
416 STRUCT!{struct RPC_BINDING_HANDLE_SECURITY_V1_W {
417     Version: c_ulong,
418     ServerPrincName: *mut c_ushort,
419     AuthnLevel: c_ulong,
420     AuthnSvc: c_ulong,
421     AuthIdentity: *mut SEC_WINNT_AUTH_IDENTITY_W,
422     SecurityQos: *mut RPC_SECURITY_QOS,
423 }}
424 pub type PRPC_BINDING_HANDLE_SECURITY_V1_W = *mut RPC_BINDING_HANDLE_SECURITY_V1_W;
425 STRUCT!{struct RPC_BINDING_HANDLE_SECURITY_V1_A {
426     Version: c_ulong,
427     ServerPrincName: *mut c_uchar,
428     AuthnLevel: c_ulong,
429     AuthnSvc: c_ulong,
430     AuthIdentity: *mut SEC_WINNT_AUTH_IDENTITY_A,
431     SecurityQos: *mut RPC_SECURITY_QOS,
432 }}
433 pub type PRPC_BINDING_HANDLE_SECURITY_V1_A = *mut RPC_BINDING_HANDLE_SECURITY_V1_A;
434 STRUCT!{struct RPC_BINDING_HANDLE_OPTIONS_V1 {
435     Version: c_ulong,
436     Flags: c_ulong,
437     ComTimeout: c_ulong,
438     CallTimeout: c_ulong,
439 }}
440 pub type PRPC_BINDING_HANDLE_OPTIONS_V1 = *mut RPC_BINDING_HANDLE_OPTIONS_V1;
441 ENUM!{enum RPC_HTTP_REDIRECTOR_STAGE {
442     RPCHTTP_RS_REDIRECT = 1,
443     RPCHTTP_RS_ACCESS_1,
444     RPCHTTP_RS_SESSION,
445     RPCHTTP_RS_ACCESS_2,
446     RPCHTTP_RS_INTERFACE,
447 }}
448 FN!{stdcall RPC_NEW_HTTP_PROXY_CHANNEL(
449     RedirectorStage: RPC_HTTP_REDIRECTOR_STAGE,
450     ServerName: RPC_WSTR,
451     ServerPort: RPC_WSTR,
452     RemoteUser: RPC_WSTR,
453     AuthType: RPC_WSTR,
454     ResourceUuid: *mut c_void,
455     SessionId: *mut c_void,
456     Interface: *mut c_void,
457     Reserved: *mut c_void,
458     Flags: c_ulong,
459     NewServerName: *mut RPC_WSTR,
460     NewServerPort: *mut RPC_WSTR,
461 ) -> RPC_STATUS}
462 FN!{stdcall RPC_HTTP_PROXY_FREE_STRING(
463     String: RPC_WSTR,
464 ) -> ()}
465 pub const RPC_C_AUTHZ_NONE: DWORD = 0;
466 pub const RPC_C_AUTHZ_NAME: DWORD = 1;
467 pub const RPC_C_AUTHZ_DCE: DWORD = 2;
468 pub const RPC_C_AUTHZ_DEFAULT: DWORD = 0xffffffff;
469 FN!{stdcall RPC_AUTH_KEY_RETRIEVAL_FN(
470     Arg: *mut c_void,
471     ServerPrincName: RPC_WSTR,
472     KeyVer: c_ulong,
473     Key: *mut *mut c_void,
474     Status: *mut RPC_STATUS,
475 ) -> ()}
476 STRUCT!{struct RPC_CLIENT_INFORMATION1 {
477     UserName: *mut c_uchar,
478     ComputerName: *mut c_uchar,
479     Privilege: c_ushort,
480     AuthFlags: c_ulong,
481 }}
482 pub type PRPC_CLIENT_INFORMATION1 = *mut RPC_CLIENT_INFORMATION1;
483 pub type RPC_EP_INQ_HANDLE = *mut I_RPC_HANDLE;
484 pub const RPC_C_EP_ALL_ELTS: c_ulong = 0;
485 pub const RPC_C_EP_MATCH_BY_IF: c_ulong = 1;
486 pub const RPC_C_EP_MATCH_BY_OBJ: c_ulong = 2;
487 pub const RPC_C_EP_MATCH_BY_BOTH: c_ulong = 3;
488 pub const RPC_C_VERS_ALL: c_ulong = 1;
489 pub const RPC_C_VERS_COMPATIBLE: c_ulong = 2;
490 pub const RPC_C_VERS_EXACT: c_ulong = 3;
491 pub const RPC_C_VERS_MAJOR_ONLY: c_ulong = 4;
492 pub const RPC_C_VERS_UPTO: c_ulong = 5;
493 FN!{stdcall RPC_MGMT_AUTHORIZATION_FN(
494     ClientBinding: RPC_BINDING_HANDLE,
495     RequestedMgmtOperation: c_ulong,
496     Status: *mut RPC_STATUS,
497 ) -> c_int}
498 pub const RPC_C_MGMT_INQ_IF_IDS: c_ulong = 0;
499 pub const RPC_C_MGMT_INQ_PRINC_NAME: c_ulong = 1;
500 pub const RPC_C_MGMT_INQ_STATS: c_ulong = 2;
501 pub const RPC_C_MGMT_IS_SERVER_LISTEN: c_ulong = 3;
502 pub const RPC_C_MGMT_STOP_SERVER_LISTEN: c_ulong = 4;
503 pub const RPC_IF_AUTOLISTEN: c_uint = 0x0001;
504 pub const RPC_IF_OLE: c_uint = 0x0002;
505 pub const RPC_IF_ALLOW_UNKNOWN_AUTHORITY: c_uint = 0x0004;
506 pub const RPC_IF_ALLOW_SECURE_ONLY: c_uint = 0x0008;
507 pub const RPC_IF_ALLOW_CALLBACKS_WITH_NO_AUTH: c_uint = 0x0010;
508 pub const RPC_IF_ALLOW_LOCAL_ONLY: c_uint = 0x0020;
509 pub const RPC_IF_SEC_NO_CACHE: c_uint = 0x0040;
510 pub const RPC_IF_SEC_CACHE_PER_PROC: c_uint = 0x0080;
511 pub const RPC_IF_ASYNC_CALLBACK: c_uint = 0x0100;
512 pub const RPC_FW_IF_FLAG_DCOM: c_uint = 0x0001;
513 pub type RPC_INTERFACE_GROUP = *mut c_void;
514 pub type PRPC_INTERFACE_GROUP = *mut *mut c_void;
515 STRUCT!{struct RPC_ENDPOINT_TEMPLATEW {
516     Version: c_ulong,
517     ProtSeq: RPC_WSTR,
518     Endpoint: RPC_WSTR,
519     SecurityDescriptor: *mut c_void,
520     Backlog: c_ulong,
521 }}
522 pub type PRPC_ENDPOINT_TEMPLATEW = *mut RPC_ENDPOINT_TEMPLATEW;
523 STRUCT!{struct RPC_ENDPOINT_TEMPLATEA {
524     Version: c_ulong,
525     ProtSeq: RPC_CSTR,
526     Endpoint: RPC_CSTR,
527     SecurityDescriptor: *mut c_void,
528     Backlog: c_ulong,
529 }}
530 pub type PRPC_ENDPOINT_TEMPLATEA = *mut RPC_ENDPOINT_TEMPLATEA;
531 STRUCT!{struct RPC_INTERFACE_TEMPLATEA {
532     Version: c_ulong,
533     IfSpec: RPC_IF_HANDLE,
534     MgrTypeUuid: *mut UUID,
535     MgrEpv: *mut RPC_MGR_EPV,
536     Flags: c_uint,
537     MaxCalls: c_uint,
538     MaxRpcSize: c_uint,
539     IfCallback: *mut RPC_IF_CALLBACK_FN,
540     UuidVector: *mut UUID_VECTOR,
541     Annotation: RPC_CSTR,
542     SecurityDescriptor: *mut c_void,
543 }}
544 pub type PRPC_INTERFACE_TEMPLATEA = *mut RPC_INTERFACE_TEMPLATEA;
545 STRUCT!{struct RPC_INTERFACE_TEMPLATEW {
546     Version: c_ulong,
547     IfSpec: RPC_IF_HANDLE,
548     MgrTypeUuid: *mut UUID,
549     MgrEpv: *mut RPC_MGR_EPV,
550     Flags: c_uint,
551     MaxCalls: c_uint,
552     MaxRpcSize: c_uint,
553     IfCallback: *mut RPC_IF_CALLBACK_FN,
554     UuidVector: *mut UUID_VECTOR,
555     Annotation: RPC_WSTR,
556     SecurityDescriptor: *mut c_void,
557 }}
558 pub type PRPC_INTERFACE_TEMPLATEW = *mut RPC_INTERFACE_TEMPLATEW;
559 FN!{stdcall RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN(
560     IfGroup: RPC_INTERFACE_GROUP,
561     IdleCallbackContext: *mut c_void,
562     IsGroupIdle: c_ulong,
563 ) -> ()}
564