Rob Shearman : rpcrt4:
Store the assoc_group_id field returned from the bind_ack packet and
use it when creating further connections in the association group .
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Jun 26 07:11:46 CDT 2007
Module: wine
Branch: master
Commit: 0ebcacca3922bea02fa7456fed2b07b1df6e133a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0ebcacca3922bea02fa7456fed2b07b1df6e133a
Author: Rob Shearman <rob at codeweavers.com>
Date: Mon Jun 25 14:26:23 2007 +0100
rpcrt4: Store the assoc_group_id field returned from the bind_ack packet and use it when creating further connections in the association group.
---
dlls/rpcrt4/rpc_binding.c | 1 +
dlls/rpcrt4/rpc_binding.h | 4 ++++
dlls/rpcrt4/rpc_message.c | 2 ++
dlls/rpcrt4/rpc_message.h | 2 +-
dlls/rpcrt4/rpc_transport.c | 2 ++
5 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/dlls/rpcrt4/rpc_binding.c b/dlls/rpcrt4/rpc_binding.c
index 4f276ae..56dcc9e 100644
--- a/dlls/rpcrt4/rpc_binding.c
+++ b/dlls/rpcrt4/rpc_binding.c
@@ -312,6 +312,7 @@ RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection,
hdr = RPCRT4_BuildBindHeader(NDR_LOCAL_DATA_REPRESENTATION,
RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE,
+ Binding->Assoc->assoc_group_id,
InterfaceId, TransferSyntax);
status = RPCRT4_Send(NewConnection, hdr, NULL, 0);
diff --git a/dlls/rpcrt4/rpc_binding.h b/dlls/rpcrt4/rpc_binding.h
index 6dde2ae..127a2cf 100644
--- a/dlls/rpcrt4/rpc_binding.h
+++ b/dlls/rpcrt4/rpc_binding.h
@@ -55,6 +55,9 @@ typedef struct _RpcAssoc
LPWSTR NetworkOptions;
RpcAuthInfo *AuthInfo;
+ /* id of this association group */
+ ULONG assoc_group_id;
+
CRITICAL_SECTION cs;
struct list connection_pool;
} RpcAssoc;
@@ -86,6 +89,7 @@ typedef struct _RpcConnection
/* client-only */
struct list conn_pool_entry;
+ ULONG assoc_group_id; /* association group returned during binding */
} RpcConnection;
struct connection_ops {
diff --git a/dlls/rpcrt4/rpc_message.c b/dlls/rpcrt4/rpc_message.c
index 8ff2e15..bdd9d12 100644
--- a/dlls/rpcrt4/rpc_message.c
+++ b/dlls/rpcrt4/rpc_message.c
@@ -177,6 +177,7 @@ RpcPktHdr *RPCRT4_BuildFaultHeader(unsigned long DataRepresentation,
RpcPktHdr *RPCRT4_BuildBindHeader(unsigned long DataRepresentation,
unsigned short MaxTransmissionSize,
unsigned short MaxReceiveSize,
+ unsigned long AssocGroupId,
RPC_SYNTAX_IDENTIFIER *AbstractId,
RPC_SYNTAX_IDENTIFIER *TransferId)
{
@@ -191,6 +192,7 @@ RpcPktHdr *RPCRT4_BuildBindHeader(unsigned long DataRepresentation,
header->common.frag_len = sizeof(header->bind);
header->bind.max_tsize = MaxTransmissionSize;
header->bind.max_rsize = MaxReceiveSize;
+ header->bind.assoc_gid = AssocGroupId;
header->bind.num_elements = 1;
header->bind.num_syntaxes = 1;
memcpy(&header->bind.abstract, AbstractId, sizeof(RPC_SYNTAX_IDENTIFIER));
diff --git a/dlls/rpcrt4/rpc_message.h b/dlls/rpcrt4/rpc_message.h
index 97defb3..7246592 100644
--- a/dlls/rpcrt4/rpc_message.h
+++ b/dlls/rpcrt4/rpc_message.h
@@ -25,7 +25,7 @@
#include "rpc_defs.h"
RpcPktHdr *RPCRT4_BuildFaultHeader(unsigned long DataRepresentation, RPC_STATUS Status);
-RpcPktHdr *RPCRT4_BuildBindHeader(unsigned long DataRepresentation, unsigned short MaxTransmissionSize, unsigned short MaxReceiveSize, RPC_SYNTAX_IDENTIFIER *AbstractId, RPC_SYNTAX_IDENTIFIER *TransferId);
+RpcPktHdr *RPCRT4_BuildBindHeader(unsigned long DataRepresentation, unsigned short MaxTransmissionSize, unsigned short MaxReceiveSize, unsigned long AssocGroupId, RPC_SYNTAX_IDENTIFIER *AbstractId, RPC_SYNTAX_IDENTIFIER *TransferId);
RpcPktHdr *RPCRT4_BuildBindNackHeader(unsigned long DataRepresentation, unsigned char RpcVersion, unsigned char RpcVersionMinor);
RpcPktHdr *RPCRT4_BuildBindAckHeader(unsigned long DataRepresentation, unsigned short MaxTransmissionSize, unsigned short MaxReceiveSize, LPSTR ServerAddress, unsigned long Result, unsigned long Reason, RPC_SYNTAX_IDENTIFIER *TransferId);
VOID RPCRT4_FreeHeader(RpcPktHdr *Header);
diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c
index c3d1ef3..1ff9cfd 100644
--- a/dlls/rpcrt4/rpc_transport.c
+++ b/dlls/rpcrt4/rpc_transport.c
@@ -1432,6 +1432,7 @@ RPC_STATUS RPCRT4_GetAssociation(LPCSTR Protseq, LPCSTR NetworkAddr,
assoc->NetworkAddr = RPCRT4_strdupA(NetworkAddr);
assoc->Endpoint = RPCRT4_strdupA(Endpoint);
assoc->NetworkOptions = NetworkOptions ? RPCRT4_strdupW(NetworkOptions) : NULL;
+ assoc->assoc_group_id = 0;
list_add_head(&assoc_list, &assoc->entry);
*assoc_out = assoc;
@@ -1503,6 +1504,7 @@ void RpcAssoc_ReleaseIdleConnection(RpcAssoc *assoc, RpcConnection *Connection)
{
assert(!Connection->server);
EnterCriticalSection(&assoc->cs);
+ if (!assoc->assoc_group_id) assoc->assoc_group_id = Connection->assoc_group_id;
list_add_head(&assoc->connection_pool, &Connection->conn_pool_entry);
LeaveCriticalSection(&assoc->cs);
}
More information about the wine-cvs
mailing list