RpcBindingSetAuthInfoEx

The RpcBindingSetAuthInfoEx function sets authentication, authorization, and security quality-of-service information into a binding handle.

Windows NT: 4.0 (limited functionality), 5.0 (full functionality).
Windows: Windows 95 (clients)
Import Library: RPCRT4.LIB

#include <rpc.h>
RPC_STATUS RPC_ENTRY RpcBindingSetAuthInfoEx( 
  RPC_BINDING_HANDLE  Binding,            
  unsigned char PAPI * ServerPrincName,   
  unsigned long  AuthnLevel,              
  unsigned long  AuthnSvc,                
  RPC_AUTH_IDENTITY_HANDLE  AuthIdentity,   
  unsigned long  AuthzSvc,                
  RPC_SECURITY_QOS * SecurityQOS          
); 
 

Parameters

Binding
Specifies the server binding handle into which authentication and authorization information is set.
ServerPrincName
Pointer to the expected principal name of the server referenced by Binding. The content of the name and its syntax are defined by the authentication service in use.
AuthnLevel
Specifies the level of authentication to be performed on remote procedure calls made using Binding. For a list of the RPC-supported authentication levels, see Authentication-Level Constants.
AuthnSvc
Specifies the authentication service to use. For a list of the RPC-supported authentication services, see Authentication-Service Constants.

Specify RPC_C_AUTHN_NONE to turn off authentication for remote procedure calls made using Binding.

If RPC_C_AUTHN_DEFAULT is specified, the RPC run-time library uses the RPC_C_AUTHN_WINNT authentication service for remote procedure calls made using Binding.

AuthIdentity
Specifies a handle for the data structure that contains the client's authentication and authorization credentials appropriate for the selected authentication and authorization service.

When using the RPC_C_AUTHN.WINNT authentication service AuthIdentity should be a pointer to a SEC_WINNT_AUTH_IDENTITY structure (defined in rpcdce.h).

Specify a null value to use the security login context for the current address space.

AuthzSvc
Specifies the authorization service implemented by the server for the interface of interest. The validity and trustworthiness of authorization data, like any application data, depends on the authentication service and authentication level selected. This parameter is ignored when using the RPC_C_AUTHN_WINNT authentication service.

For a list of the RPC-supported authentication services, see Authentication-Service Constants.

SecurityQOS
Pointer to the RPC_SECURITY_QOS structure, which defines the security quality of service.

Return Values

Value Meaning
RPC_S_OK Success.
RPC_S_INVALID_BINDING Invalid binding handle.
RPC_S_WRONG_KIND_OF_BINDING Wrong kind of binding for operation.
RPC_S_UNKNOWN_AUTHN_SERVICE Unknown authentication service.

Remarks

A client application calls the RpcBindingSetAuthInfoEx function to set up a server binding handle for making authenticated remote procedure calls. This function provides the capability to set security quality-of-service information on the binding handle. It is otherwise identical to RpcBindingSetAuthInfo.

Unless a client calls RpcBindingSetAuthInfoEx, all remote procedure calls on Binding are unauthenticated. A client is not required to call this routine.

Note  As long as the binding handle exists, RPC maintains a pointer to AuthIdentity. Be sure it is not on the stack and is not freed until the binding handle is freed. If the binding handle is copied, or if a context handle is created from the binding handle, then the AuthIdentity pointer will also be copied.

See Also

RPC_SECURITY_QOS, RpcBindingInqAuthInfoEx, RpcServerRegisterAuthInfo