Microsoft DirectX 9.0

IDirectPlayNATHelp::RegisterPorts Method

Asks for public realm port(s) that are aliases for the local port(s) on this private realm node.


HRESULT RegisterPorts(      

    const SOCKADDR *const aLocalAddress,     const DWORD dwAddressesSize,     const DWORD dwNumAddresses,     const DWORD dwLeaseTime,     DPNHANDLE *const phRegisteredPorts,     const DWORD dwFlags );


[in] Array of local address and port tuples for which remote ports are selected.
[in] Size of entire local addresses array.
[in] Number of SOCKADDR structures in local addresses array.
[in] Requested time to lease the ports, in milliseconds. If IDirectPlayNATHelp::GetCaps is called before this time expires, the lease will automatically be renewed.
[in] Place to store an identifier for this binding which can be used to query or release the binding.
[in] Set to 0 for User Datagram Protocol (UDP) ports or one of the following values.
TCP ports.
Asks the server to use the same port on the public interface.
Allow the UDP fixed port to be shared.

Return Value

Returns DPNH_OK if successful, or one of the following error values.

DPNHERR_GENERIC An error occurred while closing.
DPNHERR_INVALIDFLAGS Invalid flags were specified.
DPNHERR_INVALIDOBJECT The interface object is invalid.
DPNHERR_INVALIDPARAM An invalid parameter was specified.
DPNHERR_NOTINITIALIZED The object has not been initialized.
DPNHERR_OUTOFMEMORY There is not enough memory to perform this operation.
DPNHERR_PORTALREADYREGISTERED At least one of the ports has already been registered in a different address array or order.
DPNHERR_REENTRANT The interface has been re-entered on the same thread.

© 2002 Microsoft Corporation. All rights reserved.