2 #ifndef __WINE_DPLAYX_MESSAGES__
3 #define __WINE_DPLAYX_MESSAGES__
7 #include "rpc.h" /* For GUID */
9 #include "dplay_global.h"
11 DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart,
12 HANDLE hDeath, HANDLE hConnRead );
15 /* Message types etc. */
18 /* Non provided messages for DPLAY - guess work which may be wrong :( */
19 #define DPMSGCMD_ENUMSESSIONSREPLY 1
20 #define DPMSGCMD_ENUMSESSIONSREQUEST 2
23 #define DPMSGCMD_REQUESTNEWPLAYERID 5
25 #define DPMSGCMD_NEWPLAYERIDREPLY 7
26 #define DPMSGCMD_CREATESESSION 8
27 #define DPMSGCMD_CREATENEWPLAYER 9
28 #define DPMSGCMD_SYSTEMMESSAGE 10
29 #define DPMSGCMD_DELETEPLAYER 11
30 #define DPMSGCMD_DELETEGROUP 12
32 #define DPMSGCMD_ENUMGROUPS 17
34 #define DPMSGCMD_GETNAMETABLE 19
36 #define DPMSGCMD_GETNAMETABLEREPLY 29
38 /* This is what DP 6 defines it as. Don't know what it means. All messages
39 * defined below are DPMSGVER_DP6.
41 #define DPMSGVER_DP6 11
43 /* MAGIC number at the start of all dplay packets ("play" in ASCII) */
44 #define DPMSGMAGIC_DPLAYMSG 0x79616c70
46 /* All messages sent from the system are sent with this at the beginning of
51 typedef struct tagDPMSG_SENDENVELOPE
56 } DPMSG_SENDENVELOPE, *LPDPMSG_SENDENVELOPE;
57 typedef const DPMSG_SENDENVELOPE* LPCDPMSG_SENDENVELOPE;
59 typedef struct tagDPMSG_SYSMSGENVELOPE
63 } DPMSG_SYSMSGENVELOPE, *LPDPMSG_SYSMSGENVELOPE;
64 typedef const DPMSG_SYSMSGENVELOPE* LPCDPMSG_SYSMSGENVELOPE;
67 typedef struct tagDPMSG_ENUMSESSIONSREPLY
69 DPMSG_SENDENVELOPE envelope;
72 DWORD dwSize; /* Size of DPSESSIONDESC2 struct */
73 DWORD dwFlags; /* Sessions flags */
75 GUID guidInstance; /* Not 100% sure this is what it is... */
80 DWORD dwCurrentPlayers;
87 DWORD dwUnknown; /* Seems to be equal to 0x5c which is a "\\" */
88 /* Encryption package string? */
90 /* At the end we have ... */
91 /* WCHAR wszSessionName[1]; Var length with NULL terminal */
93 } DPMSG_ENUMSESSIONSREPLY, *LPDPMSG_ENUMSESSIONSREPLY;
94 typedef const DPMSG_ENUMSESSIONSREPLY* LPCDPMSG_ENUMSESSIONSREPLY;
96 typedef struct tagDPMSG_ENUMSESSIONSREQUEST
98 DPMSG_SENDENVELOPE envelope;
100 GUID guidApplication;
102 DWORD dwPasswordSize; /* A Guess. This is normally 0x00000000. */
103 /* This might be the name server DPID which
104 is needed for the reply */
106 DWORD dwFlags; /* dwFlags from EnumSessions */
108 } DPMSG_ENUMSESSIONSREQUEST, *LPDPMSG_ENUMSESSIONSREQUEST;
109 typedef const DPMSG_ENUMSESSIONSREQUEST* LPCDPMSG_ENUMSESSIONSREQUEST;
111 /* Size is 146 received - with 18 or 20 bytes header = ~128 bytes */
112 typedef struct tagDPMSG_CREATESESSION
114 DPMSG_SENDENVELOPE envelope;
115 } DPMSG_CREATESESSION, *LPDPMSG_CREATESESSION;
116 typedef const DPMSG_CREATESESSION* LPCDPMSG_CREATESESSION;
119 typedef struct tagDPMSG_REQUESTNEWPLAYERID
121 DPMSG_SENDENVELOPE envelope;
123 DWORD dwFlags; /* dwFlags used for CreatePlayer */
125 } DPMSG_REQUESTNEWPLAYERID, *LPDPMSG_REQUESTNEWPLAYERID;
126 typedef const DPMSG_REQUESTNEWPLAYERID* LPCDPMSG_REQUESTNEWPLAYERID;
129 typedef struct tagDPMSG_NEWPLAYERIDREPLY
131 DPMSG_SENDENVELOPE envelope;
133 DPID dpidNewPlayerId;
135 /* Assume that this is data that is tacked on to the end of the message
136 * that comes from the SP remote data stored that needs to be propagated.
138 BYTE unknown[36]; /* This appears to always be 0 - not sure though */
141 } DPMSG_NEWPLAYERIDREPLY, *LPDPMSG_NEWPLAYERIDREPLY;
142 typedef const DPMSG_NEWPLAYERIDREPLY* LPCDPMSG_NEWPLAYERIDREPLY;
147 HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags,
148 LPDPID lpdipidAllocatedId );
150 /* FIXME: I don't think that this is a needed method */
151 HRESULT DP_MSG_OpenStream( IDirectPlay2AImpl* This );