Make crypt functions more robust in case of incorrect api usage.
[wine] / dlls / rpcrt4 / rpc_binding.h
1 /*
2  * RPC binding API
3  *
4  * Copyright 2001 Ove Kåven, TransGaming Technologies
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #ifndef __WINE_RPC_BINDING_H
22 #define __WINE_RPC_BINDING_H
23
24 #include "wine/rpcss_shared.h"
25
26 typedef struct _RpcConnection
27 {
28   struct _RpcConnection* Next;
29   struct _RpcBinding* Used;
30   BOOL server;
31   LPSTR Protseq;
32   LPSTR NetworkAddr;
33   LPSTR Endpoint;
34   HANDLE conn, thread;
35   OVERLAPPED ovl;
36   USHORT MaxTransmissionSize;
37   /* The active interface bound to server. */
38   RPC_SYNTAX_IDENTIFIER ActiveInterface;
39 } RpcConnection;
40
41 /* don't know what MS's structure looks like */
42 typedef struct _RpcBinding
43 {
44   DWORD refs;
45   struct _RpcBinding* Next;
46   BOOL server;
47   UUID ObjectUuid;
48   LPSTR Protseq;
49   LPSTR NetworkAddr;
50   LPSTR Endpoint;
51   RPC_BLOCKING_FN BlockingFn;
52   ULONG ServerTid;
53   RpcConnection* FromConn;
54 } RpcBinding;
55
56 LPSTR RPCRT4_strndupA(LPCSTR src, INT len);
57 LPWSTR RPCRT4_strndupW(LPWSTR src, INT len);
58 LPSTR RPCRT4_strdupWtoA(LPWSTR src);
59 LPWSTR RPCRT4_strdupAtoW(LPSTR src);
60 void RPCRT4_strfree(LPSTR src);
61
62 #define RPCRT4_strdupA(x) RPCRT4_strndupA((x),-1)
63 #define RPCRT4_strdupW(x) RPCRT4_strndupW((x),-1)
64
65 RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server, LPSTR Protseq, LPSTR NetworkAddr, LPSTR Endpoint, LPSTR NetworkOptions, RpcBinding* Binding);
66 RPC_STATUS RPCRT4_DestroyConnection(RpcConnection* Connection);
67 RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection);
68 RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection);
69 RPC_STATUS RPCRT4_SpawnConnection(RpcConnection** Connection, RpcConnection* OldConnection);
70
71 RPC_STATUS RPCRT4_CreateBindingA(RpcBinding** Binding, BOOL server, LPSTR Protseq);
72 RPC_STATUS RPCRT4_CreateBindingW(RpcBinding** Binding, BOOL server, LPWSTR Protseq);
73 RPC_STATUS RPCRT4_CompleteBindingA(RpcBinding* Binding, LPSTR NetworkAddr,  LPSTR Endpoint,  LPSTR NetworkOptions);
74 RPC_STATUS RPCRT4_CompleteBindingW(RpcBinding* Binding, LPWSTR NetworkAddr, LPWSTR Endpoint, LPWSTR NetworkOptions);
75 RPC_STATUS RPCRT4_ResolveBinding(RpcBinding* Binding, LPSTR Endpoint);
76 RPC_STATUS RPCRT4_SetBindingObject(RpcBinding* Binding, UUID* ObjectUuid);
77 RPC_STATUS RPCRT4_MakeBinding(RpcBinding** Binding, RpcConnection* Connection);
78 RPC_STATUS RPCRT4_ExportBinding(RpcBinding** Binding, RpcBinding* OldBinding);
79 RPC_STATUS RPCRT4_DestroyBinding(RpcBinding* Binding);
80 RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection, PRPC_SYNTAX_IDENTIFIER TransferSyntax, PRPC_SYNTAX_IDENTIFIER InterfaceId);
81 RPC_STATUS RPCRT4_CloseBinding(RpcBinding* Binding, RpcConnection* Connection);
82 BOOL RPCRT4_RPCSSOnDemandCall(PRPCSS_NP_MESSAGE msg, char *vardata_payload, PRPCSS_NP_REPLY reply);
83 HANDLE RPCRT4_GetMasterMutex(void);
84 HANDLE RPCRT4_RpcssNPConnect(void);
85
86 #endif