IDirectPlayNATHelp::GetRegisteredAddresses Method

DirectPlay

 
Microsoft DirectX 9.0 SDK Update (Summer 2003)

IDirectPlayNATHelp::GetRegisteredAddresses Method


Returns the current public address mappings for the specified registered port group.

Syntax

HRESULT GetRegisteredAddresses(      
    const DPNHANDLE hRegisteredPorts,     SOCKADDR *const paPublicAddresses,     DWORD *const pdwPublicAddressSize,     DWORD *const pdwAddressTypeFlags,     DWORD *const pdwLeaseTimeRemaining,     const DWORD dwFlags );

Parameters

hRegisteredPorts
[in] Handle to a specific binding returned by IDirectPlayNATHelp::RegisterPorts.
paPublicAddresses
[out] Buffer to receive assigned public realm addresses. Set to NULL if not desired.
pdwPublicAddressSize
[in, out] Pointer to a size of paPublicAddresses buffer on input. On output, receives the size written to paPublicAddresses or the size required if the buffer is too small. Can be NULL only if paPublicAddresses is NULL.
pdwAddressTypeFlags
[out] Receives flags describing the address types returned. Set to NULL if not desired. The following values can be returned.
DPNHANDLEADDRESSTYPE_TCP
The mappings are for TCP ports instead of User Datagram Protocol (UDP) ports.
DPNHANDLEADDRESSTYPE_FIXEDPORTS
The mappings are for ports which are the same on the Internet gateway.
DPNHANDLEADDRESSTYPE_SHAREDPORTS
The mappings are for shared UDP fixed ports.
DPNHANDLEADDRESSTYPE_LOCALFIREWALL
The addresses are opened on a local firewall.
DPNHANDLEADDRESSTYPE_GATEWAY
The addresses are registered with an Internet gateway.
DPNHANDLEADDRESSTYPE_GATEWAYISLOCAL
The Internet gateway is local.
pdwLeaseTimeRemaining
[out] Receives time remaining in the port lease in milliseconds. Set to NULL if not desired. Call IDirectPlayNATHelp::GetCaps to automatically extend leases.
dwFlags
[in] Can be the following value.
DPNHGETREGISTEREDADDRESSES_LOCALFIREWALLREMAPONLY
Retrieve the public address for the local firewall only, even if mapped on remote Internet gateway.

Return Value

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

DPNHERR_GENERIC An error occurred while closing.
DPNHERR_BUFFERTOOSMALL The supplied buffer is not large enough to contain the requested data.
DPNHERR_INVALIDFLAGS Invalid flags were specified.
DPNHERR_INVALIDOBJECT The interface object is invalid.
DPNHERR_INVALIDPARAM An invalid parameter was specified.
DPNHERR_NOMAPPING The server does not have valid public interfaces.
DPNHERR_NOTINITIALIZED The object has not been initialized.
DPNHERR_OUTOFMEMORY There is not enough memory to perform this operation.
DPNHERR_REENTRANT The interface has been re-entered on the same thread.
DPNHERR_SERVERUNAVAILABLE No servers are currently present.
DPNHERR_UPDATESERVERSTATUSIDirectPlayNATHelp::GetCaps has not been called with the DPNHGETCAPS_UPDATESERVERSTATUS flag set.



© 2003 Microsoft Corporation. All rights reserved.