DirectPlay Animated Header -- EnumPlayersCallback2 DirectPlay Animated Header -- EnumPlayersCallback2* Microsoft DirectPlay SDK
*Index  *Topic Contents
*Previous Topic: EnumLocalApplicationsCallback
*Next Topic: EnumSessionsCallback2


EnumPlayersCallback2


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

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

Parameters
dpId
The DPID 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_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_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_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_SERVERPLAYER — the player is the server player in an application/server session. Only one server player exists in each session.
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.

See Also

DPNAME, IDirectPlay3::EnumGroups, IDirectPlay3::EnumPlayers, IDirectPlay3::EnumGroupPlayers, IDirectPlay3::EnumGroupsInGroup

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.

*Top of Page