Step 3: Configuring the Session Description
You should examine the DPSESSIONDESC2 structure to ensure that all the flags and properties that your application needs are set properly. If modifications are necessary, store the modified connection settings by using the IDirectPlayLobby2::SetConnectionSettings method.
The following example shows how to configure the session description and set the connection settings:
// Before the game connects, it should configure the session
// description with any settings it needs.
// Set the flags and maximum players used by the game.
lpConnectionSettings->lpSessionDesc->dwFlags = DPSESSION_MIGRATEHOST |
DPSESSION_KEEPALIVE;
lpConnectionSettings->lpSessionDesc->dwMaxPlayers = MAXPLAYERS;
// Store the updated connection settings.
hr = lpDirectPlayLobbyA->SetConnectionSettings(0, 0,
lpConnectionSettings);
if FAILED(hr)
goto FAILURE;