Platform SDK: DirectX

IDirectPlayLobby3::CreateAddress

The IDirectPlayLobby3::CreateAddress method creates a DirectPlay address, given a service provider-specific network address. The resulting address contains the globally unique identifier (GUID) of the service provider and data that the service provider can interpret as a network address.

Note that with IDirectPlayLobby3::CreateCompoundAddress you can create addresses with more than one data chunk. Therefore, you should use IDirectPlayLobby3::CreateCompoundAddress.

HRESULT CreateAddress(
  REFGUID guidSP,
  REFGUID guidDataType,
  LPCVOID lpData,
  DWORD dwDataSize,
  LPVOID lpAddress,
  LPDWORD lpdwAddressSize
);

Parameters

guidSP
Pointer to the GUID of the service provider. (In C++, it is a reference to the GUID.)
guidDataType
Pointer to the GUID identifying the specific network address type being used. (In C++, it is a reference to the GUID.) For information about predefined network address types, see DirectPlay Address.
lpData
Pointer to a buffer containing the specific network address.
dwDataSize
Size, in bytes, of the network address in lpData.
lpAddress
Pointer to a buffer in which the constructed DirectPlay address is to be written.
lpdwAddressSize
Pointer to a variable containing the size of the DirectPlay address buffer. Before calling this method, the service provider must initialize lpdwAddressSize to the size of the buffer. After the method has returned, this parameter will contain the number of bytes written to lpAddress. If the buffer was too small (DPERR_BUFFERTOOSMALL), this parameter will be set to the size required to store the DirectPlay address.

Return Values

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

DPERR_BUFFERTOOSMALL
DPERR_INVALIDPARAMS

Remarks

The IDirectPlayLobby3::CreateCompoundAddress method can be used to create longer DirectPlay addresses than CreateAddress allows.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dplobby.h.
  Import Library: Use dplayx.lib.

See Also

IDirectPlayLobby3::EnumAddress, IDirectPlayLobby3::CreateCompoundAddress, DirectPlay Address, DirectPlay Address Data Types