HRESULT EnumGroups(DWORD dwSessionID,
LPDPENUMPLAYERSCALLBACK lpEnumPlayersCallback,
LPVOID lpContext, DWORD dwFlags);
Enumerates the groups in a session.
·Returns DP_OK if successful, or one of the following error messages otherwise:
DPERR_INVALIDOBJECT DPERR_INVALIDPARAMS
dwSessionID
Session of interest. Do not use unless the DPENUMPLAYERS_SESSION flag is specified.
lpEnumPlayersCallback
Address of the EnumPlayersCallback function to be called for every group in the session.
lpContext
Address for a caller-defined context that is passed to each enumeration callback.
dwFlags
Specifies the optional control flag.
Requests the name server for the specified session supply its group list.
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 ID, to request that a session's name server provide its list for enumeration. This method cannot be called from within an IDirectPlay::EnumSessions enumeration. Furthermore, use of the DPENUMPLAYERS_SESSION flag with this method must occur after the IDirectPlay::EnumSessions method has been called, and before any attempt to open or close has been made.