Platform SDK: Remote Procedure Call |
The RpcServerUseProtseqEx function tells the RPC run-time library to use the specified protocol sequence for receiving remote procedure calls.
RPC_STATUS RPC_ENTRY RpcServerUseProtseqEx( unsigned char *ProtSeq, unsigned int MaxCalls, void *SecurityDescriptor, PRPC_POLICY Policy );
Use RPC_C_PROTSEQ_MAX_REQS_DEFAULT to specify the default value.
Value | Meaning |
---|---|
RPC_S_OK | Call successful. |
RPC_S_PROTSEQ_NOT_SUPPORTED | Protocol sequence is not supported on this host. |
RPC_S_INVALID_RPC_PROTSEQ | Invalid protocol sequence. |
RPC_S_OUT_OF_MEMORY | Out of memory. |
RPC_S_INVALID_SECURITY_DESC | Security descriptor is invalid. |
The parameters and effects of RpcServerUseProtseqEx subsume those of RpcServerUseProtseq. The difference is the Policy field, which allows you to restrict port allocation for dynamic ports and allows multihomed machines to selectively bind to network interface cards.
Setting the NICFlags field of the RPC_POLICY structure to zero makes this extended function functionally equivalent to the original RpcServerUseProtseq, and the server will bind to NICs based on the settings in the system registry. For information, see Configuring the Windows NT and Windows 2000 Registry for Port Allocations and Selective Binding.
Note The flag settings in the Policy field are effective only when the ncacn_ip_tcp or ncadg_ip_udp protocol sequence is in use. For all other protocol sequences, the RPC run time ignores these values.
A server application calls RpcServerUseProtseqEx to register one protocol sequence with the RPC run-time library. To receive remote procedure call requests, a server must register at least one protocol sequence with the RPC run-time library. A server application can call RpcServerUseProtseqEx multiple times to register additional protocol sequences.
For each protocol sequence registered by a server, the RPC run-time library creates one or more binding handles through which the server receives remote procedure call requests. The RPC run-time library creates different binding handles for each protocol sequence. Each binding handle contains an endpoint dynamically generated by the RPC run-time library.
The MaxCalls argument allows the server to specify the maximum number of concurrent remote procedure call requests the server wants to handle. To register all protocol sequences, a server calls RpcServerUseAllProtseqsEx routine.
See Server-Side Binding.
Windows NT/2000: Requires Windows NT 4.0 or later.
Windows 95/98: Unsupported.
Header: Declared in Rpcdce.h.
Library: Use Rpcrt4.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.
Configuring the Windows NT and Windows 2000 Registry for Port Allocations and Selective Binding, RpcServerUseAllProtseqsEx, RpcServerUseAllProtseqsIfEx, RpcServerUseProtseqEpEx, RpcServerUseProtseqIfEx