Commit 8bb10f10 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

rpcrt4: Use SecInvalidateHandle and SecIsValidHandle for handling…

rpcrt4: Use SecInvalidateHandle and SecIsValidHandle for handling RpcConnection::ctx instead of setting/comparing the field to 0.
parent 51dd6f9f
......@@ -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);
}
......
......@@ -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);
......
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