RPC_POLICY

The RPC_POLICY structure contains flags that determine port allocation and binding to multi-homed machines, over the ncacn_ip_tcp and ncadg_ip_udp protocols, and message queue properties, over the ncadg_mq protocol.

typedef struct _RPC_POLICY {
    unsigned int Length;
    unsigned long EndpointFlags;
    unsigned long NICFlags;
}   RPC_POLICY, __RPC_FAR  *  PRPC_POLICY;
 
Length
The size, in bytes, of the RPC_POLICY structure.
EndpointFlags
A set of flags that determine the attributes of the port or ports where the server receives remote procedure calls. See the following Members section for a description of valid flags.
NICFlags
Controls binding to network interface cards (NICs). See the following Members section for a description of valid flags.

Remarks

You can use the RPC_Policy structure to set policies for remote procedure calls at run time. These policies include:

Note  Port allocation and selective binding policies are effective only for remote calls over TCP (ncacn_ip_tcp) and UDP (ncadg_ip_udp) connections. For more information, see Configuring the Windows NT Registry for Port Allocations and Selective Binding.

Members

The Length member allows compatibility with future versions of this structure, which may contain additional fields. Always set the Length equal to sizeof(RPC_POLICY) when you initialize the RPC_POLICY structure in your code.

The EndpointFlags member controls endpoint assignments. You can specify more than one flag (by OR-ing them) from the set of values for a given protocol sequence. The following table lists the possible values for the EndpointFlags member:

Value Description
0 Specifies the system default
RPC_C_USE_INTERNET_PORT Allocate endpoint from one of the ports defined in the Registry as "Internet Available". Valid only with ncacn_ip_tcp and ncadg_ip_udp protocol sequences.
RPC_C_USE_INTRANET_PORT Allocate endpoint from one of the ports defined in the Registry as "Intranet Available". Valid only with ncacn_ip_tcp and ncadg_ip_udp protocol sequences.
RPC_C_MQ_TEMPORARY The server process receive queue will be deleted automatically when the RPC server exits. Any outstanding calls still in the queue will be lost. This is the default. Valid only with the ncadg_mq protocol sequence.
RPC_C_MQ_PERMANENT Specifies that the server-process receive queue persists after the server process exits. The default is that the queue is deleted when the server process terminates. Valid only with ncadg_mq protocol sequence.
RPC_C_MQ_CLEAR_ON_OPEN If the receive queue already exists because it was opened previously as a permanent queue, then clear any outstanding calls waiting in the queue. Valid only with the ncadg_mq protocol sequence only
RPC_C_MQ_USE_EXISTING
_SECURITY
If the receive queue already exists, then don't modify its existing settings for authentication or encryption. Valid only with the ncadg_mq protocol sequence.
RPC_C_MQ_AUTHENTICATE The server-process receive queue accepts only authenticated calls from clients. The default is that both authenticated and unauthenticated calls are accepted.Valid only with ncadg_mq protocol sequence.
RPC_C_MQ_ENCRYPT Calls to server are encrypted. The default is that both encrypted and unencrypted calls are accepted.. Valid only with ncadg_mq protocol sequence.
RPC_C_MQ_AUTHN_LEVEL
_NONE
The server's receive queue accepts all calls from clients. This is the default authentication level. Valid only with the ncadg_mq protocol.
RPC_C_MQ_AUTHN_LEVEL
_PKT_INTEGRITY
Sets the server's receive queue to only accept client calls which have authentication level RPC_C_AUTHN_LEVEL_PKT_INTEGRITY or RPC_C_AUTHN_LEVEL_PKT_PRIVACY. Valid only with the ncadg_mq protocol sequence.
RPC_C_MQ_AUTHN_LEVEL
_PKT_PRIVACY
Sets the server's receive queue to only accept client calls which have authentication level RPC_C_AUTHN_LEVEL_PKT_PRIVACY. Calls with a lower authentication level are ignored. Valid only with the ncadg_mq protocol sequence.

Note  If the registry does not contain any of the keys that specify the default policies, then the EndpointFlags member will have no effect at run time. If a key is missing or contains an invalid value, then the entire configuration for that protocol (ncacn_ip_tcp/ncadg_ip_udp or ncadg_mq) is marked as invalid and all calls to RpcServerUseProtseq*( ) over that protocol will fail.

The NICFlags member specifies the policy for binding to Network Interface Cards (NICs). The following table lists the possible values for the NICFlags member:

Value Description
0 Bind to NICs on the basis of the registry settings. Always use this value when you are using the RPC_POLICY structure to define message-queue properties.
RPC_C_BIND_TO_ALL_NICS Override the registry settings and bind to all NICs. If the Bind key is missing from the registry, then the NICFlags member will have no effect at run time. If the key contains an invalid value, then the entire configuration is marked as invalid and all calls to RpcServerUseProtseq* will fail.

See Also

RPC Message Queuing, Configuring the Windows NT Registry for Port Allocations and Selective Binding, RpcServerUseAllProtseqsEx, RpcServerUseAllProtseqsIfEx, RpcServerUseProtseqEx, RpcServerUseProtseqEpEx, RpcServerUseProtseqIfEx