IDirectPlay2::Open

HRESULT Open(LPDPSESSIONDESC2 lpsd,

DWORD dwFlags);

Establishes a gaming session instance.

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

DPERR_ACTIVEPLAYERS

DPERR_ALREADYINITIALIZED

DPERR_GENERIC

DPERR_INVALIDFLAGS

DPERR_INVALIDOBJECT

DPERR_INVALIDPARAMS

DPERR_UNAVAILABLE

DPERR_UNSUPPORTED

DPERR_USERCANCEL

lpsd

Address of the DPSESSIONDESC2 structure describing the session to be created or joined.

dwFlags

One of the following flags:

DPOPEN_CREATE

Creates a new instance of a gaming session.

DPOPEN_JOIN

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.