RpcMgmtInqServerPrincName
The RpcMgmtInqServerPrincName
function returns a server s principal name.
This function
is supported by both 32-bit platforms Windows NT and Windows 95. Note that it is supported only in ANSI on
Windows 95.
#include <rpc.h>
RPC_STATUS RPC_ENTRY RpcMgmtInqServerPrincName(
RPC_BINDING_HANDLE Binding, |
|
unsigned int AuthnSvc, |
|
unsigned char * * ServerPrincName |
|
); |
|
Parameters
Binding
To receive
the principal name for a server, specify a server binding handle for that
server. To receive the principal name for your own (local) application, specify
a value of NULL.
AuthnSvc
Specifies the
authentication service for which a principal name is returned. Possible values
are as follows:
Value |
Description |
RPC_C_AUTHN_NONE |
No
authentication |
RPC_C_AUTHN_WINNT |
Windows NT
authentication service |
ServerPrincName
Returns a
principal name that is registered for the authentication service in AuthnSvc
by the server referenced in Binding. If multiple names are registered,
only one name is returned.
Remarks
An
application calls the RpcMgmtInqServerPrincName routine to obtain the
principal name of a server that is registered for a specified authentication
service.
The RPC
run-time library allocates memory for string returned in ServerPrincName.
The application is responsible for calling the RpcStringFree routine to
release the memory used by this routine.
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 |