HRESULT Open(LPDPSESSIONDESC2 lpsd,
DWORD dwFlags);
Establishes a gaming session instance.
·Returns DP_OK if successful, or one of the following error values otherwise:
lpsd
Address of the DPSESSIONDESC2 structure describing the session to be created or joined.
dwFlags
One of the following flags:
Creates a new instance of a gaming session.
Joins an existing instance of a gaming session.
An application can either create a new session (which other remote applications join) or join an existing session. Your application must call IDirectPlay2::Open before any local players are created. Before an application can join an existing session, it should use IDirectPlay2::EnumSessions to obtain a list of what sessions can be joined and their session descriptions. Attempting to join a session where new players are disabled, joining is disabled, or the player limit has been reached will result in a DPERR_UNAVAILABLE error.