System Messages

Messages returned by the IDirectPlay::Receive method from player ID 0 are system messages. All system messages begin with a doubleword dwType. You can cast the buffer returned by the IDirectPlay::Receive method to a generic message (DPMSG_GENERIC) and switch on the dwType element, which will have a value equal to one of the DPSYS_* messages (DPSYS_ADDPLAYER, and so on).

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

Value of dwType Message structure
DPSYS_ADDPLAYER DPMSG_ADDPLAYER
DPSYS_ADDPLAYERTOGROUP DPMSG_GROUPADD
DPSYS_DELETEGROUP DPMSG_DELETEPLAYER
DPSYS_DELETEPLAYER DPMSG_DELETEPLAYER
DPSYS_DELETEPLAYERFROMGRP DPMSG_GROUPDELETE
DPSYS_SESSIONLOST DPMSG_GENERIC