Microsoft DirectX 8.1 (C++)

IDirectPlay8AddressIP::GetSockAddress

Retrieves a list of SOCKADDR structures describing the addresses represented by this object. If the host name specified in the object requires a 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.

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 psockAddresses. 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 Values

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

DPNERR_BUFFERTOOSMALL
DPNERR_INVALIDPARAM
DPNERR_INVALIDPOINTER

Requirements

  Windows NT/2000/XP: Available as a redistributable for Windows 2000 and later.
  Windows 98/Me: Available as a redistributable for Windows 98 and later.
  Header: Declared in Dpaddr.h.