?/TD> |
Microsoft DirectX 9.0 |
Determine a private alias for a given public address.
Syntax
HRESULT QueryAddress(
const SOCKADDR *const pSourceAddress, const SOCKADDR *const pQueryAddress, SOCKADDR *const pResponseAddress, const int iAddressSize, const DWORD dwFlags );
Parameters
- pSourceAddress
- [in] Address for the network interface that is using the desired address. This can be set to INADDR_ANY in which case the best server will be used.
- pQueryAddress
- [in] Address to look up. Do not set this value to INADDR_ANY or INADDR_BROADCAST.
- pResponseAddress
- [out] Receives the private alias to the public address specified.
- iAddressSize
- [in] Size of the SOCKADDR structure used for the pSourceAddress, pQueryAddress, and pResponseAddress buffers.
- dwFlags
- [in] Set to 0 to query for a User Datagram Protocol (UDP) port. Otherwise, set to one of the following values.
- DPNHQUERYADRESS_TCP
- Query for a TCP port.
- DPNHQUERYADRESS_CACHEFOUND
- Cache the address if a mapping is found.
- DPNHQUERYADRESS_CACHENOTFOUND
- Cache the address if a mapping is not found.
- DPNHQUERYADRESS_CHECKFORPRIVATEBUTUNMAPPED
- Determine if an address is private when no specific mapping is found.
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_INVALIDPOINTER An invalid pointer was specified. DPNHERR_NOMAPPING The server does not have valid public interfaces. DPNHERR_NOMAPPINGBUTPRIVATE The server indicated that no mapping was found, but it is a private address. 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_UPDATESERVERSTATUS IDirectPlayNATHelp::GetCaps has not been called with the DPNHGETCAPS_UPDATESERVERSTATUS flag set.