rpcdce.h 11 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
 * Copyright (C) 2000 Francois Gouget
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

19 20 21
#ifndef __WINE_RPCDCE_H
#define __WINE_RPCDCE_H

22
#ifndef GUID_DEFINED
23
#include <guiddef.h>
24 25
#endif

26 27 28 29 30
#ifndef UUID_DEFINED
#define UUID_DEFINED
typedef GUID UUID;
#endif

31 32 33 34 35 36 37 38
typedef void* RPC_AUTH_IDENTITY_HANDLE;
typedef void* RPC_AUTHZ_HANDLE;
typedef void* RPC_IF_HANDLE;
typedef I_RPC_HANDLE RPC_BINDING_HANDLE;
typedef RPC_BINDING_HANDLE handle_t;
#define rpc_binding_handle_t RPC_BINDING_HANDLE
#define RPC_MGR_EPV void

Ove Kaaven's avatar
Ove Kaaven committed
39 40 41 42
typedef struct _RPC_BINDING_VECTOR
{
  unsigned long Count;
  RPC_BINDING_HANDLE BindingH[1];
43
} RPC_BINDING_VECTOR, *PRPC_BINDING_VECTOR;
Ove Kaaven's avatar
Ove Kaaven committed
44 45 46 47 48 49
#define rpc_binding_vector_t RPC_BINDING_VECTOR

typedef struct _UUID_VECTOR
{
  unsigned long Count;
  UUID *Uuid[1];
50
} UUID_VECTOR, *PUUID_VECTOR;
Ove Kaaven's avatar
Ove Kaaven committed
51 52 53 54 55 56 57 58 59
#define uuid_vector_t UUID_VECTOR

typedef struct _RPC_IF_ID
{
  UUID Uuid;
  unsigned short VersMajor;
  unsigned short VersMinor;
} RPC_IF_ID;

60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
#define RPC_C_BINDING_INFINITE_TIMEOUT 10
#define RPC_C_BINDING_MIN_TIMEOUT 0
#define RPC_C_BINDING_DEFAULT_TIMEOUT 5
#define RPC_C_BINDING_MAX_TIMEOUT 9

#define RPC_C_CANCEL_INFINITE_TIMEOUT -1

#define RPC_C_LISTEN_MAX_CALLS_DEFAULT 1234
#define RPC_C_PROTSEQ_MAX_REQS_DEFAULT 10

/* RPC_POLICY EndpointFlags */
#define RPC_C_BIND_TO_ALL_NICS          0x1
#define RPC_C_USE_INTERNET_PORT         0x1
#define RPC_C_USE_INTRANET_PORT         0x2
#define RPC_C_DONT_FAIL                 0x4

/* RPC_POLICY EndpointFlags specific to the Falcon/RPC transport */
#define RPC_C_MQ_TEMPORARY                  0x0000
#define RPC_C_MQ_PERMANENT                  0x0001
#define RPC_C_MQ_CLEAR_ON_OPEN              0x0002
#define RPC_C_MQ_USE_EXISTING_SECURITY      0x0004
#define RPC_C_MQ_AUTHN_LEVEL_NONE           0x0000
#define RPC_C_MQ_AUTHN_LEVEL_PKT_INTEGRITY  0x0008
#define RPC_C_MQ_AUTHN_LEVEL_PKT_PRIVACY    0x0010


typedef RPC_STATUS RPC_ENTRY RPC_IF_CALLBACK_FN( RPC_IF_HANDLE InterfaceUuid, LPVOID Context );
Patrik Stridvall's avatar
Patrik Stridvall committed
87
typedef void (__RPC_USER *RPC_AUTH_KEY_RETRIEVAL_FN)();
88

89
typedef struct _RPC_POLICY
90 91 92 93 94 95
{
  UINT  Length;
  ULONG EndpointFlags;
  ULONG NICFlags;
} RPC_POLICY,  *PRPC_POLICY;

Ove Kaaven's avatar
Ove Kaaven committed
96 97 98 99 100
/* RpcServerRegisterIfEx Flags */
#define RPC_IF_AUTOLISTEN               0x1
#define RPC_IF_OLE                      0x2
#define RPC_IF_ALLOW_UNKNOWN_AUTHORITY  0x4
#define RPC_IF_ALLOW_SECURE_ONLY        0x8
101

