Made all 16<->32 HWND conversions use explicit functions instead of
[wine/multimedia.git] / dlls / dplayx / dplayx_messages.h
blob191858b47ddab472dc1e355e22d6d808c3b20fb6
2 #ifndef __WINE_DPLAYX_MESSAGES__
3 #define __WINE_DPLAYX_MESSAGES__
5 #include "windef.h"
6 #include "dplay.h"
7 #include "rpc.h" /* For GUID */
9 #include "dplay_global.h"
11 DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart,
12 HANDLE hDeath, HANDLE hConnRead );
14 HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags,
15 LPDPID lpdipidAllocatedId );
16 HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer );
18 void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId,
19 LPCVOID lpMsgBody, DWORD dwMsgBodySize );
20 void DP_MSG_ErrorReceived( IDirectPlay2AImpl* This, WORD wCommandId,
21 LPCVOID lpMsgBody, DWORD dwMsgBodySize );
22 void DP_MSG_ToSelf( IDirectPlay2AImpl* This, DPID dpidSelf );
24 /* Timings -> 1000 ticks/sec */
25 #define DPMSG_WAIT_5_SECS 5000
26 #define DPMSG_WAIT_30_SECS 30000
27 #define DPMSG_WAIT_60_SECS 60000
28 #define DPMSG_DEFAULT_WAIT_TIME DPMSG_WAIT_30_SECS
30 /* Message types etc. */
31 #include "pshpack1.h"
33 /* Non provided messages for DPLAY - guess work which may be wrong :( */
34 #define DPMSGCMD_ENUMSESSIONSREPLY 1
35 #define DPMSGCMD_ENUMSESSIONSREQUEST 2
36 #define DPMSGCMD_GETNAMETABLEREPLY 3 /* Contains all existing players in session */
38 #define DPMSGCMD_REQUESTNEWPLAYERID 5
40 #define DPMSGCMD_NEWPLAYERIDREPLY 7
41 #define DPMSGCMD_CREATESESSION 8 /* Might be a create nameserver or new player msg */
42 #define DPMSGCMD_CREATENEWPLAYER 9
43 #define DPMSGCMD_SYSTEMMESSAGE 10
44 #define DPMSGCMD_DELETEPLAYER 11
45 #define DPMSGCMD_DELETEGROUP 12
47 #define DPMSGCMD_ENUMGROUPS 17
49 #define DPMSGCMD_FORWARDADDPLAYER 19
51 #define DPMSGCMD_PLAYERCHAT 22
53 #define DPMSGCMD_FORWARDADDPLAYERNACK 36
55 #define DPMSGCMD_JUSTENVELOPE 1000
56 #define DPMSGCMD_JUSTENVELOPEREPLY 1001
58 /* This is what DP 6 defines it as. Don't know what it means. All messages
59 * defined below are DPMSGVER_DP6.
61 #define DPMSGVER_DP6 11
63 /* MAGIC number at the start of all dplay packets ("play" in ASCII) */
64 #define DPMSGMAGIC_DPLAYMSG 0x79616c70
66 /* All messages sent from the system are sent with this at the beginning of
67 * the message.
68 * Size is 8 bytes
70 typedef struct tagDPMSG_SENDENVELOPE
72 DWORD dwMagic;
73 WORD wCommandId;
74 WORD wVersion;
75 } DPMSG_SENDENVELOPE, *LPDPMSG_SENDENVELOPE;
76 typedef const DPMSG_SENDENVELOPE* LPCDPMSG_SENDENVELOPE;
78 /* System messages exchanged between players seems to have this
79 * payload envelope on top of the basic envelope
81 typedef struct tagDPMSG_SYSMSGENVELOPE
83 DWORD dwPlayerFrom;
84 DWORD dwPlayerTo;
85 } DPMSG_SYSMSGENVELOPE, *LPDPMSG_SYSMSGENVELOPE;
86 typedef const DPMSG_SYSMSGENVELOPE* LPCDPMSG_SYSMSGENVELOPE;
88 /* Reply sent in response to an enumsession request */
89 typedef struct tagDPMSG_ENUMSESSIONSREPLY
91 DPMSG_SENDENVELOPE envelope;
93 #if 0
94 DWORD dwSize; /* Size of DPSESSIONDESC2 struct */
95 DWORD dwFlags; /* Sessions flags */
97 GUID guidInstance; /* Not 100% sure this is what it is... */
99 GUID guidApplication;
101 DWORD dwMaxPlayers;
102 DWORD dwCurrentPlayers;
104 BYTE unknown[36];
105 #else
106 DPSESSIONDESC2 sd;
107 #endif
109 DWORD dwUnknown; /* Seems to be equal to 0x5c which is a "\\" */
110 /* Encryption package string? */
112 /* At the end we have ... */
113 /* WCHAR wszSessionName[1]; Var length with NULL terminal */
115 } DPMSG_ENUMSESSIONSREPLY, *LPDPMSG_ENUMSESSIONSREPLY;
116 typedef const DPMSG_ENUMSESSIONSREPLY* LPCDPMSG_ENUMSESSIONSREPLY;
118 /* Msg sent to find out what sessions are available */
119 typedef struct tagDPMSG_ENUMSESSIONSREQUEST
121 DPMSG_SENDENVELOPE envelope;
123 GUID guidApplication;
125 DWORD dwPasswordSize; /* A Guess. This is 0x00000000. */
126 /* This might be the name server DPID which
127 is needed for the reply */
129 DWORD dwFlags; /* dwFlags from EnumSessions */
131 } DPMSG_ENUMSESSIONSREQUEST, *LPDPMSG_ENUMSESSIONSREQUEST;
132 typedef const DPMSG_ENUMSESSIONSREQUEST* LPCDPMSG_ENUMSESSIONSREQUEST;
134 /* Size is 146 received - with 18 or 20 bytes header = ~128 bytes */
135 typedef struct tagDPMSG_CREATESESSION
137 DPMSG_SENDENVELOPE envelope;
138 } DPMSG_CREATESESSION, *LPDPMSG_CREATESESSION;
139 typedef const DPMSG_CREATESESSION* LPCDPMSG_CREATESESSION;
141 /* 12 bytes msg */
142 typedef struct tagDPMSG_REQUESTNEWPLAYERID
144 DPMSG_SENDENVELOPE envelope;
146 DWORD dwFlags; /* dwFlags used for CreatePlayer */
148 } DPMSG_REQUESTNEWPLAYERID, *LPDPMSG_REQUESTNEWPLAYERID;
149 typedef const DPMSG_REQUESTNEWPLAYERID* LPCDPMSG_REQUESTNEWPLAYERID;
151 /* 48 bytes msg */
152 typedef struct tagDPMSG_NEWPLAYERIDREPLY
154 DPMSG_SENDENVELOPE envelope;
156 DPID dpidNewPlayerId;
158 /* Assume that this is data that is tacked on to the end of the message
159 * that comes from the SP remote data stored that needs to be propagated.
161 BYTE unknown[36]; /* This appears to always be 0 - not sure though */
162 } DPMSG_NEWPLAYERIDREPLY, *LPDPMSG_NEWPLAYERIDREPLY;
163 typedef const DPMSG_NEWPLAYERIDREPLY* LPCDPMSG_NEWPLAYERIDREPLY;
165 typedef struct tagDPMSG_FORWARDADDPLAYER
167 DPMSG_SENDENVELOPE envelope;
169 DWORD unknown; /* 0 */
171 DPID dpidAppServer; /* Remote application server id */
172 DWORD unknown2[5]; /* 0x0, 0x1c, 0x6c, 0x50, 0x9 */
174 DPID dpidAppServer2; /* Remote application server id again !? */
175 DWORD unknown3[5]; /* 0x0, 0x0, 0x20, 0x0, 0x0 */
177 DPID dpidAppServer3; /* Remote application server id again !? */
179 DWORD unknown4[12]; /* ??? - Is this a clump of 5 and then 8? */
180 /* NOTE: 1 byte infront of the two 0x??090002 entries changes!
181 * Is it a timestamp of some sort? 1st always smaller than
182 * other...
184 #define FORWARDADDPLAYER_UNKNOWN4_INIT { 0x30, 0xb, 0x0, 0x1e090002, 0x0, 0x0, 0x0, 0x32090002, 0x0, 0x0, 0x0, 0x0 }
186 BYTE unknown5[2]; /* 2 bytes at the end. This may be a part of something! ( 0x0, 0x0) */
188 } DPMSG_FORWARDADDPLAYER, *LPDPMSG_FORWARDADDPLAYER;
189 typedef const DPMSG_FORWARDADDPLAYER* LPCDPMSG_FORWARDADDPLAYER;
191 /* This is an error message that can be received. Not sure if this is
192 * specifically for a forward add player or for all errors
194 typedef struct tagDPMSG_FORWARDADDPLAYERNACK
196 DPMSG_SENDENVELOPE envelope;
197 HRESULT errorCode;
198 } DPMSG_FORWARDADDPLAYERNACK, *LPDPMSG_FORWARDADDPLAYERNACK;
199 typedef const DPMSG_FORWARDADDPLAYERNACK* LPCDPMSG_FORWARDADDPLAYERNACK;
201 #include "poppack.h"
203 #endif