IDirectPlay2::EnumGroupPlayers

HRESULT EnumGroupPlayers(DPID idGroup,

LPGUID lpguidInstance,

LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2,

LPVOID lpContext, DWORD dwFlags);

Enumerates all the players of a group in the current session.

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

DPERR_EXCEPTION

DPERR_INVALIDFLAGS

DPERR_INVALIDOBJECT

DPERR_INVALIDPLAYER

idGroup

ID of the group whose players are to be enumerated.

lpguidInstance

DirectPlay session instance of interest. This parameter must be set to NULL unless the DPENUMPLAYERS_SESSION flag is specified.

lpEnumPlayersCallback2

Address of the EnumPlayersCallback2 function to be called for every player in the group.

lpContext

Address of an application-defined context that is passed to each enumeration callback.

dwFlags

Flag to be passed in the dwFlags parameter to the callback function.

DPENUMPLAYERS_SESSION

Enumerates the players in the group in the session identified by lpguidInstance.

By default, this method will enumerate using the local player list for the current session. The DPENUMPLAYERS_SESSION flag can be used, along with a session instance GUID, to request that a session's host provide its list for enumeration. This method cannot be called from within an IDirectPlay2::EnumSessions enumeration. Furthermore, use of the DPENUMPLAYERS_SESSION flag with this method must occur after the IDirectPlay2::EnumSessions method has been called, and before any calls to the IDirectPlay2::Close or IDirectPlay2::Open methods.