1 | // $Id: dplayx_messages.h,v 1.3 2000-10-06 19:49:06 hugh Exp $
|
---|
2 |
|
---|
3 | #ifndef __WINE_DPLAYX_MESSAGES__
|
---|
4 | #define __WINE_DPLAYX_MESSAGES__
|
---|
5 |
|
---|
6 | #include "windef.h"
|
---|
7 | #include "dplay.h"
|
---|
8 | //#include "rpc.h" /* For GUID */
|
---|
9 |
|
---|
10 | #include "dplay_global.h"
|
---|
11 |
|
---|
12 | DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart,
|
---|
13 | HANDLE hDeath, HANDLE hConnRead );
|
---|
14 |
|
---|
15 |
|
---|
16 | /* Message types etc. */
|
---|
17 | #include "pshpack1.h"
|
---|
18 |
|
---|
19 | /* Non provided messages for DPLAY - guess work which may be wrong :( */
|
---|
20 | #define DPMSGCMD_ENUMSESSIONSREPLY 1
|
---|
21 | #define DPMSGCMD_ENUMSESSIONSREQUEST 2
|
---|
22 |
|
---|
23 |
|
---|
24 | #define DPMSGCMD_REQUESTNEWPLAYERID 5
|
---|
25 |
|
---|
26 | #define DPMSGCMD_NEWPLAYERIDREPLY 7
|
---|
27 | #define DPMSGCMD_CREATESESSION 8
|
---|
28 | #define DPMSGCMD_CREATENEWPLAYER 9
|
---|
29 | #define DPMSGCMD_SYSTEMMESSAGE 10
|
---|
30 | #define DPMSGCMD_DELETEPLAYER 11
|
---|
31 | #define DPMSGCMD_DELETEGROUP 12
|
---|
32 |
|
---|
33 | #define DPMSGCMD_ENUMGROUPS 17
|
---|
34 |
|
---|
35 | #define DPMSGCMD_GETNAMETABLE 19
|
---|
36 |
|
---|
37 | #define DPMSGCMD_GETNAMETABLEREPLY 29
|
---|
38 |
|
---|
39 | /* This is what DP 6 defines it as. Don't know what it means. All messages
|
---|
40 | * defined below are DPMSGVER_DP6.
|
---|
41 | */
|
---|
42 | #define DPMSGVER_DP6 11
|
---|
43 |
|
---|
44 | /* MAGIC number at the start of all dplay packets ("play" in ASCII) */
|
---|
45 | #define DPMSGMAGIC_DPLAYMSG 0x79616c70
|
---|
46 |
|
---|
47 | /* All messages sent from the system are sent with this at the beginning of
|
---|
48 | * the message.
|
---|
49 | */
|
---|
50 |
|
---|
51 | /* Size is 8 bytes */
|
---|
52 | typedef struct tagDPMSG_SENDENVELOPE
|
---|
53 | {
|
---|
54 | DWORD dwMagic;
|
---|
55 | WORD wCommandId;
|
---|
56 | WORD wVersion;
|
---|
57 | } DPMSG_SENDENVELOPE, *LPDPMSG_SENDENVELOPE;
|
---|
58 | typedef const DPMSG_SENDENVELOPE* LPCDPMSG_SENDENVELOPE;
|
---|
59 |
|
---|
60 | typedef struct tagDPMSG_SYSMSGENVELOPE
|
---|
61 | {
|
---|
62 | DWORD dwPlayerFrom;
|
---|
63 | DWORD dwPlayerTo;
|
---|
64 | } DPMSG_SYSMSGENVELOPE, *LPDPMSG_SYSMSGENVELOPE;
|
---|
65 | typedef const DPMSG_SYSMSGENVELOPE* LPCDPMSG_SYSMSGENVELOPE;
|
---|
66 |
|
---|
67 |
|
---|
68 | typedef struct tagDPMSG_ENUMSESSIONSREPLY
|
---|
69 | {
|
---|
70 | DPMSG_SENDENVELOPE envelope;
|
---|
71 |
|
---|
72 | #if 0
|
---|
73 | DWORD dwSize; /* Size of DPSESSIONDESC2 struct */
|
---|
74 | DWORD dwFlags; /* Sessions flags */
|
---|
75 |
|
---|
76 | GUID guidInstance; /* Not 100% sure this is what it is... */
|
---|
77 |
|
---|
78 | GUID guidApplication;
|
---|
79 |
|
---|
80 | DWORD dwMaxPlayers;
|
---|
81 | DWORD dwCurrentPlayers;
|
---|
82 |
|
---|
83 | BYTE unknown[36];
|
---|
84 | #else
|
---|
85 | DPSESSIONDESC2 sd;
|
---|
86 | #endif
|
---|
87 |
|
---|
88 | DWORD dwUnknown; /* Seems to be equal to 0x5c which is a "\\" */
|
---|
89 | /* Encryption package string? */
|
---|
90 |
|
---|
91 | /* At the end we have ... */
|
---|
92 | /* WCHAR wszSessionName[1]; Var length with NULL terminal */
|
---|
93 |
|
---|
94 | } DPMSG_ENUMSESSIONSREPLY, *LPDPMSG_ENUMSESSIONSREPLY;
|
---|
95 | typedef const DPMSG_ENUMSESSIONSREPLY* LPCDPMSG_ENUMSESSIONSREPLY;
|
---|
96 |
|
---|
97 | typedef struct tagDPMSG_ENUMSESSIONSREQUEST
|
---|
98 | {
|
---|
99 | DPMSG_SENDENVELOPE envelope;
|
---|
100 |
|
---|
101 | GUID guidApplication;
|
---|
102 |
|
---|
103 | DWORD dwPasswordSize; /* A Guess. This is normally 0x00000000. */
|
---|
104 | /* This might be the name server DPID which
|
---|
105 | is needed for the reply */
|
---|
106 |
|
---|
107 | DWORD dwFlags; /* dwFlags from EnumSessions */
|
---|
108 |
|
---|
109 | } DPMSG_ENUMSESSIONSREQUEST, *LPDPMSG_ENUMSESSIONSREQUEST;
|
---|
110 | typedef const DPMSG_ENUMSESSIONSREQUEST* LPCDPMSG_ENUMSESSIONSREQUEST;
|
---|
111 |
|
---|
112 | /* Size is 146 received - with 18 or 20 bytes header = ~128 bytes */
|
---|
113 | typedef struct tagDPMSG_CREATESESSION
|
---|
114 | {
|
---|
115 | DPMSG_SENDENVELOPE envelope;
|
---|
116 | } DPMSG_CREATESESSION, *LPDPMSG_CREATESESSION;
|
---|
117 | typedef const DPMSG_CREATESESSION* LPCDPMSG_CREATESESSION;
|
---|
118 |
|
---|
119 | /* 12 bytes msg */
|
---|
120 | typedef struct tagDPMSG_REQUESTNEWPLAYERID
|
---|
121 | {
|
---|
122 | DPMSG_SENDENVELOPE envelope;
|
---|
123 |
|
---|
124 | DWORD dwFlags; /* dwFlags used for CreatePlayer */
|
---|
125 |
|
---|
126 | } DPMSG_REQUESTNEWPLAYERID, *LPDPMSG_REQUESTNEWPLAYERID;
|
---|
127 | typedef const DPMSG_REQUESTNEWPLAYERID* LPCDPMSG_REQUESTNEWPLAYERID;
|
---|
128 |
|
---|
129 | /* 48 bytes msg */
|
---|
130 | typedef struct tagDPMSG_NEWPLAYERIDREPLY
|
---|
131 | {
|
---|
132 | DPMSG_SENDENVELOPE envelope;
|
---|
133 |
|
---|
134 | DPID dpidNewPlayerId;
|
---|
135 | #if 1
|
---|
136 | /* Assume that this is data that is tacked on to the end of the message
|
---|
137 | * that comes from the SP remote data stored that needs to be propagated.
|
---|
138 | */
|
---|
139 | BYTE unknown[36]; /* This appears to always be 0 - not sure though */
|
---|
140 | #endif
|
---|
141 |
|
---|
142 | } DPMSG_NEWPLAYERIDREPLY, *LPDPMSG_NEWPLAYERIDREPLY;
|
---|
143 | typedef const DPMSG_NEWPLAYERIDREPLY* LPCDPMSG_NEWPLAYERIDREPLY;
|
---|
144 |
|
---|
145 | #include "poppack.h"
|
---|
146 |
|
---|
147 |
|
---|
148 | HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags,
|
---|
149 | LPDPID lpdipidAllocatedId );
|
---|
150 |
|
---|
151 | /* FIXME: I don't think that this is a needed method */
|
---|
152 | HRESULT DP_MSG_OpenStream( IDirectPlay2AImpl* This );
|
---|
153 |
|
---|
154 |
|
---|
155 | #endif
|
---|