Configuring the Windows NT Registry for Port Allocations and Selective Binding

The following registry keys specify the system defaults for dynamic port allocation and for binding to NICs on multihomed machines. You must first create these keys, then specify the appropriate settings. If a key is missing or if it contains an invalid value, then the entire configuration is marked as invalid and all RpcServerUseProtseq* calls over ncacn_ip_tcp or ncadg_ip_udp will fail.

Note  Ports allocated to a process remain allocated until that process dies. If all available ports are in use, then the API will return RPC_S_OUT_OF_RESOURCES.

Port Key Data Type Description
HKEY_LOCAL_MACHINE\
Software\Microsoft\Rpc\
Internet\Ports
REG_MULTI_SZ Specifies a set of IP port ranges consisting of either all the ports available from the Internet or all the ports not available from the Internet. Each string represents a single port or an inclusive set of ports (for example,"1000-1050" "1984"). If any entries are outside the range of zero to 65535, or if any string cannot be interpreted, the RPC run time will treat the entire configuration as invalid.
HKEY_LOCAL_MACHINE\
Software\Microsoft\Rpc\
Internet\PortsInternetAvailable
REG_SZ Y or N (not case-sensitive). If Y, the ports listed in the Ports key are all the Internet-available ports on that machine. If N, the ports listed in the Ports key are all those ports that are not Internet-available.
HKEY_LOCAL_MACHINE\
Software\Microsoft\Rpc\
Internet\UseInternetPorts
REG_SZ Y or N (not case-sensitive). Specifies the system default policy. If Y, the processes using the default will be assigned ports from the set of Internet-available ports, as defined above. If N, processes using the default will be assigned ports from the set of intranet-only ports.
HKEY_LOCAL_MACHINE\
System\CurrentControlSet\
Services\Rpc\Linkage\Bind
REG_MULTI_SZ Lists the device names of all the NICs on which to bind by default (for example, \Device\AMDPCN1). If the key does not exist, the server will bind to all NICs. If the key does exist, the server will bind to the NICs specified in the key, unless the NICFlags field is set to RPC_C_BIND_TO_ALL_NICS. If the key has a null ("") value, the configuration will be marked as invalid and all calls to RpcServerUseProtseq* over ncacn_ip_tcp or ncadg_ip_udp will fail.

See Also

RPC_POLICY, RpcServerUseAllProtseqsEx, RpcServerUseAllProtseqsIfEx, RpcServerUseProtseqEx, RpcServerUseProtseqEpEx, RpcServerUseProtseqIfEx, ncacn_ip_tcp, ncadg_ip_udp