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