~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/rpcrt4/rpc_binding.h

Version: ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 19  */
 20 
 21 #ifndef __WINE_RPC_BINDING_H
 22 #define __WINE_RPC_BINDING_H
 23 
 24 #include "wine/rpcss_shared.h"
 25 #include "rpcndr.h"
 26 #include "security.h"
 27 #include "wine/list.h"
 28 
 29 
 30 typedef struct _RpcAuthInfo
 31 {
 32   LONG refs;
 33 
 34   ULONG AuthnLevel;
 35   ULONG AuthnSvc;
 36   CredHandle cred;
 37   TimeStamp exp;
 38   ULONG cbMaxToken;
 39   /* the auth identity pointer that the application passed us (freed by application) */
 40   RPC_AUTH_IDENTITY_HANDLE *identity;
 41   /* our copy of NT auth identity structure, if the authentication service
 42    * takes an NT auth identity */
 43   SEC_WINNT_AUTH_IDENTITY_W *nt_identity;
 44   LPWSTR server_principal_name;
 45 } RpcAuthInfo;
 46 
 47 typedef struct _RpcQualityOfService
 48 {
 49     LONG refs;
 50 
 51     RPC_SECURITY_QOS_V2_W *qos;
 52 } RpcQualityOfService;
 53 
 54 struct connection_ops;
 55 
 56 typedef struct _RpcConnection
 57 {
 58   BOOL server;
 59   LPSTR NetworkAddr;
 60   LPSTR Endpoint;
 61   LPWSTR NetworkOptions;
 62   const struct connection_ops *ops;
 63   USHORT MaxTransmissionSize;
 64 
 65   /* authentication */
 66   CtxtHandle ctx;
 67   TimeStamp exp;
 68   ULONG attr;
 69   RpcAuthInfo *AuthInfo;
 70   ULONG encryption_auth_len;
 71   ULONG signature_auth_len;
 72   RpcQualityOfService *QOS;
 73 
 74   /* client-only */
 75   struct list conn_pool_entry;
 76   ULONG assoc_group_id; /* association group returned during binding */
 77   RPC_ASYNC_STATE *async_state;
 78 
 79   /* server-only */
 80   /* The active interface bound to server. */
 81   RPC_SYNTAX_IDENTIFIER ActiveInterface;
 82   USHORT NextCallId;
 83   struct _RpcConnection* Next;
 84   struct _RpcBinding *server_binding;
 85 } RpcConnection;
 86 
 87 struct connection_ops {
 88   const char *name;
 89   unsigned char epm_protocols[2]; /* only floors 3 and 4. see http://www.opengroup.org/onlinepubs/9629399/apdxl.htm */
 90   RpcConnection *(*alloc)(void);
 91   RPC_STATUS (*open_connection_client)(RpcConnection *conn);
 92   RPC_STATUS (*handoff)(RpcConnection *old_conn, RpcConnection *new_conn);
 93   int (*read)(RpcConnection *conn, void *buffer, unsigned int len);
 94   int (*write)(RpcConnection *conn, const void *buffer, unsigned int len);
 95   int (*close)(RpcConnection *conn);
 96   void (*cancel_call)(RpcConnection *conn);
 97   int (*wait_for_incoming_data)(RpcConnection *conn);
 98   size_t (*get_top_of_tower)(unsigned char *tower_data, const char *networkaddr, const char *endpoint);
 99   RPC_STATUS (*parse_top_of_tower)(const unsigned char *tower_data, size_t tower_size, char **networkaddr, char **endpoint);
100 };
101 
102 /* don't know what MS's structure looks like */
103 typedef struct _RpcBinding
104 {
105   LONG refs;
106   struct _RpcBinding* Next;
107   BOOL server;
108   UUID ObjectUuid;
109   LPSTR Protseq;
110   LPSTR NetworkAddr;
111   LPSTR Endpoint;
112   LPWSTR NetworkOptions;
113   RPC_BLOCKING_FN BlockingFn;
114   ULONG ServerTid;
115   RpcConnection* FromConn;
116   struct _RpcAssoc *Assoc;
117 
118   /* authentication */
119   RpcAuthInfo *AuthInfo;
120   RpcQualityOfService *QOS;
121 } RpcBinding;
122 
123 LPSTR RPCRT4_strndupA(LPCSTR src, INT len);
124 LPWSTR RPCRT4_strndupW(LPCWSTR src, INT len);
125 LPSTR RPCRT4_strdupWtoA(LPCWSTR src);
126 LPWSTR RPCRT4_strdupAtoW(LPCSTR src);
127 void RPCRT4_strfree(LPSTR src);
128 
129 #define RPCRT4_strdupA(x) RPCRT4_strndupA((x),-1)
130 #define RPCRT4_strdupW(x) RPCRT4_strndupW((x),-1)
131 
132 ULONG RpcAuthInfo_AddRef(RpcAuthInfo *AuthInfo);
133 ULONG RpcAuthInfo_Release(RpcAuthInfo *AuthInfo);
134 BOOL RpcAuthInfo_IsEqual(const RpcAuthInfo *AuthInfo1, const RpcAuthInfo *AuthInfo2);
135 ULONG RpcQualityOfService_AddRef(RpcQualityOfService *qos);
136 ULONG RpcQualityOfService_Release(RpcQualityOfService *qos);
137 BOOL RpcQualityOfService_IsEqual(const RpcQualityOfService *qos1, const RpcQualityOfService *qos2);
138 
139 RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server, LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcQualityOfService *QOS);
140 RPC_STATUS RPCRT4_DestroyConnection(RpcConnection* Connection);
141 RPC_STATUS RPCRT4_OpenClientConnection(RpcConnection* Connection);
142 RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection);
143 RPC_STATUS RPCRT4_SpawnConnection(RpcConnection** Connection, RpcConnection* OldConnection);
144 
145 RPC_STATUS RPCRT4_ResolveBinding(RpcBinding* Binding, LPCSTR Endpoint);
146 RPC_STATUS RPCRT4_SetBindingObject(RpcBinding* Binding, const UUID* ObjectUuid);
147 RPC_STATUS RPCRT4_MakeBinding(RpcBinding** Binding, RpcConnection* Connection);
148 void       RPCRT4_AddRefBinding(RpcBinding* Binding);
149 RPC_STATUS RPCRT4_ReleaseBinding(RpcBinding* Binding);
150 RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection,
151                               const RPC_SYNTAX_IDENTIFIER *TransferSyntax, const RPC_SYNTAX_IDENTIFIER *InterfaceId);
152 RPC_STATUS RPCRT4_CloseBinding(RpcBinding* Binding, RpcConnection* Connection);
153 BOOL RPCRT4_RPCSSOnDemandCall(PRPCSS_NP_MESSAGE msg, char *vardata_payload, PRPCSS_NP_REPLY reply);
154 HANDLE RPCRT4_GetMasterMutex(void);
155 HANDLE RPCRT4_RpcssNPConnect(void);
156 
157 static inline const char *rpcrt4_conn_get_name(const RpcConnection *Connection)
158 {
159   return Connection->ops->name;
160 }
161 
162 static inline int rpcrt4_conn_read(RpcConnection *Connection,
163                      void *buffer, unsigned int len)
164 {
165   return Connection->ops->read(Connection, buffer, len);
166 }
167 
168 static inline int rpcrt4_conn_write(RpcConnection *Connection,
169                      const void *buffer, unsigned int len)
170 {
171   return Connection->ops->write(Connection, buffer, len);
172 }
173 
174 static inline int rpcrt4_conn_close(RpcConnection *Connection)
175 {
176   return Connection->ops->close(Connection);
177 }
178 
179 static inline void rpcrt4_conn_cancel_call(RpcConnection *Connection)
180 {
181   Connection->ops->cancel_call(Connection);
182 }
183 
184 static inline RPC_STATUS rpcrt4_conn_handoff(RpcConnection *old_conn, RpcConnection *new_conn)
185 {
186   return old_conn->ops->handoff(old_conn, new_conn);
187 }
188 
189 /* floors 3 and up */
190 RPC_STATUS RpcTransport_GetTopOfTower(unsigned char *tower_data, size_t *tower_size, const char *protseq, const char *networkaddr, const char *endpoint);
191 RPC_STATUS RpcTransport_ParseTopOfTower(const unsigned char *tower_data, size_t tower_size, char **protseq, char **networkaddr, char **endpoint);
192 
193 void RPCRT4_SetThreadCurrentConnection(RpcConnection *Connection);
194 void RPCRT4_SetThreadCurrentCallHandle(RpcBinding *Binding);
195 RpcBinding *RPCRT4_GetThreadCurrentCallHandle(void);
196 void RPCRT4_PushThreadContextHandle(NDR_SCONTEXT SContext);
197 void RPCRT4_RemoveThreadContextHandle(NDR_SCONTEXT SContext);
198 NDR_SCONTEXT RPCRT4_PopThreadContextHandle(void);
199 
200 #endif
201 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.