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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __WINE_RPCDCE_H
20 #define __WINE_RPCDCE_H
31 typedef void* RPC_AUTH_IDENTITY_HANDLE
;
32 typedef void* RPC_AUTHZ_HANDLE
;
33 typedef void* RPC_IF_HANDLE
;
34 typedef I_RPC_HANDLE RPC_BINDING_HANDLE
;
35 typedef RPC_BINDING_HANDLE handle_t
;
36 #define rpc_binding_handle_t RPC_BINDING_HANDLE
37 #define RPC_MGR_EPV void
39 typedef struct _RPC_BINDING_VECTOR
42 RPC_BINDING_HANDLE BindingH
[1];
43 } RPC_BINDING_VECTOR
, *PRPC_BINDING_VECTOR
;
44 #define rpc_binding_vector_t RPC_BINDING_VECTOR
46 typedef struct _UUID_VECTOR
50 } UUID_VECTOR
, *PUUID_VECTOR
;
51 #define uuid_vector_t UUID_VECTOR
53 typedef struct _RPC_IF_ID
56 unsigned short VersMajor
;
57 unsigned short VersMinor
;
60 #define RPC_C_BINDING_INFINITE_TIMEOUT 10
61 #define RPC_C_BINDING_MIN_TIMEOUT 0
62 #define RPC_C_BINDING_DEFAULT_TIMEOUT 5
63 #define RPC_C_BINDING_MAX_TIMEOUT 9
65 #define RPC_C_CANCEL_INFINITE_TIMEOUT -1
67 #define RPC_C_LISTEN_MAX_CALLS_DEFAULT 1234
68 #define RPC_C_PROTSEQ_MAX_REQS_DEFAULT 10
70 /* RPC_POLICY EndpointFlags */
71 #define RPC_C_BIND_TO_ALL_NICS 0x1
72 #define RPC_C_USE_INTERNET_PORT 0x1
73 #define RPC_C_USE_INTRANET_PORT 0x2
74 #define RPC_C_DONT_FAIL 0x4
76 /* RPC_POLICY EndpointFlags specific to the Falcon/RPC transport */
77 #define RPC_C_MQ_TEMPORARY 0x0000
78 #define RPC_C_MQ_PERMANENT 0x0001
79 #define RPC_C_MQ_CLEAR_ON_OPEN 0x0002
80 #define RPC_C_MQ_USE_EXISTING_SECURITY 0x0004
81 #define RPC_C_MQ_AUTHN_LEVEL_NONE 0x0000
82 #define RPC_C_MQ_AUTHN_LEVEL_PKT_INTEGRITY 0x0008
83 #define RPC_C_MQ_AUTHN_LEVEL_PKT_PRIVACY 0x0010
86 typedef RPC_STATUS RPC_ENTRY
RPC_IF_CALLBACK_FN( RPC_IF_HANDLE InterfaceUuid
, LPVOID Context
);
87 typedef void (__RPC_USER
*RPC_AUTH_KEY_RETRIEVAL_FN
)();
89 typedef struct _RPC_POLICY
94 } RPC_POLICY
, *PRPC_POLICY
;
96 /* RpcServerRegisterIfEx Flags */
97 #define RPC_IF_AUTOLISTEN 0x1
98 #define RPC_IF_OLE 0x2
99 #define RPC_IF_ALLOW_UNKNOWN_AUTHORITY 0x4
100 #define RPC_IF_ALLOW_SECURE_ONLY 0x8
102 RPCRTAPI
void RPC_ENTRY
103 RpcRaiseException( RPC_STATUS exception
);
105 RPCRTAPI RPC_STATUS RPC_ENTRY
106 RpcBindingCopy( RPC_BINDING_HANDLE SourceBinding
, RPC_BINDING_HANDLE
* DestinationBinding
);
108 RPCRTAPI RPC_STATUS RPC_ENTRY
109 RpcBindingFree( RPC_BINDING_HANDLE
* Binding
);
111 RPCRTAPI RPC_STATUS RPC_ENTRY
112 RpcBindingInqObject( RPC_BINDING_HANDLE Binding
, UUID
* ObjectUuid
);
113 RPCRTAPI RPC_STATUS RPC_ENTRY
114 RpcBindingReset( RPC_BINDING_HANDLE Binding
);
115 RPCRTAPI RPC_STATUS RPC_ENTRY
116 RpcBindingSetObject( RPC_BINDING_HANDLE Binding
, UUID
* ObjectUuid
);
118 RPCRTAPI RPC_STATUS RPC_ENTRY
119 RpcBindingFromStringBindingA( LPSTR StringBinding
, RPC_BINDING_HANDLE
* Binding
);
120 RPCRTAPI RPC_STATUS RPC_ENTRY
121 RpcBindingFromStringBindingW( LPWSTR StringBinding
, RPC_BINDING_HANDLE
* Binding
);
122 #define RpcBindingFromStringBinding WINELIB_NAME_AW(RpcBindingFromStringBinding)
124 RPCRTAPI RPC_STATUS RPC_ENTRY
125 RpcBindingToStringBindingA( RPC_BINDING_HANDLE Binding
, LPSTR
* StringBinding
);
126 RPCRTAPI RPC_STATUS RPC_ENTRY
127 RpcBindingToStringBindingW( RPC_BINDING_HANDLE Binding
, LPWSTR
* StringBinding
);
128 #define RpcBindingFromStringBinding WINELIB_NAME_AW(RpcBindingFromStringBinding)
130 RPCRTAPI RPC_STATUS RPC_ENTRY
131 RpcBindingVectorFree( RPC_BINDING_VECTOR
** BindingVector
);
133 RPCRTAPI RPC_STATUS RPC_ENTRY
134 RpcStringBindingComposeA( LPSTR ObjUuid
, LPSTR Protseq
, LPSTR NetworkAddr
,
135 LPSTR Endpoint
, LPSTR Options
, LPSTR
* StringBinding
);
136 RPCRTAPI RPC_STATUS RPC_ENTRY
137 RpcStringBindingComposeW( LPWSTR ObjUuid
, LPWSTR Protseq
, LPWSTR NetworkAddr
,
138 LPWSTR Endpoint
, LPWSTR Options
, LPWSTR
* StringBinding
);
139 #define RpcStringBindingCompose WINELIB_NAME_AW(RpcStringBindingCompose)
141 RPCRTAPI RPC_STATUS RPC_ENTRY
142 RpcStringBindingParseA( LPSTR StringBinding
, LPSTR
* ObjUuid
, LPSTR
* Protseq
,
143 LPSTR
* NetworkAddr
, LPSTR
* Endpoint
, LPSTR
* NetworkOptions
);
144 RPCRTAPI RPC_STATUS RPC_ENTRY
145 RpcStringBindingParseW( LPWSTR StringBinding
, LPWSTR
* ObjUuid
, LPWSTR
* Protseq
,
146 LPWSTR
* NetworkAddr
, LPWSTR
* Endpoint
, LPWSTR
* NetworkOptions
);
147 #define RpcStringBindingParse WINELIB_NAME_AW(RpcStringBindingParse)
149 RPCRTAPI RPC_STATUS RPC_ENTRY
150 RpcEpResolveBinding( RPC_BINDING_HANDLE Binding
, RPC_IF_HANDLE IfSpec
);
152 RPCRTAPI RPC_STATUS RPC_ENTRY
153 RpcEpRegisterA( RPC_IF_HANDLE IfSpec
, PRPC_BINDING_VECTOR BindingVector
,
154 PUUID_VECTOR UuidVector
, LPSTR Annotation
);
155 RPCRTAPI RPC_STATUS RPC_ENTRY
156 RpcEpRegisterW( RPC_IF_HANDLE IfSpec
, PRPC_BINDING_VECTOR BindingVector
,
157 PUUID_VECTOR UuidVector
, LPWSTR Annotation
);
158 #define RpcEpRegister WINELIB_NAME_AW(RpcEpRegister)
160 RPCRTAPI RPC_STATUS RPC_ENTRY
161 RpcEpRegisterNoReplaceA( RPC_IF_HANDLE IfSpec
, RPC_BINDING_VECTOR
* BindingVector
,
162 UUID_VECTOR
* UuidVector
, LPSTR Annotation
);
163 RPCRTAPI RPC_STATUS RPC_ENTRY
164 RpcEpRegisterNoReplaceW( RPC_IF_HANDLE IfSpec
, RPC_BINDING_VECTOR
* BindingVector
,
165 UUID_VECTOR
* UuidVector
, LPWSTR Annotation
);
166 #define RpcEpRegisterNoReplace WINELIB_NAME_AW(RpcEpRegisterNoReplace)
168 RPCRTAPI RPC_STATUS RPC_ENTRY
169 RpcEpUnregister( RPC_IF_HANDLE IfSpec
, RPC_BINDING_VECTOR
* BindingVector
,
170 UUID_VECTOR
* UuidVector
);
172 RPCRTAPI RPC_STATUS RPC_ENTRY
173 RpcServerInqBindings( RPC_BINDING_VECTOR
** BindingVector
);
175 RPCRTAPI RPC_STATUS RPC_ENTRY
176 RpcServerListen( UINT MinimumCallThreads
, UINT MaxCalls
, UINT DontWait
);
178 RPCRTAPI RPC_STATUS RPC_ENTRY
179 RpcMgmtWaitServerListen( void );
181 RPCRTAPI RPC_STATUS RPC_ENTRY
182 RpcMgmtStopServerListening( RPC_BINDING_HANDLE Binding
);
184 RPCRTAPI RPC_STATUS RPC_ENTRY
185 RpcServerRegisterIf( RPC_IF_HANDLE IfSpec
, UUID
* MgrTypeUuid
, RPC_MGR_EPV
* MgrEpv
);
187 RPCRTAPI RPC_STATUS RPC_ENTRY
188 RpcServerRegisterIfEx( RPC_IF_HANDLE IfSpec
, UUID
* MgrTypeUuid
, RPC_MGR_EPV
* MgrEpv
,
189 UINT Flags
, UINT MaxCalls
, RPC_IF_CALLBACK_FN
* IfCallbackFn
);
191 RPCRTAPI RPC_STATUS RPC_ENTRY
192 RpcServerRegisterIf2( RPC_IF_HANDLE IfSpec
, UUID
* MgrTypeUuid
, RPC_MGR_EPV
* MgrEpv
,
193 UINT Flags
, UINT MaxCalls
, UINT MaxRpcSize
, RPC_IF_CALLBACK_FN
* IfCallbackFn
);
195 RPCRTAPI RPC_STATUS RPC_ENTRY
196 RpcServerUnregisterIf( RPC_IF_HANDLE IfSpec
, UUID
* MgrTypeUuid
, UINT WaitForCallsToComplete
);
198 RPCRTAPI RPC_STATUS RPC_ENTRY
199 RpcServerUnregisterIfEx( RPC_IF_HANDLE IfSpec
, UUID
* MgrTypeUuid
, int RundownContextHandles
);
202 RPCRTAPI RPC_STATUS RPC_ENTRY
203 RpcServerUseProtseqA(LPSTR Protseq
, unsigned int MaxCalls
, void *SecurityDescriptor
);
204 RPCRTAPI RPC_STATUS RPC_ENTRY
205 RpcServerUseProtseqW(LPWSTR Protseq
, unsigned int MaxCalls
, void *SecurityDescriptor
);
206 #define RpcServerUseProtseq WINELIB_NAME_AW(RpcServerUseProtseq)
208 RPCRTAPI RPC_STATUS RPC_ENTRY
209 RpcServerUseProtseqEpA( LPSTR Protseq
, UINT MaxCalls
, LPSTR Endpoint
, LPVOID SecurityDescriptor
);
210 RPCRTAPI RPC_STATUS RPC_ENTRY
211 RpcServerUseProtseqEpW( LPWSTR Protseq
, UINT MaxCalls
, LPWSTR Endpoint
, LPVOID SecurityDescriptor
);
212 #define RpcServerUseProtseqEp WINELIB_NAME_AW(RpcServerUseProtseqEp)
214 RPCRTAPI RPC_STATUS RPC_ENTRY
215 RpcServerUseProtseqEpExA( LPSTR Protseq
, UINT MaxCalls
, LPSTR Endpoint
, LPVOID SecurityDescriptor
,
216 PRPC_POLICY Policy
);
217 RPCRTAPI RPC_STATUS RPC_ENTRY
218 RpcServerUseProtseqEpExW( LPWSTR Protseq
, UINT MaxCalls
, LPWSTR Endpoint
, LPVOID SecurityDescriptor
,
219 PRPC_POLICY Policy
);
220 #define RpcServerUseProtseqEpEx WINELIB_NAME_AW(RpcServerUseProtseqEpEx)
222 RPCRTAPI RPC_STATUS RPC_ENTRY
223 RpcServerRegisterAuthInfoA( LPSTR ServerPrincName
, ULONG AuthnSvc
, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn
,
225 RPCRTAPI RPC_STATUS RPC_ENTRY
226 RpcServerRegisterAuthInfoW( LPWSTR ServerPrincName
, ULONG AuthnSvc
, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn
,
228 #define RpcServerRegisterAuthInfo WINELIB_NAME_AW(RpcServerRegisterAuthInfo)
230 RPCRTAPI RPC_STATUS RPC_ENTRY
231 RpcStringBindingComposeA( LPSTR ObjUuid
, LPSTR Protseq
, LPSTR NetworkAddr
, LPSTR Endpoint
,
232 LPSTR Options
, LPSTR
* StringBinding
);
233 RPCRTAPI RPC_STATUS RPC_ENTRY
234 RpcStringBindingComposeW( LPWSTR ObjUuid
, LPWSTR Protseq
, LPWSTR NetworkAddr
, LPWSTR Endpoint
,
235 LPWSTR Options
, LPWSTR
* StringBinding
);
236 #define RpcStringBindingCompose WINELIB_NAME_AW(RpcStringBindingCompose)
238 RPCRTAPI RPC_STATUS RPC_ENTRY
239 RpcStringFreeA(unsigned char** String
);
240 RPCRTAPI RPC_STATUS RPC_ENTRY
241 RpcStringFreeW(unsigned short** String
);
242 #define RpcStringFree WINELIB_NAME_AW(RpcStringFree)
244 RPCRTAPI RPC_STATUS RPC_ENTRY
245 UuidToStringA( UUID
* Uuid
, unsigned char** StringUuid
);
246 RPCRTAPI RPC_STATUS RPC_ENTRY
247 UuidToStringW( UUID
* Uuid
, unsigned short** StringUuid
);
248 #define UuidToString WINELIB_NAME_AW(UuidToString)
250 RPCRTAPI RPC_STATUS RPC_ENTRY
251 UuidFromStringA( unsigned char* StringUuid
, UUID
* Uuid
);
252 RPCRTAPI RPC_STATUS RPC_ENTRY
253 UuidFromStringW( unsigned short* StringUuid
, UUID
* Uuid
);
254 #define UuidFromString WINELIB_NAME_AW(UuidFromString)
256 RPCRTAPI RPC_STATUS RPC_ENTRY
257 UuidCreate( UUID
* Uuid
);
258 RPCRTAPI RPC_STATUS RPC_ENTRY
259 UuidCreateSequential( UUID
* Uuid
);
260 RPCRTAPI RPC_STATUS RPC_ENTRY
261 UuidCreateNil( UUID
* Uuid
);
262 RPCRTAPI
signed int RPC_ENTRY
263 UuidCompare( UUID
* Uuid1
, UUID
* Uuid2
, RPC_STATUS
* Status_
);
264 RPCRTAPI
int RPC_ENTRY
265 UuidEqual( UUID
* Uuid1
, UUID
* Uuid2
, RPC_STATUS
* Status_
);
266 RPCRTAPI
unsigned short RPC_ENTRY
267 UuidHash(UUID
* Uuid
, RPC_STATUS
* Status_
);
268 RPCRTAPI
int RPC_ENTRY
269 UuidIsNil( UUID
* Uuid
, RPC_STATUS
* Status_
);
273 #endif /*__WINE_RPCDCE_H */