Platform SDK: DirectX

EnumPlayersCallback2

EnumPlayersCallback2 is an application-defined callback function. The application must implement this function and pass a pointer to it in the IDirectPlay4::EnumGroups, IDirectPlay4::EnumGroupPlayers, IDirectPlay4::EnumPlayers, and IDirectPlay4::EnumGroupsInGroup methods. The callback is called once for each player or group that is enumerated.

BOOL FAR PASCAL EnumPlayersCallback2(
  DPID dpId,
  DWORD dwPlayerType,
  LPCDPNAME lpName,
  DWORD dwFlags,
  LPVOID lpContext
);

Parameters

dpId
ID of the player or group being enumerated.
dwPlayerType
Type of entity, either DPPLAYERTYPE_GROUP or DPPLAYERTYPE_PLAYER.
lpName
Read-only pointer to a DPNAME structure containing the name of the player or group. This pointer is only valid for the duration of the callback function. Any data that is to be saved for future reference must be copied to some application-owned memory.
dwFlags
Flags describing the group or player being enumerated.
DPENUMGROUPS_HIDDEN
The group was created using the hidden flag.
DPENUMGROUPS_SHORTCUT
The group is a shortcut.
DPENUMGROUPS_STAGINGAREA
The group is a staging area.
DPENUMPLAYERS_GROUP
Both players and groups are being enumerated. This flag is returned only if it was specified in the enumeration method calling this callback.
DPENUMPLAYERS_LOCAL
The player or group exists on a local computer. This flag is returned only if it was specified in the enumeration method calling this callback.
DPENUMPLAYERS_OWNER
The player is the owner of the group. This flag is returned only if it was specified in the IDirectPlay4::EnumGroupPlayers method calling this callback.
DPENUMPLAYERS_REMOTE
The player or group exists on a remote computer. This flag is returned only if it was specified in the enumeration method calling this callback.
DPENUMPLAYERS_SERVERPLAYER
The player is the server player in an application/server session. Only one server player exists in each session.
DPENUMPLAYERS_SESSION
The player or group exists in the session identified by lpguidInstance in the enumeration method. This flag is returned only if it was specified in the enumeration method calling this callback.
DPENUMPLAYERS_SPECTATOR
The player is a spectator (applies to players only).
lpContext
Pointer to an application-defined context.

Return Values

Returns TRUE to continue the enumeration or FALSE to stop it.

Remarks

Any pointers returned in a callback function are temporary and are valid only in the body of the callback function. If the application needs to save pointer information, it must allocate memory to hold the data, copy the data, and then store the pointer to this new data.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dplay.h.

See Also

DPNAME, IDirectPlay4::EnumGroups, IDirectPlay4::EnumPlayers, IDirectPlay4::EnumGroupPlayers, IDirectPlay4::EnumGroupsInGroup