IDirectPlayNATHelp::RegisterPorts Method

DirectPlay

 
Microsoft DirectX 9.0 SDK Update (Summer 2003)

IDirectPlayNATHelp::RegisterPorts Method


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

Syntax

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

Parameters

aLocalAddress
[in] Array of local address and port tuples for which remote ports are selected.
dwAddressesSize
[in] Size of entire local addresses array.
dwNumAddresses
[in] Number of SOCKADDR structures in local addresses array.
dwLeaseTime
[in] Requested time to lease the ports, in milliseconds. If IDirectPlayNATHelp::GetCaps is called before this time expires, the lease will automatically be renewed.
phRegisteredPorts
[in] Place to store an identifier for this binding which can be used to query or release the binding.
dwFlags
[in] Set to 0 for User Datagram Protocol (UDP) ports or one of the following values.
DPNHREGISTERPORTS_TCP
TCP ports.
DPNHREGISTERPORTS_FIXEDPORTS
Asks the server to use the same port on the public interface.
DPNHREGISTERPORTS_SHAREDPORTS
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.



© 2003 Microsoft Corporation. All rights reserved.