2 * Copyright (C) 2000 Francois Gouget
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_RPCDCE_H
20 #define __WINE_RPCDCE_H
45 typedef unsigned char* RPC_CSTR;
46 typedef unsigned short* RPC_WSTR;
47 typedef void* RPC_AUTH_IDENTITY_HANDLE;
48 typedef void* RPC_AUTHZ_HANDLE;
49 typedef void* RPC_IF_HANDLE;
50 typedef I_RPC_HANDLE RPC_BINDING_HANDLE;
51 typedef RPC_BINDING_HANDLE handle_t;
52 #define rpc_binding_handle_t RPC_BINDING_HANDLE
53 #define RPC_MGR_EPV void
55 typedef struct _RPC_BINDING_VECTOR
58 RPC_BINDING_HANDLE BindingH[1];
60 #define rpc_binding_vector_t RPC_BINDING_VECTOR
62 typedef struct _UUID_VECTOR
67 #define uuid_vector_t UUID_VECTOR
69 typedef struct _RPC_IF_ID
72 unsigned short VersMajor;
73 unsigned short VersMinor;
82 typedef I_RPC_HANDLE *RPC_EP_INQ_HANDLE;
84 #define RPC_C_EP_ALL_ELTS 0
85 #define RPC_C_EP_MATCH_BY_IF 1
86 #define RPC_C_EP_MATCH_BY_OBJ 2
87 #define RPC_C_EP_MATCH_BY_BOTH 3
89 #define RPC_C_VERS_ALL 1
90 #define RPC_C_VERS_COMPATIBLE 2
91 #define RPC_C_VERS_EXACT 3
92 #define RPC_C_VERS_MAJOR_ONLY 4
93 #define RPC_C_VERS_UPTO 5
95 #define RPC_C_BINDING_INFINITE_TIMEOUT 10
96 #define RPC_C_BINDING_MIN_TIMEOUT 0
97 #define RPC_C_BINDING_DEFAULT_TIMEOUT 5
98 #define RPC_C_BINDING_MAX_TIMEOUT 9
100 #define RPC_C_CANCEL_INFINITE_TIMEOUT -1
102 #define RPC_C_LISTEN_MAX_CALLS_DEFAULT 1234
103 #define RPC_C_PROTSEQ_MAX_REQS_DEFAULT 10
105 /* RPC_POLICY EndpointFlags */
106 #define RPC_C_BIND_TO_ALL_NICS 0x1
107 #define RPC_C_USE_INTERNET_PORT 0x1
108 #define RPC_C_USE_INTRANET_PORT 0x2
109 #define RPC_C_DONT_FAIL 0x4
111 /* RPC_POLICY EndpointFlags specific to the Falcon/RPC transport */
112 #define RPC_C_MQ_TEMPORARY 0x0000
113 #define RPC_C_MQ_PERMANENT 0x0001
114 #define RPC_C_MQ_CLEAR_ON_OPEN 0x0002
115 #define RPC_C_MQ_USE_EXISTING_SECURITY 0x0004
116 #define RPC_C_MQ_AUTHN_LEVEL_NONE 0x0000
117 #define RPC_C_MQ_AUTHN_LEVEL_PKT_INTEGRITY 0x0008
118 #define RPC_C_MQ_AUTHN_LEVEL_PKT_PRIVACY 0x0010
120 #define RPC_C_AUTHN_LEVEL_DEFAULT 0
121 #define RPC_C_AUTHN_LEVEL_NONE 1
122 #define RPC_C_AUTHN_LEVEL_CONNECT 2
123 #define RPC_C_AUTHN_LEVEL_CALL 3
124 #define RPC_C_AUTHN_LEVEL_PKT 4
125 #define RPC_C_AUTHN_LEVEL_PKT_INTEGRITY 5
126 #define RPC_C_AUTHN_LEVEL_PKT_PRIVACY 6
128 #define RPC_C_AUTHN_NONE 0
129 #define RPC_C_AUTHN_DCE_PRIVATE 1
130 #define RPC_C_AUTHN_DCE_PUBLIC 2
131 #define RPC_C_AUTHN_DEC_PUBLIC 4
132 #define RPC_C_AUTHN_GSS_NEGOTIATE 9
133 #define RPC_C_AUTHN_WINNT 10
134 #define RPC_C_AUTHN_GSS_SCHANNEL 14
135 #define RPC_C_AUTHN_GSS_KERBEROS 16
136 #define RPC_C_AUTHN_DPA 17
137 #define RPC_C_AUTHN_MSN 18
138 #define RPC_C_AUTHN_DIGEST 21
139 #define RPC_C_AUTHN_MQ 100
140 #define RPC_C_AUTHN_DEFAULT 0xffffffff
142 typedef RPC_STATUS RPC_ENTRY RPC_IF_CALLBACK_FN( RPC_IF_HANDLE InterfaceUuid, void *Context );
143 typedef void (__RPC_USER *RPC_AUTH_KEY_RETRIEVAL_FN)();
145 typedef struct _RPC_POLICY
148 unsigned long EndpointFlags;
149 unsigned long NICFlags;
150 } RPC_POLICY, *PRPC_POLICY;
152 typedef struct _SEC_WINNT_AUTH_IDENTITY_W
154 unsigned short* User;
155 unsigned long UserLength;
156 unsigned short* Domain;
157 unsigned long DomainLength;
158 unsigned short* Password;
159 unsigned long PasswordLength;
161 } SEC_WINNT_AUTH_IDENTITY_W, *PSEC_WINNT_AUTH_IDENTITY_W;
163 typedef struct _SEC_WINNT_AUTH_IDENTITY_A
166 unsigned long UserLength;
167 unsigned char* Domain;
168 unsigned long DomainLength;
169 unsigned char* Password;
170 unsigned long PasswordLength;
172 } SEC_WINNT_AUTH_IDENTITY_A, *PSEC_WINNT_AUTH_IDENTITY_A;
174 typedef struct _RPC_SECURITY_QOS {
175 unsigned long Version;
176 unsigned long Capabilities;
177 unsigned long IdentityTracking;
178 unsigned long ImpersonationType;
179 } RPC_SECURITY_QOS, *PRPC_SECURITY_QOS;
181 #define _SEC_WINNT_AUTH_IDENTITY WINELIB_NAME_AW(_SEC_WINNT_AUTH_IDENTITY_)
182 #define SEC_WINNT_AUTH_IDENTITY WINELIB_NAME_AW(SEC_WINNT_AUTH_IDENTITY_)
183 #define PSEC_WINNT_AUTH_IDENTITY WINELIB_NAME_AW(PSEC_WINNT_AUTH_IDENTITY_)
185 /* SEC_WINNT_AUTH Flags */
186 #define SEC_WINNT_AUTH_IDENTITY_ANSI 0x1
187 #define SEC_WINNT_AUTH_IDENTITY_UNICODE 0x2
189 /* RpcServerRegisterIfEx Flags */
190 #define RPC_IF_AUTOLISTEN 0x1
191 #define RPC_IF_OLE 0x2
192 #define RPC_IF_ALLOW_UNKNOWN_AUTHORITY 0x4
193 #define RPC_IF_ALLOW_SECURE_ONLY 0x8
195 RPC_STATUS RPC_ENTRY DceErrorInqTextA(RPC_STATUS e, RPC_CSTR buffer);
196 RPC_STATUS RPC_ENTRY DceErrorInqTextW(RPC_STATUS e, RPC_WSTR buffer);
197 #define DceErrorInqText WINELIB_NAME_AW(DceErrorInqText)
199 RPCRTAPI void RPC_ENTRY
200 RpcRaiseException( RPC_STATUS exception );
202 RPCRTAPI RPC_STATUS RPC_ENTRY
203 RpcBindingCopy( RPC_BINDING_HANDLE SourceBinding, RPC_BINDING_HANDLE* DestinationBinding );
205 RPCRTAPI RPC_STATUS RPC_ENTRY
206 RpcBindingFree( RPC_BINDING_HANDLE* Binding );
208 RPCRTAPI RPC_STATUS RPC_ENTRY
209 RpcBindingInqObject( RPC_BINDING_HANDLE Binding, UUID* ObjectUuid );
210 RPCRTAPI RPC_STATUS RPC_ENTRY
211 RpcBindingReset( RPC_BINDING_HANDLE Binding );
212 RPCRTAPI RPC_STATUS RPC_ENTRY
213 RpcBindingSetObject( RPC_BINDING_HANDLE Binding, UUID* ObjectUuid );
214 RPCRTAPI RPC_STATUS RPC_ENTRY
215 RpcObjectSetType( UUID* ObjUuid, UUID* TypeUuid );
217 RPCRTAPI RPC_STATUS RPC_ENTRY
218 RpcBindingFromStringBindingA( RPC_CSTR StringBinding, RPC_BINDING_HANDLE* Binding );
219 RPCRTAPI RPC_STATUS RPC_ENTRY
220 RpcBindingFromStringBindingW( RPC_WSTR StringBinding, RPC_BINDING_HANDLE* Binding );
221 #define RpcBindingFromStringBinding WINELIB_NAME_AW(RpcBindingFromStringBinding)
223 RPCRTAPI RPC_STATUS RPC_ENTRY
224 RpcBindingToStringBindingA( RPC_BINDING_HANDLE Binding, RPC_CSTR *StringBinding );
225 RPCRTAPI RPC_STATUS RPC_ENTRY
226 RpcBindingToStringBindingW( RPC_BINDING_HANDLE Binding, RPC_WSTR *StringBinding );
227 #define RpcBindingFromStringBinding WINELIB_NAME_AW(RpcBindingFromStringBinding)
229 RPCRTAPI RPC_STATUS RPC_ENTRY
230 RpcBindingVectorFree( RPC_BINDING_VECTOR** BindingVector );
232 RPCRTAPI RPC_STATUS RPC_ENTRY
233 RpcStringBindingComposeA( RPC_CSTR ObjUuid, RPC_CSTR Protseq, RPC_CSTR NetworkAddr,
234 RPC_CSTR Endpoint, RPC_CSTR Options, RPC_CSTR *StringBinding );
235 RPCRTAPI RPC_STATUS RPC_ENTRY
236 RpcStringBindingComposeW( RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr,
237 RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR *StringBinding );
238 #define RpcStringBindingCompose WINELIB_NAME_AW(RpcStringBindingCompose)
240 RPCRTAPI RPC_STATUS RPC_ENTRY
241 RpcStringBindingParseA( RPC_CSTR StringBinding, RPC_CSTR *ObjUuid, RPC_CSTR *Protseq,
242 RPC_CSTR *NetworkAddr, RPC_CSTR *Endpoint, RPC_CSTR *NetworkOptions );
243 RPCRTAPI RPC_STATUS RPC_ENTRY
244 RpcStringBindingParseW( RPC_WSTR StringBinding, RPC_WSTR *ObjUuid, RPC_WSTR *Protseq,
245 RPC_WSTR *NetworkAddr, RPC_WSTR *Endpoint, RPC_WSTR *NetworkOptions );
246 #define RpcStringBindingParse WINELIB_NAME_AW(RpcStringBindingParse)
248 RPCRTAPI RPC_STATUS RPC_ENTRY
249 RpcEpResolveBinding( RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE IfSpec );
251 RPCRTAPI RPC_STATUS RPC_ENTRY
252 RpcEpRegisterA( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
253 UUID_VECTOR* UuidVector, RPC_CSTR Annotation );
254 RPCRTAPI RPC_STATUS RPC_ENTRY
255 RpcEpRegisterW( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
256 UUID_VECTOR* UuidVector, RPC_WSTR Annotation );
257 #define RpcEpRegister WINELIB_NAME_AW(RpcEpRegister)
259 RPCRTAPI RPC_STATUS RPC_ENTRY
260 RpcEpRegisterNoReplaceA( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
261 UUID_VECTOR* UuidVector, RPC_CSTR Annotation );
262 RPCRTAPI RPC_STATUS RPC_ENTRY
263 RpcEpRegisterNoReplaceW( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
264 UUID_VECTOR* UuidVector, RPC_WSTR Annotation );
265 #define RpcEpRegisterNoReplace WINELIB_NAME_AW(RpcEpRegisterNoReplace)
267 RPCRTAPI RPC_STATUS RPC_ENTRY
268 RpcEpUnregister( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
269 UUID_VECTOR* UuidVector );
271 RPCRTAPI RPC_STATUS RPC_ENTRY
272 RpcServerInqBindings( RPC_BINDING_VECTOR** BindingVector );
274 RPCRTAPI RPC_STATUS RPC_ENTRY
275 RpcServerListen( unsigned int MinimumCallThreads, unsigned int MaxCalls, unsigned int DontWait );
277 RPCRTAPI RPC_STATUS RPC_ENTRY
278 RpcMgmtWaitServerListen( void );
280 RPCRTAPI RPC_STATUS RPC_ENTRY
281 RpcMgmtStopServerListening( RPC_BINDING_HANDLE Binding );
283 RPCRTAPI RPC_STATUS RPC_ENTRY
284 RpcMgmtInqIfIds( RPC_BINDING_HANDLE Binding, RPC_IF_ID_VECTOR** IfIdVector );
286 RPCRTAPI RPC_STATUS RPC_ENTRY
287 RpcMgmtEpEltInqBegin( RPC_BINDING_HANDLE EpBinding, unsigned long InquiryType, RPC_IF_ID *IfId,
288 unsigned long VersOption, UUID *ObjectUuid, RPC_EP_INQ_HANDLE *InquiryContext);
290 RPCRTAPI RPC_STATUS RPC_ENTRY
291 RpcServerRegisterIf( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv );
293 RPCRTAPI RPC_STATUS RPC_ENTRY
294 RpcServerRegisterIfEx( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv,
295 unsigned int Flags, unsigned int MaxCalls, RPC_IF_CALLBACK_FN* IfCallbackFn );
297 RPCRTAPI RPC_STATUS RPC_ENTRY
298 RpcServerRegisterIf2( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv,
299 unsigned int Flags, unsigned int MaxCalls, unsigned int MaxRpcSize, RPC_IF_CALLBACK_FN* IfCallbackFn );
301 RPCRTAPI RPC_STATUS RPC_ENTRY
302 RpcServerUnregisterIf( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, unsigned int WaitForCallsToComplete );
304 RPCRTAPI RPC_STATUS RPC_ENTRY
305 RpcServerUnregisterIfEx( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, int RundownContextHandles );
308 RPCRTAPI RPC_STATUS RPC_ENTRY
309 RpcServerUseProtseqA(RPC_CSTR Protseq, unsigned int MaxCalls, void *SecurityDescriptor);
310 RPCRTAPI RPC_STATUS RPC_ENTRY
311 RpcServerUseProtseqW(RPC_WSTR Protseq, unsigned int MaxCalls, void *SecurityDescriptor);
312 #define RpcServerUseProtseq WINELIB_NAME_AW(RpcServerUseProtseq)
314 RPCRTAPI RPC_STATUS RPC_ENTRY
315 RpcServerUseProtseqEpA( RPC_CSTR Protseq, unsigned int MaxCalls, RPC_CSTR Endpoint, void *SecurityDescriptor );
316 RPCRTAPI RPC_STATUS RPC_ENTRY
317 RpcServerUseProtseqEpW( RPC_WSTR Protseq, unsigned int MaxCalls, RPC_WSTR Endpoint, void *SecurityDescriptor );
318 #define RpcServerUseProtseqEp WINELIB_NAME_AW(RpcServerUseProtseqEp)
320 RPCRTAPI RPC_STATUS RPC_ENTRY
321 RpcServerUseProtseqEpExA( RPC_CSTR Protseq, unsigned int MaxCalls, RPC_CSTR Endpoint, void *SecurityDescriptor,
322 PRPC_POLICY Policy );
323 RPCRTAPI RPC_STATUS RPC_ENTRY
324 RpcServerUseProtseqEpExW( RPC_WSTR Protseq, unsigned int MaxCalls, RPC_WSTR Endpoint, void *SecurityDescriptor,
325 PRPC_POLICY Policy );
326 #define RpcServerUseProtseqEpEx WINELIB_NAME_AW(RpcServerUseProtseqEpEx)
328 RPCRTAPI RPC_STATUS RPC_ENTRY
329 RpcServerRegisterAuthInfoA( RPC_CSTR ServerPrincName, unsigned long AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn,
331 RPCRTAPI RPC_STATUS RPC_ENTRY
332 RpcServerRegisterAuthInfoW( RPC_WSTR ServerPrincName, unsigned long AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn,
334 #define RpcServerRegisterAuthInfo WINELIB_NAME_AW(RpcServerRegisterAuthInfo)
336 RPCRTAPI RPC_STATUS RPC_ENTRY
337 RpcBindingSetAuthInfoExA( RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, unsigned long AuthnLevel,
338 unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvr,
339 RPC_SECURITY_QOS *SecurityQos );
341 RPCRTAPI RPC_STATUS RPC_ENTRY
342 RpcBindingSetAuthInfoExW( RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, unsigned long AuthnLevel,
343 unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvr,
344 RPC_SECURITY_QOS *SecurityQos );
345 #define RpcBindingSetAuthInfoEx WINELIB_NAME_AW(RpcBindingSetAuthInfoEx)
347 RPCRTAPI RPC_STATUS RPC_ENTRY
348 RpcBindingSetAuthInfoA( RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, unsigned long AuthnLevel,
349 unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvr );
351 RPCRTAPI RPC_STATUS RPC_ENTRY
352 RpcBindingSetAuthInfoW( RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, unsigned long AuthnLevel,
353 unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvr );
354 #define RpcBindingSetAuthInfo WINELIB_NAME_AW(RpcBindingSetAuthInfo)
356 RPCRTAPI RPC_STATUS RPC_ENTRY
357 RpcBindingInqAuthInfoExA( RPC_BINDING_HANDLE Binding, RPC_CSTR * ServerPrincName, unsigned long *AuthnLevel,
358 unsigned long *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, unsigned long *AuthzSvc,
359 unsigned long RpcQosVersion, RPC_SECURITY_QOS *SecurityQOS );
361 RPCRTAPI RPC_STATUS RPC_ENTRY
362 RpcBindingInqAuthInfoExW( RPC_BINDING_HANDLE Binding, RPC_WSTR *ServerPrincName, unsigned long *AuthnLevel,
363 unsigned long *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, unsigned long *AuthzSvc,
364 unsigned long RpcQosVersion, RPC_SECURITY_QOS *SecurityQOS );
365 #define RpcBindingInqAuthInfoEx WINELIB_NAME_AW(RpcBindingInqAuthInfoEx)
367 RPCRTAPI RPC_STATUS RPC_ENTRY
368 RpcBindingInqAuthInfoA( RPC_BINDING_HANDLE Binding, RPC_CSTR * ServerPrincName, unsigned long *AuthnLevel,
369 unsigned long *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, unsigned long *AuthzSvc );
371 RPCRTAPI RPC_STATUS RPC_ENTRY
372 RpcBindingInqAuthInfoW( RPC_BINDING_HANDLE Binding, RPC_WSTR *ServerPrincName, unsigned long *AuthnLevel,
373 unsigned long *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, unsigned long *AuthzSvc );
374 #define RpcBindingInqAuthInfo WINELIB_NAME_AW(RpcBindingInqAuthInfo)
376 RPCRTAPI RPC_STATUS RPC_ENTRY
377 RpcNetworkIsProtseqValidA( RPC_CSTR protseq );
378 RPCRTAPI RPC_STATUS RPC_ENTRY
379 RpcNetworkIsProtseqValidW( RPC_WSTR protseq );
380 #define RpcNetworkIsProtseqValid WINELIB_NAME_AW(RpcNetworkIsProtseqValid)
382 RPCRTAPI RPC_STATUS RPC_ENTRY
383 RpcStringFreeA(RPC_CSTR* String);
384 RPCRTAPI RPC_STATUS RPC_ENTRY
385 RpcStringFreeW(RPC_WSTR* String);
386 #define RpcStringFree WINELIB_NAME_AW(RpcStringFree)
388 RPCRTAPI RPC_STATUS RPC_ENTRY
389 UuidToStringA( UUID* Uuid, RPC_CSTR* StringUuid );
390 RPCRTAPI RPC_STATUS RPC_ENTRY
391 UuidToStringW( UUID* Uuid, RPC_WSTR* StringUuid );
392 #define UuidToString WINELIB_NAME_AW(UuidToString)
394 RPCRTAPI RPC_STATUS RPC_ENTRY
395 UuidFromStringA( RPC_CSTR StringUuid, UUID* Uuid );
396 RPCRTAPI RPC_STATUS RPC_ENTRY
397 UuidFromStringW( RPC_WSTR StringUuid, UUID* Uuid );
398 #define UuidFromString WINELIB_NAME_AW(UuidFromString)
400 RPCRTAPI RPC_STATUS RPC_ENTRY
401 UuidCreate( UUID* Uuid );
402 RPCRTAPI RPC_STATUS RPC_ENTRY
403 UuidCreateSequential( UUID* Uuid );
404 RPCRTAPI RPC_STATUS RPC_ENTRY
405 UuidCreateNil( UUID* Uuid );
406 RPCRTAPI signed int RPC_ENTRY
407 UuidCompare( UUID* Uuid1, UUID* Uuid2, RPC_STATUS* Status_ );
408 RPCRTAPI int RPC_ENTRY
409 UuidEqual( UUID* Uuid1, UUID* Uuid2, RPC_STATUS* Status_ );
410 RPCRTAPI unsigned short RPC_ENTRY
411 UuidHash(UUID* Uuid, RPC_STATUS* Status_ );
412 RPCRTAPI int RPC_ENTRY
413 UuidIsNil( UUID* Uuid, RPC_STATUS* Status_ );
421 #endif /*__WINE_RPCDCE_H */