IDirectPlayLobby::GetConnectionSettings

HRESULT GetConnectionSettings(DWORD dwAppID,

LPVOID lpData, LPDWORD lpdwDataSize);

Retrieves the DPLCONNECTION structure that contains all the information needed to start and connect an application. The data returned is the same data that was passed to the IDirectPlayLobby::RunApplication method by the lobby client, or set by calling the IDirectPlayLobby::SetConnectionSettings method.

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

DPERR_BUFFERTOOSMALL

DPERR_GENERIC

DPERR_INVALIDINTERFACE

DPERR_INVALIDOBJECT

DPERR_INVALIDPARAMS

DPERR_NOTLOBBIED

DPERR_OUTOFMEMORY

dwAppID

Identifies which application's connection settings to retrieve when called from a lobby client (that communicates with several applications). When called from an application (that only communicates with one lobby client), this parameter must be zero. This ID number is obtained from IDirectPlayLobby::RunApplication.

lpData

Address of a buffer in which the connection settings are to be written. Set this parameter to NULL to request only the size of data. The lpdwDataSize parameter will be set to the minimum size required to hold the data.

lpdwDataSize

Address of 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 data. If the buffer was too small (DPERR_BUFFERTOOSMALL), then this parameter will be set to the minimum buffer size required.

The lpData member should be cast to the LPDPLCONNECTION structure when the function returns to read the data from it.