Commit e01420d7 authored by Alexandre Julliard's avatar Alexandre Julliard

rpcrt4: Assign a unique id to the connection instead of changing it for each message.

parent d5ecc2d0
......@@ -67,6 +67,7 @@ typedef struct _RpcConnection
TimeStamp exp;
ULONG attr;
RpcAuthInfo *AuthInfo;
ULONG auth_context_id;
ULONG encryption_auth_len;
ULONG signature_auth_len;
RpcQualityOfService *QOS;
......
......@@ -813,14 +813,13 @@ static RPC_STATUS RPCRT4_SendWithAuth(RpcConnection *Connection, RpcPktHdr *Head
if (Connection->AuthInfo && packet_has_auth_verifier(Header))
{
RpcAuthVerifier *auth_hdr = (RpcAuthVerifier *)&pkt[Header->common.frag_len - alen];
static LONG next_id;
auth_hdr->auth_type = Connection->AuthInfo->AuthnSvc;
auth_hdr->auth_level = Connection->AuthInfo->AuthnLevel;
auth_hdr->auth_pad_length = auth_pad_len;
auth_hdr->auth_reserved = 0;
/* a unique number... */
auth_hdr->auth_context_id = InterlockedIncrement(&next_id);
auth_hdr->auth_context_id = Connection->auth_context_id;
if (AuthLength)
memcpy(auth_hdr + 1, Auth, AuthLength);
......
......@@ -2800,6 +2800,7 @@ RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server,
LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint,
LPCWSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcQualityOfService *QOS)
{
static LONG next_id;
const struct connection_ops *ops;
RpcConnection* NewConnection;
......@@ -2827,6 +2828,7 @@ RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server,
NewConnection->attr = 0;
if (AuthInfo) RpcAuthInfo_AddRef(AuthInfo);
NewConnection->AuthInfo = AuthInfo;
NewConnection->auth_context_id = InterlockedIncrement( &next_id );
NewConnection->encryption_auth_len = 0;
NewConnection->signature_auth_len = 0;
if (QOS) RpcQualityOfService_AddRef(QOS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment