##

IDirectPlay3::GetPlayerAddress

IDirectPlay3 Interface

Retrieves 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 IDirectPlayLobby2::EnumAddress method to parse the DirectPlay Address buffer retrieved by IDirectPlay3::GetPlayerAddress.

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 group 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 Values

Returns DP_OK if successful, or one of the following error values otherwise:

DPERR_BUFFERTOOSMALL
DPERR_INVALIDOBJECT
DPERR_INVALIDPARAMS
DPERR_INVALIDPLAYER

##### 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.

For more information about the DirectPlay Address, DirectPlay Address.

##### See Also

IDirectPlayLobby2::EnumAddress

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.