Ove Kaaven's avatar
Ove Kaaven committed
102 103 104
RPCRTAPI void RPC_ENTRY
  RpcRaiseException( RPC_STATUS exception );
        
Ove Kaaven's avatar
Ove Kaaven committed
105 106 107 108
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcBindingCopy( RPC_BINDING_HANDLE SourceBinding, RPC_BINDING_HANDLE* DestinationBinding );

RPCRTAPI RPC_STATUS RPC_ENTRY
109
  RpcBindingFree( RPC_BINDING_HANDLE* Binding );
Ove Kaaven's avatar
Ove Kaaven committed
110

Ove Kaaven's avatar
Ove Kaaven committed
111 112 113 114 115 116
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcBindingInqObject( RPC_BINDING_HANDLE Binding, UUID* ObjectUuid );
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcBindingReset( RPC_BINDING_HANDLE Binding );
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcBindingSetObject( RPC_BINDING_HANDLE Binding, UUID* ObjectUuid );
117 118
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcObjectSetType( UUID* ObjUuid, UUID* TypeUuid );
Ove Kaaven's avatar
Ove Kaaven committed
119

Ove Kaaven's avatar
Ove Kaaven committed
120
RPCRTAPI RPC_STATUS RPC_ENTRY
121
  RpcBindingFromStringBindingA( unsigned char *StringBinding, RPC_BINDING_HANDLE* Binding );
Ove Kaaven's avatar
Ove Kaaven committed
122 123 124 125 126
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcBindingFromStringBindingW( LPWSTR StringBinding, RPC_BINDING_HANDLE* Binding );
#define RpcBindingFromStringBinding WINELIB_NAME_AW(RpcBindingFromStringBinding)

RPCRTAPI RPC_STATUS RPC_ENTRY
127
  RpcBindingToStringBindingA( RPC_BINDING_HANDLE Binding, unsigned char **StringBinding );
Ove Kaaven's avatar
Ove Kaaven committed
128 129 130 131 132 133 134
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcBindingToStringBindingW( RPC_BINDING_HANDLE Binding, LPWSTR* StringBinding );
#define RpcBindingFromStringBinding WINELIB_NAME_AW(RpcBindingFromStringBinding)

RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcBindingVectorFree( RPC_BINDING_VECTOR** BindingVector );

Ove Kaaven's avatar
Ove Kaaven committed
135
RPCRTAPI RPC_STATUS RPC_ENTRY
136 137
  RpcStringBindingComposeA( unsigned char *ObjUuid, unsigned char *Protseq, unsigned char *NetworkAddr,
                            unsigned char *Endpoint, unsigned char *Options, unsigned char **StringBinding );
Ove Kaaven's avatar
Ove Kaaven committed
138 139 140 141 142 143
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcStringBindingComposeW( LPWSTR ObjUuid, LPWSTR Protseq, LPWSTR NetworkAddr,
                            LPWSTR Endpoint, LPWSTR Options, LPWSTR* StringBinding );
#define RpcStringBindingCompose WINELIB_NAME_AW(RpcStringBindingCompose)

RPCRTAPI RPC_STATUS RPC_ENTRY
144 145
  RpcStringBindingParseA( unsigned char *StringBinding, unsigned char **ObjUuid, unsigned char **Protseq,
                          unsigned char **NetworkAddr, unsigned char **Endpoint, unsigned char **NetworkOptions );
Ove Kaaven's avatar
Ove Kaaven committed
146 147 148 149 150 151 152 153 154
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcStringBindingParseW( LPWSTR StringBinding, LPWSTR* ObjUuid, LPWSTR* Protseq,
                          LPWSTR* NetworkAddr, LPWSTR* Endpoint, LPWSTR* NetworkOptions );
#define RpcStringBindingParse WINELIB_NAME_AW(RpcStringBindingParse)

RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcEpResolveBinding( RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE IfSpec );

