From 8bb10f1082d2ed53243750d1890085c60d559e99 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Wed, 15 Nov 2006 01:01:21 +0000 Subject: [PATCH] rpcrt4: Use SecInvalidateHandle and SecIsValidHandle for handling RpcConnection::ctx instead of setting/comparing the field to 0. --- dlls/rpcrt4/rpc_message.c | 5 ++--- dlls/rpcrt4/rpc_transport.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/rpcrt4/rpc_message.c b/dlls/rpcrt4/rpc_message.c index abc3d2fcf78..5fb34b0c0d3 100644 --- a/dlls/rpcrt4/rpc_message.c +++ b/dlls/rpcrt4/rpc_message.c @@ -485,8 +485,7 @@ static void RPCRT4_AuthNegotiate(RpcConnection *conn, SecBuffer *out) out_desc.pBuffers = out; conn->attr = 0; - conn->ctx.dwLower = 0; - conn->ctx.dwUpper = 0; + SecInvalidateHandle(&conn->ctx); r = InitializeSecurityContextA(&conn->AuthInfo->cred, NULL, NULL, context_req, 0, SECURITY_NETWORK_DREP, @@ -567,7 +566,7 @@ RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header, if (!Connection->AuthInfo || Connection->AuthInfo->AuthnLevel == RPC_C_AUTHN_LEVEL_DEFAULT || Connection->AuthInfo->AuthnLevel == RPC_C_AUTHN_LEVEL_NONE || - (Connection->ctx.dwUpper || Connection->ctx.dwLower)) + SecIsValidHandle(&Connection->ctx)) { return RPCRT4_SendAuth(Connection, Header, Buffer, BufferLength, NULL, 0); } diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index 8dc78af375a..4382a8be0fc 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -1309,7 +1309,7 @@ RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server, memset(&NewConnection->ActiveInterface, 0, sizeof(NewConnection->ActiveInterface)); NewConnection->NextCallId = 1; - memset(&NewConnection->ctx, 0, sizeof(NewConnection->ctx)); + SecInvalidateHandle(&NewConnection->ctx); if (AuthInfo) RpcAuthInfo_AddRef(AuthInfo); NewConnection->AuthInfo = AuthInfo; list_init(&NewConnection->conn_pool_entry); -- 2.11.4.GIT