Get rid of the no longer used ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
[wine] / dlls / dplayx / dplaysp.h
1 /*
2  * Copyright 2000 Peter Hunnisett
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #ifndef __WINE_DIRECT_PLAY_SP_H
20 #define __WINE_DIRECT_PLAY_SP_H
21
22 #include <stdarg.h>
23
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "dplay.h"
28 #include "dplobby.h"
29
30 /* GUID for IDirectPlaySP  {0C9F6360-CC61-11cf-ACEC-00AA006886E3} */
31 DEFINE_GUID(IID_IDirectPlaySP, 0xc9f6360, 0xcc61, 0x11cf, 0xac, 0xec, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3);
32 typedef struct IDirectPlaySP IDirectPlaySP, *LPDIRECTPLAYSP;
33
34
35 typedef BOOL (CALLBACK *LPENUMMRUCALLBACK)( LPCVOID lpData,
36                                             DWORD  dwDataSize,
37                                             LPVOID lpContext );
38
39 /* For SP. Top 16 bits is dplay, bottom 16 is SP */
40 #define DPSP_MAJORVERSION 0x00060000
41 #define DPSP_DX5VERSION   0x00050000
42 #define DPSP_DX3VERSION   0x00040000
43
44 #define DPSP_MAJORVERSIONMASK 0xFFFF0000
45 #define DPSP_MINORVERSIONMASK 0x0000FFFF
46
47
48 /* Some flags */
49 #define DPLAYI_PLAYER_SYSPLAYER      0x00000001
50 #define DPLAYI_PLAYER_NAMESRVR       0x00000002
51 #define DPLAYI_PLAYER_PLAYERINGROUP  0x00000004
52 #define DPLAYI_PLAYER_PLAYERLOCAL    0x00000008
53 #define DPLAYI_GROUP_SYSGROUP        0x00000020
54 #define DPLAYI_GROUP_DPLAYOWNS       0x00000040
55 #define DPLAYI_PLAYER_APPSERVER      0x00000080
56 #define DPLAYI_GROUP_HIDDEN          0x00000400
57
58 /* Define the COM interface */
59 #define INTERFACE IDirectPlaySP
60 #define IDirectPlaySP_METHODS \
61    IUnknown_METHODS \
62    STDMETHOD(AddMRUEntry)(THIS_ LPCWSTR lpSection, LPCWSTR lpKey, LPCVOID lpData, DWORD dwDataSize, DWORD dwMaxEntries ) PURE; \
63    STDMETHOD(CreateAddress)(THIS_ REFGUID guidSP, REFGUID guidDataType, LPCVOID lpData, DWORD dwDataSize, LPVOID lpAddress,LPDWORD lpdwAddressSize) PURE; \
64    STDMETHOD(EnumAddress)(THIS_ LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress, DWORD dwAddressSize, LPVOID lpContext ) PURE; \
65    STDMETHOD(EnumMRUEntries)(THIS_ LPCWSTR lpSection, LPCWSTR lpKey, LPENUMMRUCALLBACK lpEnumMRUCallback, LPVOID lpContext ) PURE; \
66    STDMETHOD(GetPlayerFlags)(THIS_ DPID idPlayer, LPDWORD lpdwPlayerFlags ) PURE; \
67    STDMETHOD(GetSPPlayerData)(THIS_ DPID idPlayer, LPVOID *lplpData, LPDWORD lpdwDataSize, DWORD dwFlags ) PURE; \
68    STDMETHOD(HandleMessage)(THIS_ LPVOID lpMessageBody, DWORD dwMessageBodySize, LPVOID lpMessageHeader ) PURE; \
69    STDMETHOD(SetSPPlayerData)(THIS_ DPID idPlayer, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags ) PURE; \
70    STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT lpElements, DWORD dwElementCount, LPVOID lpAddress, LPDWORD lpdwAddressSize ) PURE; \
71    STDMETHOD(GetSPData)(THIS_ LPVOID *lplpData, LPDWORD dwDataSize, DWORD dwFlags ) PURE; \
72    STDMETHOD(SetSPData)(THIS_ LPVOID lpData, DWORD dwDataSize, DWORD dwFlags ) PURE; \
73    STDMETHOD_(VOID,SendComplete)(THIS_ LPVOID , DWORD  ) PURE;
74 DECLARE_INTERFACE_(IDirectPlaySP,IUnknown) { IDirectPlaySP_METHODS };
75 #undef INTERFACE
76
77
78 /* NOTE: The microsoft provided header file doesn't have these access
79  * functions
80  */
81 #ifdef COBJMACROS
82 /*** IUnknown methods ***/
83 #define IDirectPlaySP_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
84 #define IDirectPlaySP_AddRef(p)                    (p)->lpVtbl->AddRef(p)
85 #define IDirectPlaySP_Release(p)                   (p)->lpVtbl->Release(p)
86 /*** IDirectPlaySP methods ***/
87 #define IDirectPlaySP_AddMRUEntry(p,a,b,c,d,e)     (p)->lpVtbl->AddMRUEntry(p,a,b,c,d,e)
88 #define IDirectPlaySP_CreateAddress(p,a,b,c,d,e,f) (p)->lpVtbl->CreateAddress(p,a,b,c,d,e,f)
89 #define IDirectPlaySP_EnumAddress(p,a,b,c,d)       (p)->lpVtbl->EnumAddress(p,a,b,c,d)
90 #define IDirectPlaySP_EnumMRUEntries(p,a,b,c,d)    (p)->lpVtbl->EnumMRUEntries(p,a,b,c,d)
91 #define IDirectPlaySP_GetPlayerFlags(p,a,b)        (p)->lpVtbl->GetPlayerFlags(p,a,b)
92 #define IDirectPlaySP_GetSPPlayerData(p,a,b,c,d)   (p)->lpVtbl->GetSPPlayerData(p,a,b,c,d)
93 #define IDirectPlaySP_HandleMessage(p,a,b,c)       (p)->lpVtbl->HandleMessage(p,a,b,c)
94 #define IDirectPlaySP_SetSPPlayerData(p,a,b,c,d)   (p)->lpVtbl->SetSPPlayerData(p,a,b,c,d)
95 #define IDirectPlaySP_CreateCompoundAddress(p,a,b,c,d)  (p)->lpVtbl->CreateCompoundAddress(p,a,b,c,d)
96 #define IDirectPlaySP_GetSPData(p,a,b,c)           (p)->lpVtbl->GetSPData(p,a,b,c)
97 #define IDirectPlaySP_SetSPData(p,a,b,c)           (p)->lpVtbl->SetSPData(p,a,b,c)
98 #define IDirectPlaySP_SendComplete(p,a,b)          (p)->lpVtbl->SendComplete(p,a,b)
99 #endif
100
101 /* SP Callback stuff */
102
103 typedef struct tagDPSP_ADDPLAYERTOGROUPDATA
104 {
105   DPID           idPlayer;
106   DPID           idGroup;
107   IDirectPlaySP* lpISP;
108 } DPSP_ADDPLAYERTOGROUPDATA, *LPDPSP_ADDPLAYERTOGROUPDATA;
109
110 typedef struct tagDPSP_CLOSEDATA
111 {
112   IDirectPlaySP* lpISP;
113 } DPSP_CLOSEDATA, *LPDPSP_CLOSEDATA;
114
115 typedef struct tagDPSP_CREATEGROUPDATA
116 {
117   DPID           idGroup;
118   DWORD          dwFlags;
119   LPVOID         lpSPMessageHeader;
120   IDirectPlaySP* lpISP;
121 } DPSP_CREATEGROUPDATA, *LPDPSP_CREATEGROUPDATA;
122
123 typedef struct tagDPSP_CREATEPLAYERDATA
124 {
125   DPID           idPlayer;
126   DWORD          dwFlags;
127   LPVOID         lpSPMessageHeader;
128   IDirectPlaySP* lpISP;
129 } DPSP_CREATEPLAYERDATA, *LPDPSP_CREATEPLAYERDATA;
130
131 typedef struct tagDPSP_DELETEGROUPDATA
132 {
133   DPID           idGroup;
134   DWORD          dwFlags;
135   IDirectPlaySP* lpISP;
136 } DPSP_DELETEGROUPDATA, *LPDPSP_DELETEGROUPDATA;
137
138 typedef struct tagDPSP_DELETEPLAYERDATA
139 {
140   DPID           idPlayer;
141   DWORD          dwFlags;
142   IDirectPlaySP* lpISP;
143 } DPSP_DELETEPLAYERDATA, *LPDPSP_DELETEPLAYERDATA;
144
145 typedef struct tagDPSP_ENUMSESSIONSDATA
146 {
147   LPVOID         lpMessage;
148   DWORD          dwMessageSize;
149   IDirectPlaySP* lpISP;
150   BOOL           bReturnStatus;
151 } DPSP_ENUMSESSIONSDATA, *LPDPSP_ENUMSESSIONSDATA;
152
153 typedef struct _DPSP_GETADDRESSDATA
154 {
155   DPID           idPlayer;
156   DWORD          dwFlags;
157   LPDPADDRESS    lpAddress;
158   LPDWORD        lpdwAddressSize;
159   IDirectPlaySP* lpISP;
160 } DPSP_GETADDRESSDATA, *LPDPSP_GETADDRESSDATA;
161
162 typedef struct tagDPSP_GETADDRESSCHOICESDATA
163 {
164   LPDPADDRESS    lpAddress;
165   LPDWORD        lpdwAddressSize;
166   IDirectPlaySP* lpISP;
167 } DPSP_GETADDRESSCHOICESDATA, *LPDPSP_GETADDRESSCHOICESDATA;
168
169 typedef struct tagDPSP_GETCAPSDATA
170 {
171   DPID           idPlayer;
172   LPDPCAPS       lpCaps;
173   DWORD          dwFlags;
174   IDirectPlaySP* lpISP;
175 } DPSP_GETCAPSDATA, *LPDPSP_GETCAPSDATA;
176
177 typedef struct tagDPSP_OPENDATA
178 {
179   BOOL           bCreate;
180   LPVOID         lpSPMessageHeader;
181   IDirectPlaySP* lpISP;
182   BOOL           bReturnStatus;
183   DWORD          dwOpenFlags;
184   DWORD          dwSessionFlags;
185 } DPSP_OPENDATA, *LPDPSP_OPENDATA;
186
187 typedef struct tagDPSP_REMOVEPLAYERFROMGROUPDATA
188 {
189   DPID           idPlayer;
190   DPID           idGroup;
191   IDirectPlaySP* lpISP;
192 } DPSP_REMOVEPLAYERFROMGROUPDATA, *LPDPSP_REMOVEPLAYERFROMGROUPDATA;
193
194 typedef struct tagDPSP_REPLYDATA
195 {
196   LPVOID         lpSPMessageHeader;
197   LPVOID         lpMessage;
198   DWORD          dwMessageSize;
199   DPID           idNameServer;
200   IDirectPlaySP* lpISP;
201 } DPSP_REPLYDATA, *LPDPSP_REPLYDATA;
202
203 typedef struct tagDPSP_SENDDATA
204 {
205   DWORD          dwFlags;
206   DPID           idPlayerTo;
207   DPID           idPlayerFrom;
208   LPVOID         lpMessage;
209   DWORD          dwMessageSize;
210   BOOL           bSystemMessage;
211   IDirectPlaySP* lpISP;
212 } DPSP_SENDDATA, *LPDPSP_SENDDATA;
213
214 typedef struct tagDPSP_SENDTOGROUPDATA
215 {
216   DWORD          dwFlags;
217   DPID           idGroupTo;
218   DPID           idPlayerFrom;
219   LPVOID         lpMessage;
220   DWORD          dwMessageSize;
221   IDirectPlaySP* lpISP;
222 } DPSP_SENDTOGROUPDATA, *LPDPSP_SENDTOGROUPDATA;
223
224 typedef struct tagDPSP_SENDEXDATA
225 {
226   IDirectPlaySP* lpISP;
227   DWORD          dwFlags;
228   DPID           idPlayerTo;
229   DPID           idPlayerFrom;
230   LPSGBUFFER     lpSendBuffers;
231   DWORD          cBuffers;
232   DWORD          dwMessageSize;
233   DWORD          dwPriority;
234   DWORD          dwTimeout;
235   LPVOID         lpDPContext;
236   LPDWORD        lpdwSPMsgID;
237   BOOL           bSystemMessage;
238 } DPSP_SENDEXDATA, *LPDPSP_SENDEXDATA;
239
240 typedef struct tagDPSP_SENDTOGROUPEXDATA
241 {
242   IDirectPlaySP* lpISP;
243   DWORD          dwFlags;
244   DPID           idGroupTo;
245   DPID           idPlayerFrom;
246   LPSGBUFFER     lpSendBuffers;
247   DWORD          cBuffers;
248   DWORD          dwMessageSize;
249   DWORD          dwPriority;
250   DWORD          dwTimeout;
251   LPVOID         lpDPContext;
252   LPDWORD        lpdwSPMsgID;
253 } DPSP_SENDTOGROUPEXDATA, *LPDPSP_SENDTOGROUPEXDATA;
254
255 typedef struct tagDPSP_GETMESSAGEQUEUEDATA
256 {
257   IDirectPlaySP* lpISP;
258   DWORD          dwFlags;
259   DPID           idFrom;
260   DPID           idTo;
261   LPDWORD        lpdwNumMsgs;
262   LPDWORD        lpdwNumBytes;
263 } DPSP_GETMESSAGEQUEUEDATA, *LPDPSP_GETMESSAGEQUEUEDATA;
264
265 #define DPCANCELSEND_PRIORITY 0x00000001
266 #define DPCANCELSEND_ALL      0x00000002
267
268 typedef struct tagDPSP_CANCELDATA
269 {
270   IDirectPlaySP* lpISP;
271   DWORD          dwFlags;
272   LPRGLPVOID     lprglpvSPMsgID;
273   DWORD          cSPMsgID;
274   DWORD          dwMinPriority;
275   DWORD          dwMaxPriority;
276 } DPSP_CANCELDATA, *LPDPSP_CANCELDATA;
277
278 typedef struct tagDPSP_SHUTDOWNDATA
279 {
280   IDirectPlaySP* lpISP;
281 } DPSP_SHUTDOWNDATA, *LPDPSP_SHUTDOWNDATA;
282
283
284 /* Prototypes returned by SPInit */
285 typedef HRESULT (WINAPI *LPDPSP_CREATEPLAYER)(LPDPSP_CREATEPLAYERDATA);
286 typedef HRESULT (WINAPI *LPDPSP_DELETEPLAYER)(LPDPSP_DELETEPLAYERDATA);
287 typedef HRESULT (WINAPI *LPDPSP_SEND)(LPDPSP_SENDDATA);
288 typedef HRESULT (WINAPI *LPDPSP_ENUMSESSIONS)(LPDPSP_ENUMSESSIONSDATA);
289 typedef HRESULT (WINAPI *LPDPSP_REPLY)(LPDPSP_REPLYDATA);
290 typedef HRESULT (WINAPI *LPDPSP_SHUTDOWN)(void);
291 typedef HRESULT (WINAPI *LPDPSP_CREATEGROUP)(LPDPSP_CREATEGROUPDATA);
292 typedef HRESULT (WINAPI *LPDPSP_DELETEGROUP)(LPDPSP_DELETEGROUPDATA);
293 typedef HRESULT (WINAPI *LPDPSP_ADDPLAYERTOGROUP)(LPDPSP_ADDPLAYERTOGROUPDATA);
294 typedef HRESULT (WINAPI *LPDPSP_REMOVEPLAYERFROMGROUP)(LPDPSP_REMOVEPLAYERFROMGROUPDATA);
295 typedef HRESULT (WINAPI *LPDPSP_GETCAPS)(LPDPSP_GETCAPSDATA);
296 typedef HRESULT (WINAPI *LPDPSP_GETADDRESS)(LPDPSP_GETADDRESSDATA);
297 typedef HRESULT (WINAPI *LPDPSP_GETADDRESSCHOICES)(LPDPSP_GETADDRESSCHOICESDATA);
298 typedef HRESULT (WINAPI *LPDPSP_OPEN)(LPDPSP_OPENDATA);
299 typedef HRESULT (WINAPI *LPDPSP_CLOSE)(void);
300 typedef HRESULT (WINAPI *LPDPSP_SENDTOGROUP)(LPDPSP_SENDTOGROUPDATA);
301 typedef HRESULT (WINAPI *LPDPSP_SHUTDOWNEX)(LPDPSP_SHUTDOWNDATA);
302 typedef HRESULT (WINAPI *LPDPSP_CLOSEEX)(LPDPSP_CLOSEDATA);
303 typedef HRESULT (WINAPI *LPDPSP_SENDEX)(LPDPSP_SENDEXDATA);
304 typedef HRESULT (WINAPI *LPDPSP_SENDTOGROUPEX)(LPDPSP_SENDTOGROUPEXDATA);
305 typedef HRESULT (WINAPI *LPDPSP_CANCEL)(LPDPSP_CANCELDATA);
306 typedef HRESULT (WINAPI *LPDPSP_GETMESSAGEQUEUE)(LPDPSP_GETMESSAGEQUEUEDATA);
307
308
309 typedef struct tagDPSP_SPCALLBACKS
310 {
311     DWORD                        dwSize;
312     DWORD                        dwVersion;
313
314     LPDPSP_ENUMSESSIONS          EnumSessions;          /* Must be provided */
315     LPDPSP_REPLY                 Reply;                 /* Must be provided */
316     LPDPSP_SEND                  Send;                  /* Must be provided */
317     LPDPSP_ADDPLAYERTOGROUP      AddPlayerToGroup;      /* Optional */
318     LPDPSP_CLOSE                 Close;                 /* Optional */
319     LPDPSP_CREATEGROUP           CreateGroup;           /* Optional */
320     LPDPSP_CREATEPLAYER          CreatePlayer;          /* Optional */
321     LPDPSP_DELETEGROUP           DeleteGroup;           /* Optional */
322     LPDPSP_DELETEPLAYER          DeletePlayer;          /* Optional */
323     LPDPSP_GETADDRESS            GetAddress;            /* Optional */
324     LPDPSP_GETCAPS               GetCaps;               /* Optional */
325     LPDPSP_OPEN                  Open;                  /* Optional */
326     LPDPSP_REMOVEPLAYERFROMGROUP RemovePlayerFromGroup; /* Optional */
327     LPDPSP_SENDTOGROUP           SendToGroup;           /* Optional */
328     LPDPSP_SHUTDOWN              Shutdown;              /* Optional */
329
330     LPDPSP_CLOSEEX               CloseEx;               /* Optional */
331     LPDPSP_SHUTDOWNEX            ShutdownEx;            /* Optional */
332     LPDPSP_GETADDRESSCHOICES     GetAddressChoices;     /* Optional */
333
334     LPDPSP_SENDEX                SendEx;                /* Optional */
335     LPDPSP_SENDTOGROUPEX         SendToGroupEx;         /* Optional */
336     LPDPSP_CANCEL                Cancel;                /* Optional */
337     LPDPSP_GETMESSAGEQUEUE       GetMessageQueue;       /* Optional */
338 } DPSP_SPCALLBACKS, *LPDPSP_SPCALLBACKS;
339
340 typedef struct tagSPINITDATA
341 {
342     LPDPSP_SPCALLBACKS  lpCB;
343     IDirectPlaySP*      lpISP;
344     LPWSTR              lpszName;
345     LPGUID              lpGuid;
346     DWORD               dwReserved1;
347     DWORD               dwReserved2;
348     DWORD               dwSPHeaderSize;
349     LPDPADDRESS         lpAddress;
350     DWORD               dwAddressSize;
351     DWORD               dwSPVersion;
352 } SPINITDATA, *LPSPINITDATA;
353
354 typedef HRESULT (WINAPI *LPDPSP_SPINIT)(LPSPINITDATA);
355
356 /* This variable is exported from the DLL at ordinal 6 to be accessed by the
357  * SP directly
358  */
359 extern DWORD gdwDPlaySPRefCount;
360
361 #endif