RPCRTAPI RPC_STATUS RPC_ENTRY
155
  RpcEpRegisterA( RPC_IF_HANDLE IfSpec, PRPC_BINDING_VECTOR BindingVector,
156
                  PUUID_VECTOR UuidVector, unsigned char *Annotation );
Ove Kaaven's avatar
Ove Kaaven committed
157
RPCRTAPI RPC_STATUS RPC_ENTRY
158 159
  RpcEpRegisterW( RPC_IF_HANDLE IfSpec, PRPC_BINDING_VECTOR BindingVector,
                  PUUID_VECTOR UuidVector, LPWSTR Annotation );
Ove Kaaven's avatar
Ove Kaaven committed
160 161 162 163
#define RpcEpRegister WINELIB_NAME_AW(RpcEpRegister)

RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcEpRegisterNoReplaceA( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
164
                           UUID_VECTOR* UuidVector, unsigned char *Annotation );
Ove Kaaven's avatar
Ove Kaaven committed
165 166 167 168 169 170 171 172 173
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcEpRegisterNoReplaceW( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
                           UUID_VECTOR* UuidVector, LPWSTR Annotation );
#define RpcEpRegisterNoReplace WINELIB_NAME_AW(RpcEpRegisterNoReplace)

RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcEpUnregister( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR* BindingVector,
                   UUID_VECTOR* UuidVector );

Ove Kaaven's avatar
Ove Kaaven committed
174 175 176 177 178 179
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcServerInqBindings( RPC_BINDING_VECTOR** BindingVector );

RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcServerListen( UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait );

180 181 182
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcMgmtWaitServerListen( void );

183 184 185
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcMgmtStopServerListening( RPC_BINDING_HANDLE Binding );

186 187
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcServerRegisterIf( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv );
188

189 190 191
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcServerRegisterIfEx( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv,
                         UINT Flags, UINT MaxCalls, RPC_IF_CALLBACK_FN* IfCallbackFn );
192

193 194 195 196
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcServerRegisterIf2( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv,
                        UINT Flags, UINT MaxCalls, UINT MaxRpcSize, RPC_IF_CALLBACK_FN* IfCallbackFn );

197 198 199 200 201 202
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcServerUnregisterIf( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, UINT WaitForCallsToComplete );

RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcServerUnregisterIfEx( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, int RundownContextHandles );

203 204

RPCRTAPI RPC_STATUS RPC_ENTRY
205
  RpcServerUseProtseqA(unsigned char *Protseq, unsigned int MaxCalls, void *SecurityDescriptor);
206 207 208 209
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcServerUseProtseqW(LPWSTR Protseq, unsigned int MaxCalls, void *SecurityDescriptor);
#define RpcServerUseProtseq WINELIB_NAME_AW(RpcServerUseProtseq)

210
RPCRTAPI RPC_STATUS RPC_ENTRY
211
  RpcServerUseProtseqEpA( unsigned char *Protseq, UINT MaxCalls, unsigned char *Endpoint, LPVOID SecurityDescriptor );
212 213
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcServerUseProtseqEpW( LPWSTR Protseq, UINT MaxCalls, LPWSTR Endpoint, LPVOID SecurityDescriptor );
Ove Kaaven's avatar
Ove Kaaven committed
214
#define RpcServerUseProtseqEp WINELIB_NAME_AW(RpcServerUseProtseqEp)
215 216

RPCRTAPI RPC_STATUS RPC_ENTRY
217
  RpcServerUseProtseqEpExA( unsigned char *Protseq, UINT MaxCalls, unsigned char *Endpoint, LPVOID SecurityDescriptor,
218 219 220 221 222 223 224
                            PRPC_POLICY Policy );
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcServerUseProtseqEpExW( LPWSTR Protseq, UINT MaxCalls, LPWSTR Endpoint, LPVOID SecurityDescriptor,
                            PRPC_POLICY Policy );
#define RpcServerUseProtseqEpEx WINELIB_NAME_AW(RpcServerUseProtseqEpEx)

RPCRTAPI RPC_STATUS RPC_ENTRY
225
  RpcServerRegisterAuthInfoA( unsigned char *ServerPrincName, ULONG AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn,
226 227 228 229 230 231 232
                              LPVOID Arg );
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcServerRegisterAuthInfoW( LPWSTR ServerPrincName, ULONG AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn,
                              LPVOID Arg );
