?/TD>
Microsoft DirectX 9.0

IDirectPlay8Peer::EnumPlayersAndGroups Method


Retrieves a list of all the player and/or group identifiers for the session.

Syntax

HRESULT EnumPlayersAndGroups(      

    DPNID *const prgdpnid,     DWORD *const pcdpnid,     const DWORD dwFlags );

Parameters

prgdpnid
[out] Pointer to an array that will be filled with the session's group and/or player identifiers.
pcdpnid
[in] Pointer to a variable of type DWORD that specifies the number of identifiers that can be contained in the buffer pointed to by prgdpnid. If the buffer is too small, this method returns DPNERR_BUFFERTOOSMALL and this parameter contains the number of entries that are required.
dwFlags
[in] Flag that describes enumeration behavior. You can set one or both of the following flags.
DPNENUM_PLAYERS
Return a list of player identifiers.
DPNENUM_GROUPS
Return a list of group identifiers.

Return Value

Returns S_OK if successful, or one of the following error values.

DPNERR_BUFFERTOOSMALLThe supplied buffer is not large enough to contain the requested data.
DPNERR_INVALIDFLAGSThe flags passed to this method are invalid.


Remarks

Because group and player information changes frequently, the required buffer size returned may change between subsequent calls. Check and reallocate the buffer until the method succeeds.



© 2002 Microsoft Corporation. All rights reserved.