Implemented RpcBindingInqObject, RpcBindingSetObject,
RpcBindingVectorFree, RpcBindingToStringBindingA/W,
RpcBindingFromStringBindingA/W, RpcStringBindingParseA/W,
I_RpcBindingSetAsync, RpcStringBindingComposeA/W, RpcBindingFree,
RPCStringFreeW, UUIDHash, UuidToStringW, and associated junk.
2002-10-07 21:49:49 +00:00
|
|
|
|
/*
|
|
|
|
|
* RPC binding API
|
|
|
|
|
*
|
|
|
|
|
* Copyright 2001 Ove K<EFBFBD>ven, TransGaming Technologies
|
|
|
|
|
*
|
|
|
|
|
* 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
|
2006-05-18 12:49:52 +00:00
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
Implemented RpcBindingInqObject, RpcBindingSetObject,
RpcBindingVectorFree, RpcBindingToStringBindingA/W,
RpcBindingFromStringBindingA/W, RpcStringBindingParseA/W,
I_RpcBindingSetAsync, RpcStringBindingComposeA/W, RpcBindingFree,
RPCStringFreeW, UUIDHash, UuidToStringW, and associated junk.
2002-10-07 21:49:49 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __WINE_RPC_BINDING_H
|
|
|
|
|
#define __WINE_RPC_BINDING_H
|
|
|
|
|
|
2007-12-30 16:44:54 +00:00
|
|
|
|
#include "rpcndr.h"
|
2006-05-15 14:04:25 +00:00
|
|
|
|
#include "security.h"
|
2006-06-07 19:12:34 +00:00
|
|
|
|
#include "wine/list.h"
|
2002-12-02 21:17:04 +00:00
|
|
|
|
|
2006-05-18 02:40:42 +00:00
|
|
|
|
|
|
|
|
|
typedef struct _RpcAuthInfo
|
|
|
|
|
{
|
|
|
|
|
LONG refs;
|
|
|
|
|
|
2007-03-26 17:16:34 +00:00
|
|
|
|
ULONG AuthnLevel;
|
|
|
|
|
ULONG AuthnSvc;
|
2006-05-18 02:40:42 +00:00
|
|
|
|
CredHandle cred;
|
|
|
|
|
TimeStamp exp;
|
2007-03-26 17:16:34 +00:00
|
|
|
|
ULONG cbMaxToken;
|
2007-06-25 13:27:17 +00:00
|
|
|
|
/* the auth identity pointer that the application passed us (freed by application) */
|
|
|
|
|
RPC_AUTH_IDENTITY_HANDLE *identity;
|
|
|
|
|
/* our copy of NT auth identity structure, if the authentication service
|
|
|
|
|
* takes an NT auth identity */
|
|
|
|
|
SEC_WINNT_AUTH_IDENTITY_W *nt_identity;
|
2008-01-23 16:32:54 +00:00
|
|
|
|
LPWSTR server_principal_name;
|
2006-05-18 02:40:42 +00:00
|
|
|
|
} RpcAuthInfo;
|
|
|
|
|
|
2007-01-19 12:59:35 +00:00
|
|
|
|
typedef struct _RpcQualityOfService
|
|
|
|
|
{
|
|
|
|
|
LONG refs;
|
|
|
|
|
|
|
|
|
|
RPC_SECURITY_QOS_V2_W *qos;
|
|
|
|
|
} RpcQualityOfService;
|
|
|
|
|
|
2006-10-16 15:47:39 +00:00
|
|
|
|
struct connection_ops;
|
2006-04-20 12:00:28 +00:00
|
|
|
|
|
2003-02-19 03:44:35 +00:00
|
|
|
|
typedef struct _RpcConnection
|
|
|
|
|
{
|
|
|
|
|
BOOL server;
|
|
|
|
|
LPSTR NetworkAddr;
|
|
|
|
|
LPSTR Endpoint;
|
2007-01-25 10:23:11 +00:00
|
|
|
|
LPWSTR NetworkOptions;
|
2006-10-16 15:47:39 +00:00
|
|
|
|
const struct connection_ops *ops;
|
2004-04-26 23:33:39 +00:00
|
|
|
|
USHORT MaxTransmissionSize;
|
2006-05-15 14:04:25 +00:00
|
|
|
|
|
|
|
|
|
/* authentication */
|
|
|
|
|
CtxtHandle ctx;
|
|
|
|
|
TimeStamp exp;
|
|
|
|
|
ULONG attr;
|
2006-05-18 02:40:42 +00:00
|
|
|
|
RpcAuthInfo *AuthInfo;
|
2007-03-26 17:19:33 +00:00
|
|
|
|
ULONG encryption_auth_len;
|
|
|
|
|
ULONG signature_auth_len;
|
2007-01-19 12:59:35 +00:00
|
|
|
|
RpcQualityOfService *QOS;
|
2006-06-07 19:12:34 +00:00
|
|
|
|
|
|
|
|
|
/* client-only */
|
|
|
|
|
struct list conn_pool_entry;
|
2007-06-25 13:26:23 +00:00
|
|
|
|
ULONG assoc_group_id; /* association group returned during binding */
|
2008-01-21 10:31:40 +00:00
|
|
|
|
RPC_ASYNC_STATE *async_state;
|
2007-12-16 12:07:30 +00:00
|
|
|
|
|
|
|
|
|
/* server-only */
|
|
|
|
|
/* The active interface bound to server. */
|
|
|
|
|
RPC_SYNTAX_IDENTIFIER ActiveInterface;
|
|
|
|
|
USHORT NextCallId;
|
|
|
|
|
struct _RpcConnection* Next;
|
|
|
|
|
struct _RpcBinding *server_binding;
|
2003-02-19 03:44:35 +00:00
|
|
|
|
} RpcConnection;
|
|
|
|
|
|
2006-10-16 15:47:39 +00:00
|
|
|
|
struct connection_ops {
|
2006-06-01 19:25:06 +00:00
|
|
|
|
const char *name;
|
|
|
|
|
unsigned char epm_protocols[2]; /* only floors 3 and 4. see http://www.opengroup.org/onlinepubs/9629399/apdxl.htm */
|
2006-04-21 06:40:06 +00:00
|
|
|
|
RpcConnection *(*alloc)(void);
|
2006-11-08 20:45:19 +00:00
|
|
|
|
RPC_STATUS (*open_connection_client)(RpcConnection *conn);
|
2006-04-21 06:39:27 +00:00
|
|
|
|
RPC_STATUS (*handoff)(RpcConnection *old_conn, RpcConnection *new_conn);
|
2006-04-20 12:00:28 +00:00
|
|
|
|
int (*read)(RpcConnection *conn, void *buffer, unsigned int len);
|
|
|
|
|
int (*write)(RpcConnection *conn, const void *buffer, unsigned int len);
|
|
|
|
|
int (*close)(RpcConnection *conn);
|
2007-11-12 20:10:19 +00:00
|
|
|
|
void (*cancel_call)(RpcConnection *conn);
|
2008-01-21 10:31:40 +00:00
|
|
|
|
int (*wait_for_incoming_data)(RpcConnection *conn);
|
2006-06-01 19:25:06 +00:00
|
|
|
|
size_t (*get_top_of_tower)(unsigned char *tower_data, const char *networkaddr, const char *endpoint);
|
|
|
|
|
RPC_STATUS (*parse_top_of_tower)(const unsigned char *tower_data, size_t tower_size, char **networkaddr, char **endpoint);
|
2006-04-20 12:00:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
Implemented RpcBindingInqObject, RpcBindingSetObject,
RpcBindingVectorFree, RpcBindingToStringBindingA/W,
RpcBindingFromStringBindingA/W, RpcStringBindingParseA/W,
I_RpcBindingSetAsync, RpcStringBindingComposeA/W, RpcBindingFree,
RPCStringFreeW, UUIDHash, UuidToStringW, and associated junk.
2002-10-07 21:49:49 +00:00
|
|
|
|
/* don't know what MS's structure looks like */
|
|
|
|
|
typedef struct _RpcBinding
|
|
|
|
|
{
|
2005-07-13 11:59:15 +00:00
|
|
|
|
LONG refs;
|
2003-02-19 03:44:35 +00:00
|
|
|
|
struct _RpcBinding* Next;
|
Implemented RpcBindingInqObject, RpcBindingSetObject,
RpcBindingVectorFree, RpcBindingToStringBindingA/W,
RpcBindingFromStringBindingA/W, RpcStringBindingParseA/W,
I_RpcBindingSetAsync, RpcStringBindingComposeA/W, RpcBindingFree,
RPCStringFreeW, UUIDHash, UuidToStringW, and associated junk.
2002-10-07 21:49:49 +00:00
|
|
|
|
BOOL server;
|
|
|
|
|
UUID ObjectUuid;
|
|
|
|
|
LPSTR Protseq;
|
|
|
|
|
LPSTR NetworkAddr;
|
|
|
|
|
LPSTR Endpoint;
|
2007-01-25 10:23:11 +00:00
|
|
|
|
LPWSTR NetworkOptions;
|
Implemented RpcBindingInqObject, RpcBindingSetObject,
RpcBindingVectorFree, RpcBindingToStringBindingA/W,
RpcBindingFromStringBindingA/W, RpcStringBindingParseA/W,
I_RpcBindingSetAsync, RpcStringBindingComposeA/W, RpcBindingFree,
RPCStringFreeW, UUIDHash, UuidToStringW, and associated junk.
2002-10-07 21:49:49 +00:00
|
|
|
|
RPC_BLOCKING_FN BlockingFn;
|
|
|
|
|
ULONG ServerTid;
|
2003-02-19 03:44:35 +00:00
|
|
|
|
RpcConnection* FromConn;
|
2007-12-16 12:11:49 +00:00
|
|
|
|
struct _RpcAssoc *Assoc;
|
2006-05-15 14:04:25 +00:00
|
|
|
|
|
|
|
|
|
/* authentication */
|
2006-05-18 02:40:42 +00:00
|
|
|
|
RpcAuthInfo *AuthInfo;
|
2007-01-19 12:59:35 +00:00
|
|
|
|
RpcQualityOfService *QOS;
|
Implemented RpcBindingInqObject, RpcBindingSetObject,
RpcBindingVectorFree, RpcBindingToStringBindingA/W,
RpcBindingFromStringBindingA/W, RpcStringBindingParseA/W,
I_RpcBindingSetAsync, RpcStringBindingComposeA/W, RpcBindingFree,
RPCStringFreeW, UUIDHash, UuidToStringW, and associated junk.
2002-10-07 21:49:49 +00:00
|
|
|
|
} RpcBinding;
|
|
|
|
|
|
2003-10-07 22:54:17 +00:00
|
|
|
|
LPSTR RPCRT4_strndupA(LPCSTR src, INT len);
|
2007-01-25 10:23:11 +00:00
|
|
|
|
LPWSTR RPCRT4_strndupW(LPCWSTR src, INT len);
|
2007-01-25 10:24:00 +00:00
|
|
|
|
LPSTR RPCRT4_strdupWtoA(LPCWSTR src);
|
|
|
|
|
LPWSTR RPCRT4_strdupAtoW(LPCSTR src);
|
Implemented RpcBindingInqObject, RpcBindingSetObject,
RpcBindingVectorFree, RpcBindingToStringBindingA/W,
RpcBindingFromStringBindingA/W, RpcStringBindingParseA/W,
I_RpcBindingSetAsync, RpcStringBindingComposeA/W, RpcBindingFree,
RPCStringFreeW, UUIDHash, UuidToStringW, and associated junk.
2002-10-07 21:49:49 +00:00
|
|
|
|
void RPCRT4_strfree(LPSTR src);
|
|
|
|
|
|
|
|
|
|
#define RPCRT4_strdupA(x) RPCRT4_strndupA((x),-1)
|
|
|
|
|
#define RPCRT4_strdupW(x) RPCRT4_strndupW((x),-1)
|
|
|
|
|
|
2006-05-18 02:40:42 +00:00
|
|
|
|
ULONG RpcAuthInfo_AddRef(RpcAuthInfo *AuthInfo);
|
|
|
|
|
ULONG RpcAuthInfo_Release(RpcAuthInfo *AuthInfo);
|
2007-06-25 13:27:17 +00:00
|
|
|
|
BOOL RpcAuthInfo_IsEqual(const RpcAuthInfo *AuthInfo1, const RpcAuthInfo *AuthInfo2);
|
2007-01-19 12:59:35 +00:00
|
|
|
|
ULONG RpcQualityOfService_AddRef(RpcQualityOfService *qos);
|
|
|
|
|
ULONG RpcQualityOfService_Release(RpcQualityOfService *qos);
|
2007-06-25 13:27:17 +00:00
|
|
|
|
BOOL RpcQualityOfService_IsEqual(const RpcQualityOfService *qos1, const RpcQualityOfService *qos2);
|
2006-05-18 02:40:42 +00:00
|
|
|
|
|
2007-06-26 21:26:09 +00:00
|
|
|
|
RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server, LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcQualityOfService *QOS);
|
2003-02-19 03:44:35 +00:00
|
|
|
|
RPC_STATUS RPCRT4_DestroyConnection(RpcConnection* Connection);
|
2006-11-08 20:45:19 +00:00
|
|
|
|
RPC_STATUS RPCRT4_OpenClientConnection(RpcConnection* Connection);
|
2003-02-19 03:44:35 +00:00
|
|
|
|
RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection);
|
|
|
|
|
RPC_STATUS RPCRT4_SpawnConnection(RpcConnection** Connection, RpcConnection* OldConnection);
|
|
|
|
|
|
2007-03-26 17:14:27 +00:00
|
|
|
|
RPC_STATUS RPCRT4_ResolveBinding(RpcBinding* Binding, LPCSTR Endpoint);
|
|
|
|
|
RPC_STATUS RPCRT4_SetBindingObject(RpcBinding* Binding, const UUID* ObjectUuid);
|
2003-02-19 03:44:35 +00:00
|
|
|
|
RPC_STATUS RPCRT4_MakeBinding(RpcBinding** Binding, RpcConnection* Connection);
|
2008-04-01 11:48:15 +00:00
|
|
|
|
void RPCRT4_AddRefBinding(RpcBinding* Binding);
|
|
|
|
|
RPC_STATUS RPCRT4_ReleaseBinding(RpcBinding* Binding);
|
2007-08-17 21:10:58 +00:00
|
|
|
|
RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection,
|
|
|
|
|
const RPC_SYNTAX_IDENTIFIER *TransferSyntax, const RPC_SYNTAX_IDENTIFIER *InterfaceId);
|
2003-02-19 03:44:35 +00:00
|
|
|
|
RPC_STATUS RPCRT4_CloseBinding(RpcBinding* Binding, RpcConnection* Connection);
|
Implemented RpcBindingInqObject, RpcBindingSetObject,
RpcBindingVectorFree, RpcBindingToStringBindingA/W,
RpcBindingFromStringBindingA/W, RpcStringBindingParseA/W,
I_RpcBindingSetAsync, RpcStringBindingComposeA/W, RpcBindingFree,
RPCStringFreeW, UUIDHash, UuidToStringW, and associated junk.
2002-10-07 21:49:49 +00:00
|
|
|
|
|
2007-08-17 21:10:58 +00:00
|
|
|
|
static inline const char *rpcrt4_conn_get_name(const RpcConnection *Connection)
|
2006-04-20 12:00:28 +00:00
|
|
|
|
{
|
|
|
|
|
return Connection->ops->name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline int rpcrt4_conn_read(RpcConnection *Connection,
|
|
|
|
|
void *buffer, unsigned int len)
|
|
|
|
|
{
|
|
|
|
|
return Connection->ops->read(Connection, buffer, len);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline int rpcrt4_conn_write(RpcConnection *Connection,
|
|
|
|
|
const void *buffer, unsigned int len)
|
|
|
|
|
{
|
|
|
|
|
return Connection->ops->write(Connection, buffer, len);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline int rpcrt4_conn_close(RpcConnection *Connection)
|
|
|
|
|
{
|
|
|
|
|
return Connection->ops->close(Connection);
|
|
|
|
|
}
|
|
|
|
|
|
2007-11-12 20:10:19 +00:00
|
|
|
|
static inline void rpcrt4_conn_cancel_call(RpcConnection *Connection)
|
|
|
|
|
{
|
|
|
|
|
Connection->ops->cancel_call(Connection);
|
|
|
|
|
}
|
|
|
|
|
|
2006-04-21 06:39:27 +00:00
|
|
|
|
static inline RPC_STATUS rpcrt4_conn_handoff(RpcConnection *old_conn, RpcConnection *new_conn)
|
|
|
|
|
{
|
|
|
|
|
return old_conn->ops->handoff(old_conn, new_conn);
|
|
|
|
|
}
|
|
|
|
|
|
2006-06-01 19:25:06 +00:00
|
|
|
|
/* floors 3 and up */
|
|
|
|
|
RPC_STATUS RpcTransport_GetTopOfTower(unsigned char *tower_data, size_t *tower_size, const char *protseq, const char *networkaddr, const char *endpoint);
|
|
|
|
|
RPC_STATUS RpcTransport_ParseTopOfTower(const unsigned char *tower_data, size_t tower_size, char **protseq, char **networkaddr, char **endpoint);
|
|
|
|
|
|
2007-11-12 20:10:19 +00:00
|
|
|
|
void RPCRT4_SetThreadCurrentConnection(RpcConnection *Connection);
|
2007-12-18 14:55:57 +00:00
|
|
|
|
void RPCRT4_SetThreadCurrentCallHandle(RpcBinding *Binding);
|
|
|
|
|
RpcBinding *RPCRT4_GetThreadCurrentCallHandle(void);
|
2007-12-30 16:44:54 +00:00
|
|
|
|
void RPCRT4_PushThreadContextHandle(NDR_SCONTEXT SContext);
|
|
|
|
|
void RPCRT4_RemoveThreadContextHandle(NDR_SCONTEXT SContext);
|
|
|
|
|
NDR_SCONTEXT RPCRT4_PopThreadContextHandle(void);
|
2007-11-12 20:10:19 +00:00
|
|
|
|
|
Implemented RpcBindingInqObject, RpcBindingSetObject,
RpcBindingVectorFree, RpcBindingToStringBindingA/W,
RpcBindingFromStringBindingA/W, RpcStringBindingParseA/W,
I_RpcBindingSetAsync, RpcStringBindingComposeA/W, RpcBindingFree,
RPCStringFreeW, UUIDHash, UuidToStringW, and associated junk.
2002-10-07 21:49:49 +00:00
|
|
|
|
#endif
|