EnumPlayersCallback2
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/group that is enumerated.
Syntax
BOOL FAR PASCAL EnumPlayersCallback2(
DPID dpId,
DWORD dwPlayerType,
LPCDPNAME lpName,
DWORD dwFlags,
LPVOID lpContext
);Parameters
- dpId
- 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_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 Value
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, IDirectPlay4::EnumGroups, IDirectPlay4::EnumPlayers, IDirectPlay4::EnumGroupPlayers, IDirectPlay4::EnumGroupsInGroup
Top of Page
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.