IDirectPlay4::GetPlayerAddress
IDirectPlay4 InterfaceRetrieves the DirectPlay Address for a player.
The DirectPlay Address is a network address for a player using a specific service provider. You should call the IDirectPlayLobby3::EnumAddress method to parse the DirectPlay Address buffer retrieved by IDirectPlay4::GetPlayerAddress.
If this method is called on a local player, it returns the network address of the computer if it is available. In some cases, more than one address can be returned (for example, with TCP/IP where the computer has both a network card and a dial-up Internet connection).
Syntax
HRESULT GetPlayerAddress(
DPID idPlayer,
LPVOID lpData,
LPDWORD lpdwDataSize
);Parameters
- idPlayer
- Player ID that the address is being requested for. Pass in zero to obtain a list of valid address options for a service provider (for example, a list of valid modem choices for the modem-to-modem service provider).
- lpData
- Pointer to a buffer where the DirectPlay Address is to be written. Set this parameter to NULL to request only the size of data. The lpdwDataSize parameter will be set to the size required to hold the data.
- lpdwDataSize
- Pointer to a variable that is initialized to the size of the buffer before calling this method. After the method returns, this parameter will be set to the size, in bytes, of the DirectPlay Address data. If the buffer was too small, then this parameter will be set to the buffer size that is required and the method will return DPERR_BUFFERTOOSMALL.
Return Value
Returns DP_OK if successful, or one of the following error values otherwise:
DPERR_BUFFERTOOSMALL DPERR_INVALIDOBJECT DPERR_INVALIDPARAMS DPERR_INVALIDPLAYER DPERR_UNAVAILABLE This method returns DPERR_UNAVAILABLE if the address for the requested player ID is not available.
Remarks
To get a list of valid modem choices, pass in zero for the idPlayer parameter. A list of modem choices will be returned as a list of ANSI or Unicode strings with a zero-length string at the end.
The DirectPlay Address will contain both ANSI and Unicode strings with the address, regardless of what interface this method is called on.
For more information about the DirectPlay Address, see DirectPlay Address.
See Also
Top of Page
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.