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 ...@@ -67,6 +67,7 @@ typedef struct _RpcConnection
TimeStamp exp; TimeStamp exp;
ULONG attr; ULONG attr;
RpcAuthInfo *AuthInfo; RpcAuthInfo *AuthInfo;
ULONG auth_context_id;
ULONG encryption_auth_len; ULONG encryption_auth_len;
ULONG signature_auth_len; ULONG signature_auth_len;
RpcQualityOfService *QOS; RpcQualityOfService *QOS;
......
...@@ -813,14 +813,13 @@ static RPC_STATUS RPCRT4_SendWithAuth(RpcConnection *Connection, RpcPktHdr *Head ...@@ -813,14 +813,13 @@ static RPC_STATUS RPCRT4_SendWithAuth(RpcConnection *Connection, RpcPktHdr *Head
if (Connection->AuthInfo && packet_has_auth_verifier(Header)) if (Connection->AuthInfo && packet_has_auth_verifier(Header))
{ {
RpcAuthVerifier *auth_hdr = (RpcAuthVerifier *)&pkt[Header->common.frag_len - alen]; RpcAuthVerifier *auth_hdr = (RpcAuthVerifier *)&pkt[Header->common.frag_len - alen];
static LONG next_id;
auth_hdr->auth_type = Connection->AuthInfo->AuthnSvc; auth_hdr->auth_type = Connection->AuthInfo->AuthnSvc;
auth_hdr->auth_level = Connection->AuthInfo->AuthnLevel; auth_hdr->auth_level = Connection->AuthInfo->AuthnLevel;
auth_hdr->auth_pad_length = auth_pad_len; auth_hdr->auth_pad_length = auth_pad_len;
auth_hdr->auth_reserved = 0; auth_hdr->auth_reserved = 0;
/* a unique number... */ /* a unique number... */
auth_hdr->auth_context_id = InterlockedIncrement(&next_id); auth_hdr->auth_context_id = Connection->auth_context_id;
if (AuthLength) if (AuthLength)
memcpy(auth_hdr + 1, Auth, AuthLength); memcpy(auth_hdr + 1, Auth, AuthLength);
......
...@@ -2800,6 +2800,7 @@ RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server, ...@@ -2800,6 +2800,7 @@ RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server,
LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint,
LPCWSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcQualityOfService *QOS) LPCWSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcQualityOfService *QOS)
{ {
static LONG next_id;
const struct connection_ops *ops; const struct connection_ops *ops;
RpcConnection* NewConnection; RpcConnection* NewConnection;
...@@ -2827,6 +2828,7 @@ RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server, ...@@ -2827,6 +2828,7 @@ RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server,
NewConnection->attr = 0; NewConnection->attr = 0;
if (AuthInfo) RpcAuthInfo_AddRef(AuthInfo); if (AuthInfo) RpcAuthInfo_AddRef(AuthInfo);
NewConnection->AuthInfo = AuthInfo; NewConnection->AuthInfo = AuthInfo;
NewConnection->auth_context_id = InterlockedIncrement( &next_id );
NewConnection->encryption_auth_len = 0; NewConnection->encryption_auth_len = 0;
NewConnection->signature_auth_len = 0; NewConnection->signature_auth_len = 0;
if (QOS) RpcQualityOfService_AddRef(QOS); 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