rpcrt4: Handle NULL binding in RpcBindingInqAuthClient{,Ex}.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2016-11-22 16:27:06 +01:00 committed by Alexandre Julliard
parent 786633e311
commit f8450fae23
2 changed files with 14 additions and 1 deletions

View File

@ -1621,11 +1621,15 @@ RpcBindingInqAuthClientExW( RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *
RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc,
ULONG *AuthzSvc, ULONG Flags ) ULONG *AuthzSvc, ULONG Flags )
{ {
RpcBinding *bind = ClientBinding; RpcBinding *bind;
TRACE("%p %p %p %p %p %p 0x%x\n", ClientBinding, Privs, ServerPrincName, AuthnLevel, TRACE("%p %p %p %p %p %p 0x%x\n", ClientBinding, Privs, ServerPrincName, AuthnLevel,
AuthnSvc, AuthzSvc, Flags); AuthnSvc, AuthzSvc, Flags);
if (!ClientBinding) ClientBinding = I_RpcGetCurrentCallHandle();
if (!ClientBinding) return RPC_S_INVALID_BINDING;
bind = ClientBinding;
if (!bind->FromConn) return RPC_S_INVALID_BINDING; if (!bind->FromConn) return RPC_S_INVALID_BINDING;
return rpcrt4_conn_inquire_auth_client(bind->FromConn, Privs, return rpcrt4_conn_inquire_auth_client(bind->FromConn, Privs,

View File

@ -1525,6 +1525,15 @@ void __cdecl s_authinfo_test(unsigned int protseq, int secure)
} }
ok(level == RPC_C_AUTHN_LEVEL_PKT_PRIVACY, "level unchanged\n"); ok(level == RPC_C_AUTHN_LEVEL_PKT_PRIVACY, "level unchanged\n");
ok(authnsvc == RPC_C_AUTHN_WINNT, "authnsvc unchanged\n"); ok(authnsvc == RPC_C_AUTHN_WINNT, "authnsvc unchanged\n");
RpcStringFreeA(&principal);
status = RpcBindingInqAuthClientA(NULL, &privs, &principal, &level, &authnsvc, NULL);
ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);
RpcStringFreeA(&principal);
status = RpcBindingInqAuthClientExA(NULL, &privs, &principal, &level, &authnsvc, NULL, 0);
ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);
RpcStringFreeA(&principal);
status = RpcImpersonateClient(NULL); status = RpcImpersonateClient(NULL);
ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status); ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);