HRESULT SetGroupData(DPID idGroup,
LPVOID lpData, DWORD dwDataSize,
DWORD dwFlags);
Associates an application-specific data block with a group ID.
·Returns DP_OK if successful, or one of the following error values otherwise:
idGroup
Group ID for which data is being set.
lpData
Address of the data to be set. Set to NULL to clear any existing group data.
dwDataSize
Size of the data buffer.
dwFlags
If this parameter is set to 0, the remote group data will be set and propagated using nonguaranteed messaging.
This data is for use by all the applications, and will be propagated to all the other applications in the session.
This data is for local use only and will not be propagated.
Propagates the data by using guaranteed messaging (if available). This flag can only be used with DPSET_REMOTE.
DirectPlay can maintain two types of group data: local and remote. Local data is available only to the application on the local computer. Remote data is propagated to all the other applications in the session. A DPSYS_SETPLAYERORGROUPDATA system message will be sent to all the other players notifying them of the change unless DPSESSION_NODATAMESSAGES is set in the session description. It is safe to store pointers to resources in the local data; the local data block is available (in the DPMSG_DESTROYPLAYERORGROUP system message) when the group is being destroyed, so the application can free those resources. For a list of system messages, see Using System Messages.