HRESULT EnumGroups(LPGUID lpguidInstance,
LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2,
LPVOID lpContext, DWORD dwFlags);
Enumerates the groups available to a session.
·Returns DP_OK if successful, or one of the following error messages otherwise:
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 group in the session.
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.
Enumerates the groups 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.