#define RpcServerRegisterAuthInfo WINELIB_NAME_AW(RpcServerRegisterAuthInfo)

RPCRTAPI RPC_STATUS RPC_ENTRY
233 234
  RpcStringBindingComposeA( unsigned char *ObjUuid, unsigned char *Protseq, unsigned char *NetworkAddr, unsigned char *Endpoint,
                            unsigned char *Options, unsigned char **StringBinding );
235 236 237 238 239
RPCRTAPI RPC_STATUS RPC_ENTRY
  RpcStringBindingComposeW( LPWSTR ObjUuid, LPWSTR Protseq, LPWSTR NetworkAddr, LPWSTR Endpoint,
                            LPWSTR Options, LPWSTR* StringBinding );
#define RpcStringBindingCompose WINELIB_NAME_AW(RpcStringBindingCompose)

240
RPCRTAPI RPC_STATUS RPC_ENTRY
241
  RpcNetworkIsProtseqValidA( unsigned char *protseq );
242
RPCRTAPI RPC_STATUS RPC_ENTRY
243 244
  RpcNetworkIsProtseqValidW( LPWSTR protseq );
#define RpcNetworkIsProtseqValid WINELIB_NAME_AW(RpcNetworkIsProtseqValid)
245

246
RPCRTAPI RPC_STATUS RPC_ENTRY
247
  RpcStringFreeA(unsigned char** String);
248
RPCRTAPI RPC_STATUS RPC_ENTRY
249
  RpcStringFreeW(unsigned short** String);
Ove Kaaven's avatar
Ove Kaaven committed
250
#define RpcStringFree WINELIB_NAME_AW(RpcStringFree)
251

Ove Kaaven's avatar
Ove Kaaven committed
252
RPCRTAPI RPC_STATUS RPC_ENTRY
253
  UuidToStringA( UUID* Uuid, unsigned char** StringUuid );
Ove Kaaven's avatar
Ove Kaaven committed
254
RPCRTAPI RPC_STATUS RPC_ENTRY
255
  UuidToStringW( UUID* Uuid, unsigned short** StringUuid );
Ove Kaaven's avatar
Ove Kaaven committed
256
#define UuidToString WINELIB_NAME_AW(UuidToString)
Ove Kaaven's avatar
Ove Kaaven committed
257 258

RPCRTAPI RPC_STATUS RPC_ENTRY
259
  UuidFromStringA( unsigned char* StringUuid, UUID* Uuid );
Ove Kaaven's avatar
Ove Kaaven committed
260
RPCRTAPI RPC_STATUS RPC_ENTRY
261
  UuidFromStringW( unsigned short* StringUuid, UUID* Uuid );
Ove Kaaven's avatar
Ove Kaaven committed
262
#define UuidFromString WINELIB_NAME_AW(UuidFromString)
263

Ove Kaaven's avatar
Ove Kaaven committed
264 265 266 267 268 269 270 271 272 273
RPCRTAPI RPC_STATUS RPC_ENTRY
  UuidCreate( UUID* Uuid );
RPCRTAPI RPC_STATUS RPC_ENTRY
  UuidCreateSequential( UUID* Uuid );
RPCRTAPI RPC_STATUS RPC_ENTRY
  UuidCreateNil( UUID* Uuid );
RPCRTAPI signed int RPC_ENTRY
  UuidCompare( UUID* Uuid1, UUID* Uuid2, RPC_STATUS* Status_ );
RPCRTAPI int RPC_ENTRY
  UuidEqual( UUID* Uuid1, UUID* Uuid2, RPC_STATUS* Status_ );
274
RPCRTAPI unsigned short RPC_ENTRY
Ove Kaaven's avatar
Ove Kaaven committed
275
  UuidHash(UUID* Uuid, RPC_STATUS* Status_ );
Ove Kaaven's avatar
Ove Kaaven committed
276 277
RPCRTAPI int RPC_ENTRY
  UuidIsNil( UUID* Uuid, RPC_STATUS* Status_ );
278

279
#include <rpcdcep.h>
280 281

#endif /*__WINE_RPCDCE_H */