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
);
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.
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.
For a list of the RPC-supported authentication services, see Authentication-Service Constants.
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. |
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.
RPC_SECURITY_QOS, RpcBindingInqAuthInfoEx, RpcServerRegisterAuthInfo