RpcMgmtInqServerPrincName function (rpcdce.h)
The RpcMgmtInqServerPrincName function returns a server's principal name.
Syntax
RPC_STATUS RpcMgmtInqServerPrincName(
RPC_BINDING_HANDLE Binding,
unsigned long AuthnSvc,
RPC_WSTR *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
Authentication service for which a principal name is returned. Valid values are the constant for any valid security provider.
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.
Return value
Value | Meaning |
---|---|
|
The call succeeded. |
|
The binding handle was invalid. |
|
This was the wrong kind of binding for the operation. |
Remarks
An application calls the RpcMgmtInqServerPrincName function to obtain the principal name of a server that is registered for a specified authentication service.
The RPC run-time library allocates memory for the string returned in ServerPrincName. The application is responsible for calling the RpcStringFree function to release the memory used by this function.
The server must be listening for remote procedure calls for this function to succeed. If the server is not listening, the function fails.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps | UWP apps] |
Minimum supported server | Windows 2000 Server [desktop apps | UWP apps] |
Target Platform | Windows |
Header | rpcdce.h (include Rpc.h) |
Library | Rpcrt4.lib |
DLL | Rpcrt4.dll |