Using System Messages

Messages returned by the IDirectPlay2::Receive method from player ID DPID_SYSMSG are system messages. All system messages begin with a doubleword value specified by dwType. You can cast the buffer returned by the IDirectPlay2::Receive method to a generic message (DPMSG_GENERIC) and switch on the dwType element, which will have a value equal to one of the messages with the DPSYS_ prefix. After the application has determined which system message it is, the buffer should be cast to the appropriate structure (beginning with the DPMSG_ prefix) to read the data.

Your application should be prepared to handle the following system messages:

Value of dwType Message structure
DPSYS_ADDPLAYERTOGROUP DPMSG_ADDPLAYERTOGROUP
DPSYS_CREATEPLAYERORGROUP DPMSG_CREATEPLAYERORGROUP
DPSYS_DELETEPLAYERFROMGROUP DPMSG_DELETEPLAYERFROMGROUP
DPSYS_DESTROYPLAYERORGROUP DPMSG_DESTROYPLAYERORGROUP
DPSYS_HOST DPMSG_HOST
DPSYS_SESSIONLOST DPMSG_SESSIONLOST
DPSYS_SETPLAYERORGROUPDATA DPMSG_SETPLAYERORGROUPDATA
DPSYS_SETPLAYERORGROUPNAME DPMSG_SETPLAYERORGROUPNAME

Messages returned by the IDirectPlayLobby::ReceiveLobbyMessage method that have a dwFlags parameter set to DPLAD_SYSTEM are system messages. All system messages begin with a doubleword value specified by dwType. You can cast the buffer returned by the IDirectPlayLobby::ReceiveLobbyMessage method to a generic message (DPLMSG_GENERIC) and switch on the dwType element, which will have a value equal to one of the messages with the DPLSYS_ prefix.