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