rpcrt4: Use SecInvalidateHandle and SecIsValidHandle for handling RpcConnection::ctx instead of setting/comparing the field to 0.

This commit is contained in:
Rob Shearman 2006-11-15 01:01:21 +00:00 committed by Alexandre Julliard
parent 51dd6f9fb8
commit 8bb10f1082
2 changed files with 3 additions and 4 deletions

View file

@ -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);
}

View file

@ -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);