Module: wine Branch: master Commit: 8bb10f1082d2ed53243750d1890085c60d559e99 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8bb10f1082d2ed53243750d189...
Author: Rob Shearman rob@codeweavers.com Date: Wed Nov 15 01:01:21 2006 +0000
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 abc3d2f..5fb34b0 100644 --- a/dlls/rpcrt4/rpc_message.c +++ b/dlls/rpcrt4/rpc_message.c @@ -485,8 +485,7 @@ static void RPCRT4_AuthNegotiate(RpcConn 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 *Co 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 8dc78af..4382a8b 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -1309,7 +1309,7 @@ RPC_STATUS RPCRT4_CreateConnection(RpcCo 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);