Microsoft DirectX 9.0 SDK Update (Summer 2003) |
IDirectPlay8AddressIP::GetSockAddress Method
Retrieves a list of SOCKADDR structures describing the addresses represented by this object.
Syntax
HRESULT GetSockAddress(
SOCKADDR *psockAddress, PDWORD pdwAddressBufferSize );
Parameters
- psockAddress
- [out] Pointer to buffer to retrieve the array of SOCKADDR structures. There is one SOCKADDR structure for each address the host resolves to.
- pdwAddressBufferSize
- [in, out] Size, in bytes, of the buffer specified in psockAddress. On success, this parameter contains the number of bytes written to the specified buffer. On failure, this parameter contains the number of bytes required to retrieve the array of SOCKADDR structures. You can divide the value of this parameter by the size of the SOCKADDR structure to determine the number of items present in the returned array.
Return Value
Returns S_OK if successful, or one of the following error values.
DPNERR_BUFFERTOOSMALL The supplied buffer is not large enough to contain the requested data. DPNERR_INVALIDPARAM One or more of the parameters passed to the method are invalid. DPNERR_INVALIDPOINTER Pointer specified as a parameter is invalid.
Remarks
If the host name specified in the object requires a Domain Name System (DNS) lookup, it is performed. Therefore, this method may block while the DNS is queried. It is also possible for a host name to resolve to multiple addresses.
To succeed, the contained address must have at least the following elements.
- DPNA_KEY_PROVIDER
- DPNA_KEY_HOSTNAME
- DPNA_KEY_PORT = specified port