A server application calls the RpcBindingInqAuthClient routine to obtain the principal name or privilege attributes of the authenticated client that made the remote procedure call.
#include <rpc.h>
RPC_STATUS RPC_ENTRY RpcBindingInqAuthClient(
RPC_BINDING_HANDLE ClientBinding,
RPC_AUTHZ_HANDLE * Privs,
unsigned char * * ServerPrincName,
unsigned long * AuthnLevel,
unsigned long * AuthnSvc,
unsigned long * AuthzSvc
);
The server application must cast the ClientBinding binding handle to the data type specified by the AuthzSvc argument. The data referenced by this argument is read-only and should not be modified by the server application. If the server wants to preserve any of the returned data, the server must copy the data into server-allocated memory. This parameter is not used by the RPC_C_AUTHN_WINNT authentication service. The returned pointer will always be NULL.
Specify a null value to prevent RpcBindingInqAuthClient from returning the ServerPrincName argument. In this case, the application does not call the RpcStringFree routine.
Specify a null value to prevent RpcBindingInqAuthClient from returning the AuthnLevel argument.
Specify a null value to prevent RpcBindingInqAuthClient from returning the AuthzSvc argument. This parameter is not used by the RPC_C_AUTHN_WINNT authentication service. The returned value will always be RPC_S_AUTHZ_NONE.
A server application calls the RpcBindingInqAuthClient routine to obtain the principal name or privilege attributes of the authenticated client that made the remote procedure call. In addition, RpcBindingInqAuthClient returns the authentication service, authentication level, and server principal name specified by the client. The server can use the returned data for authorization purposes.
The RPC run-time library allocates memory for the returned ServerPrincName argument. The application is responsible for calling the RpcStringFree routine for the returned argument string.
For clients using the MIDL auto_handle or implicit_handle attribute, the server application should use zero as the value for the ClientBinding parameter. Using zero retrieves the authentication and authorization information from the currently executing remote procedure call.
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_BINDING_HAS_NO_AUTH | Binding has no authentication information |
Windows NT: Yes
Windows CE: Unsupported.
Header: Declared in rpcdce.h.
Import Library: Link with rpcrt4.lib.
RpcBindingSetAuthInfo, RpcStringFree