Implemented RpcBindingInqObject, RpcBindingSetObject,
RpcBindingVectorFree, RpcBindingToStringBindingA/W,
RpcBindingFromStringBindingA/W, RpcStringBindingParseA/W,
I_RpcBindingSetAsync, RpcStringBindingComposeA/W, RpcBindingFree,
RPCStringFreeW, UUIDHash, UuidToStringW, and associated junk.
2002-10-07 23:49:49 +02: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 14:49:52 +02: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 23:49:49 +02:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __WINE_RPC_BINDING_H
|
|
|
|
|
#define __WINE_RPC_BINDING_H
|
|
|
|
|
|
2002-12-02 22:17:04 +01:00
|
|
|
|
#include "wine/rpcss_shared.h"
|
2006-05-15 16:04:25 +02:00
|
|
|
|
#include "security.h"
|
2006-06-07 21:12:34 +02:00
|
|
|
|
#include "wine/list.h"
|
2002-12-02 22:17:04 +01:00
|
|
|
|
|
2006-05-18 04:40:42 +02:00
|
|
|
|
|
|
|
|
|
typedef struct _RpcAuthInfo
|
|
|
|
|
{
|
|
|
|
|
LONG refs;
|
|
|
|
|
|
|
|
|
|
unsigned long AuthnLevel;
|
|
|
|
|
unsigned long AuthnSvc;
|
|
|
|
|
CredHandle cred;
|
|
|
|
|
TimeStamp exp;
|
|
|
|
|
} RpcAuthInfo;
|
|
|
|
|
|
2006-10-16 17:47:39 +02:00
|
|
|
|
struct connection_ops;
|
2006-04-20 14:00:28 +02:00
|
|
|
|
|
2003-02-19 04:44:35 +01:00
|
|
|
|
typedef struct _RpcConnection
|
|
|
|
|
{
|
|
|
|
|
struct _RpcConnection* Next;
|
|
|
|
|
struct _RpcBinding* Used;
|
|
|
|
|
BOOL server;
|
|
|
|
|
LPSTR NetworkAddr;
|
|
|
|
|
LPSTR Endpoint;
|
2006-10-16 17:47:39 +02:00
|
|
|
|
const struct connection_ops *ops;
|
2004-04-27 01:33:39 +02:00
|
|
|
|
USHORT MaxTransmissionSize;
|
|
|
|
|
/* The active interface bound to server. */
|
|
|
|
|
RPC_SYNTAX_IDENTIFIER ActiveInterface;
|
2006-05-18 04:39:42 +02:00
|
|
|
|
USHORT NextCallId;
|
2006-05-15 16:04:25 +02:00
|
|
|
|
|
|
|
|
|
/* authentication */
|
|
|
|
|
CtxtHandle ctx;
|
|
|
|
|
TimeStamp exp;
|
|
|
|
|
ULONG attr;
|
2006-05-18 04:40:42 +02:00
|
|
|
|
RpcAuthInfo *AuthInfo;
|
2006-06-07 21:12:34 +02:00
|
|
|
|
|
|
|
|
|
/* client-only */
|
|
|
|
|
struct list conn_pool_entry;
|
2003-02-19 04:44:35 +01:00
|
|
|
|
} RpcConnection;
|
|
|
|
|
|
2006-10-16 17:47:39 +02:00
|
|
|
|
struct connection_ops {
|
2006-06-01 21:25:06 +02: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 08:40:06 +02:00
|
|
|
|
RpcConnection *(*alloc)(void);
|
2006-11-08 21:45:19 +01:00
|
|
|
|
RPC_STATUS (*open_connection_client)(RpcConnection *conn);
|
2006-04-21 08:39:27 +02:00
|
|
|
|
RPC_STATUS (*handoff)(RpcConnection *old_conn, RpcConnection *new_conn);
|
2006-04-20 14:00:28 +02:00
|
|
|
|
int (*read)(RpcConnection *conn, void *buffer, unsigned int len);
|
|
|
|
|
int (*write)(RpcConnection *conn, const void *buffer, unsigned int len);
|
|
|
|
|
int (*close)(RpcConnection *conn);
|
2006-06-01 21:25:06 +02: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 14:00:28 +02: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 23:49:49 +02:00
|
|
|
|
/* don't know what MS's structure looks like */
|
|
|
|
|
typedef struct _RpcBinding
|
|
|
|
|
{
|
2005-07-13 13:59:15 +02:00
|
|
|
|
LONG refs;
|
2003-02-19 04:44:35 +01: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 23:49:49 +02:00
|
|
|
|
BOOL server;
|
|
|
|
|
UUID ObjectUuid;
|
|
|
|
|
LPSTR Protseq;
|
|
|
|
|
LPSTR NetworkAddr;
|
|
|
|
|
LPSTR Endpoint;
|
|
|
|
|
RPC_BLOCKING_FN BlockingFn;
|
|
|
|
|
ULONG ServerTid;
|
2003-02-19 04:44:35 +01:00
|
|
|
|
RpcConnection* FromConn;
|
2006-05-15 16:04:25 +02:00
|
|
|
|
|
|
|
|
|
/* authentication */
|
2006-05-18 04:40:42 +02:00
|
|
|
|
RpcAuthInfo *AuthInfo;
|
Implemented RpcBindingInqObject, RpcBindingSetObject,
RpcBindingVectorFree, RpcBindingToStringBindingA/W,
RpcBindingFromStringBindingA/W, RpcStringBindingParseA/W,
I_RpcBindingSetAsync, RpcStringBindingComposeA/W, RpcBindingFree,
RPCStringFreeW, UUIDHash, UuidToStringW, and associated junk.
2002-10-07 23:49:49 +02:00
|
|
|
|
} RpcBinding;
|
|
|
|
|
|
2003-10-08 00:54:17 +02:00
|
|
|
|
LPSTR RPCRT4_strndupA(LPCSTR src, INT len);
|
Implemented RpcBindingInqObject, RpcBindingSetObject,
RpcBindingVectorFree, RpcBindingToStringBindingA/W,
RpcBindingFromStringBindingA/W, RpcStringBindingParseA/W,
I_RpcBindingSetAsync, RpcStringBindingComposeA/W, RpcBindingFree,
RPCStringFreeW, UUIDHash, UuidToStringW, and associated junk.
2002-10-07 23:49:49 +02:00
|
|
|
|
LPWSTR RPCRT4_strndupW(LPWSTR src, INT len);
|
|
|
|
|
LPSTR RPCRT4_strdupWtoA(LPWSTR src);
|
|
|
|
|
LPWSTR RPCRT4_strdupAtoW(LPSTR src);
|
|
|
|
|
void RPCRT4_strfree(LPSTR src);
|
|
|
|
|
|
|
|
|
|
#define RPCRT4_strdupA(x) RPCRT4_strndupA((x),-1)
|
|
|
|
|
#define RPCRT4_strdupW(x) RPCRT4_strndupW((x),-1)
|
|
|
|
|
|
2006-05-18 04:40:42 +02:00
|
|
|
|
ULONG RpcAuthInfo_AddRef(RpcAuthInfo *AuthInfo);
|
|
|
|
|
ULONG RpcAuthInfo_Release(RpcAuthInfo *AuthInfo);
|
|
|
|
|
|
2006-06-07 21:12:34 +02:00
|
|
|
|
RpcConnection *RPCRT4_GetIdleConnection(const RPC_SYNTAX_IDENTIFIER *InterfaceId, const RPC_SYNTAX_IDENTIFIER *TransferSyntax, LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, RpcAuthInfo* AuthInfo);
|
|
|
|
|
void RPCRT4_ReleaseIdleConnection(RpcConnection *Connection);
|
2006-05-18 04:40:42 +02:00
|
|
|
|
RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server, LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcBinding* Binding);
|
2003-02-19 04:44:35 +01:00
|
|
|
|
RPC_STATUS RPCRT4_DestroyConnection(RpcConnection* Connection);
|
2006-11-08 21:45:19 +01:00
|
|
|
|
RPC_STATUS RPCRT4_OpenClientConnection(RpcConnection* Connection);
|
2003-02-19 04:44:35 +01:00
|
|
|
|
RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection);
|
|
|
|
|
RPC_STATUS RPCRT4_SpawnConnection(RpcConnection** Connection, RpcConnection* OldConnection);
|
|
|
|
|
|
Implemented RpcBindingInqObject, RpcBindingSetObject,
RpcBindingVectorFree, RpcBindingToStringBindingA/W,
RpcBindingFromStringBindingA/W, RpcStringBindingParseA/W,
I_RpcBindingSetAsync, RpcStringBindingComposeA/W, RpcBindingFree,
RPCStringFreeW, UUIDHash, UuidToStringW, and associated junk.
2002-10-07 23:49:49 +02:00
|
|
|
|
RPC_STATUS RPCRT4_CreateBindingA(RpcBinding** Binding, BOOL server, LPSTR Protseq);
|
|
|
|
|
RPC_STATUS RPCRT4_CreateBindingW(RpcBinding** Binding, BOOL server, LPWSTR Protseq);
|
|
|
|
|
RPC_STATUS RPCRT4_CompleteBindingA(RpcBinding* Binding, LPSTR NetworkAddr, LPSTR Endpoint, LPSTR NetworkOptions);
|
|
|
|
|
RPC_STATUS RPCRT4_CompleteBindingW(RpcBinding* Binding, LPWSTR NetworkAddr, LPWSTR Endpoint, LPWSTR NetworkOptions);
|
|
|
|
|
RPC_STATUS RPCRT4_ResolveBinding(RpcBinding* Binding, LPSTR Endpoint);
|
|
|
|
|
RPC_STATUS RPCRT4_SetBindingObject(RpcBinding* Binding, UUID* ObjectUuid);
|
2003-02-19 04:44:35 +01:00
|
|
|
|
RPC_STATUS RPCRT4_MakeBinding(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 23:49:49 +02:00
|
|
|
|
RPC_STATUS RPCRT4_ExportBinding(RpcBinding** Binding, RpcBinding* OldBinding);
|
|
|
|
|
RPC_STATUS RPCRT4_DestroyBinding(RpcBinding* Binding);
|
2004-04-27 01:33:39 +02:00
|
|
|
|
RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection, PRPC_SYNTAX_IDENTIFIER TransferSyntax, PRPC_SYNTAX_IDENTIFIER InterfaceId);
|
2003-02-19 04:44:35 +01:00
|
|
|
|
RPC_STATUS RPCRT4_CloseBinding(RpcBinding* Binding, RpcConnection* Connection);
|
2002-12-02 22:17:04 +01:00
|
|
|
|
BOOL RPCRT4_RPCSSOnDemandCall(PRPCSS_NP_MESSAGE msg, char *vardata_payload, PRPCSS_NP_REPLY reply);
|
|
|
|
|
HANDLE RPCRT4_GetMasterMutex(void);
|
|
|
|
|
HANDLE RPCRT4_RpcssNPConnect(void);
|
Implemented RpcBindingInqObject, RpcBindingSetObject,
RpcBindingVectorFree, RpcBindingToStringBindingA/W,
RpcBindingFromStringBindingA/W, RpcStringBindingParseA/W,
I_RpcBindingSetAsync, RpcStringBindingComposeA/W, RpcBindingFree,
RPCStringFreeW, UUIDHash, UuidToStringW, and associated junk.
2002-10-07 23:49:49 +02:00
|
|
|
|
|
2006-04-20 14:00:28 +02:00
|
|
|
|
static inline const char *rpcrt4_conn_get_name(RpcConnection *Connection)
|
|
|
|
|
{
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
2006-04-21 08:39:27 +02: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 21:25:06 +02: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);
|
|
|
|
|
|
Implemented RpcBindingInqObject, RpcBindingSetObject,
RpcBindingVectorFree, RpcBindingToStringBindingA/W,
RpcBindingFromStringBindingA/W, RpcStringBindingParseA/W,
I_RpcBindingSetAsync, RpcStringBindingComposeA/W, RpcBindingFree,
RPCStringFreeW, UUIDHash, UuidToStringW, and associated junk.
2002-10-07 23:49:49 +02:00
|
|
|
|
#endif
|