- Fix the tics drawing code.
[wine] / include / dplay.h
1 /*
2  * Copyright (C) the Wine project
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_DPLAY_H
20 #define __WINE_DPLAY_H
21
22 #include "ole2.h"
23 #include "wine/obj_base.h"
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* defined(__cplusplus) */
28
29 typedef LPVOID (*LPRGLPVOID)[];
30 typedef LPRGLPVOID PRGPVOID, LPRGPVOID, PRGLPVOID, PAPVOID, LPAPVOID, PALPVOID, LPALPVOID;
31
32 #define VOL volatile
33 typedef VOID * volatile LPVOIDV;
34
35
36 /*****************************************************************************
37  * Predeclare the interfaces
38  */
39 DEFINE_GUID(CLSID_DirectPlay,0xd1eb6d20, 0x8923, 0x11d0, 0x9d, 0x97, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
40
41 DEFINE_GUID(IID_IDirectPlay, 0x5454e9a0, 0xdb65, 0x11ce, 0x92, 0x1c, 0x00, 0xaa, 0x00, 0x6c, 0x49, 0x72);
42 typedef struct IDirectPlay IDirectPlay,*LPDIRECTPLAY;
43
44 DEFINE_GUID(IID_IDirectPlay2, 0x2b74f7c0, 0x9154, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3);
45 typedef struct IDirectPlay2 IDirectPlay2,*LPDIRECTPLAY2;
46
47 DEFINE_GUID(IID_IDirectPlay2A,0x9d460580, 0xa822, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82);
48 typedef struct IDirectPlay2 IDirectPlay2A,*LPDIRECTPLAY2A;
49
50 DEFINE_GUID(IID_IDirectPlay3, 0x133efe40, 0x32dc, 0x11d0, 0x9c, 0xfb, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
51 typedef struct IDirectPlay3 IDirectPlay3,*LPDIRECTPLAY3;
52
53 DEFINE_GUID(IID_IDirectPlay3A,0x133efe41, 0x32dc, 0x11d0, 0x9c, 0xfb, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
54 typedef struct IDirectPlay3 IDirectPlay3A,*LPDIRECTPLAY3A;
55
56 DEFINE_GUID(IID_IDirectPlay4, 0xab1c530, 0x4745, 0x11d1, 0xa7, 0xa1, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
57 typedef struct IDirectPlay4 IDirectPlay4,*LPDIRECTPLAY4;
58
59 DEFINE_GUID(IID_IDirectPlay4A,0xab1c531, 0x4745, 0x11d1, 0xa7, 0xa1, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
60 typedef struct IDirectPlay4 IDirectPlay4A,*LPDIRECTPLAY4A;
61
62
63 /*
64  * GUIDS used by Service Providers shipped with DirectPlay
65  * Use these to identify Service Provider returned by EnumConnections
66  */
67
68 /* GUID for IPX service provider {685BC400-9D2C-11cf-A9CD-00AA006886E3} */
69 DEFINE_GUID(DPSPGUID_IPX, 0x685bc400, 0x9d2c, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3);
70
71 /* GUID for TCP/IP service provider {36E95EE0-8577-11cf-960C-0080C7534E82} */
72 DEFINE_GUID(DPSPGUID_TCPIP, 0x36E95EE0, 0x8577, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82);
73
74 /* GUID for Serial service provider {0F1D6860-88D9-11cf-9C4E-00A0C905425E} */
75 DEFINE_GUID(DPSPGUID_SERIAL, 0xf1d6860, 0x88d9, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
76
77 /* GUID for Modem service provider {44EAA760-CB68-11cf-9C4E-00A0C905425E} */
78 DEFINE_GUID(DPSPGUID_MODEM, 0x44eaa760, 0xcb68, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
79
80
81 /*****************************************************************************
82  * Miscellaneous
83  */
84
85 /* Return Values for Direct Play */
86 #define _FACDP  0x877
87 #define MAKE_DPHRESULT( code )    MAKE_HRESULT( 1, _FACDP, code )
88
89 #define DP_OK                           S_OK
90 #define DPERR_ALREADYINITIALIZED        MAKE_DPHRESULT(   5 )
91 #define DPERR_ACCESSDENIED              MAKE_DPHRESULT(  10 )
92 #define DPERR_ACTIVEPLAYERS             MAKE_DPHRESULT(  20 )
93 #define DPERR_BUFFERTOOSMALL            MAKE_DPHRESULT(  30 )
94 #define DPERR_CANTADDPLAYER             MAKE_DPHRESULT(  40 )
95 #define DPERR_CANTCREATEGROUP           MAKE_DPHRESULT(  50 )
96 #define DPERR_CANTCREATEPLAYER          MAKE_DPHRESULT(  60 )
97 #define DPERR_CANTCREATESESSION         MAKE_DPHRESULT(  70 )
98 #define DPERR_CAPSNOTAVAILABLEYET       MAKE_DPHRESULT(  80 )
99 #define DPERR_EXCEPTION                 MAKE_DPHRESULT(  90 )
100 #define DPERR_GENERIC                   E_FAIL
101 #define DPERR_INVALIDFLAGS              MAKE_DPHRESULT( 120 )
102 #define DPERR_INVALIDOBJECT             MAKE_DPHRESULT( 130 )
103 #define DPERR_INVALIDPARAM              E_INVALIDARG
104 #define DPERR_INVALIDPARAMS             DPERR_INVALIDPARAM
105 #define DPERR_INVALIDPLAYER             MAKE_DPHRESULT( 150 )
106 #define DPERR_INVALIDGROUP              MAKE_DPHRESULT( 155 )
107 #define DPERR_NOCAPS                    MAKE_DPHRESULT( 160 )
108 #define DPERR_NOCONNECTION              MAKE_DPHRESULT( 170 )
109 #define DPERR_NOMEMORY                  E_OUTOFMEMORY
110 #define DPERR_OUTOFMEMORY               DPERR_NOMEMORY
111 #define DPERR_NOMESSAGES                MAKE_DPHRESULT( 190 )
112 #define DPERR_NONAMESERVERFOUND         MAKE_DPHRESULT( 200 )
113 #define DPERR_NOPLAYERS                 MAKE_DPHRESULT( 210 )
114 #define DPERR_NOSESSIONS                MAKE_DPHRESULT( 220 )
115 #define DPERR_PENDING                   E_PENDING
116 #define DPERR_SENDTOOBIG                MAKE_DPHRESULT( 230 )
117 #define DPERR_TIMEOUT                   MAKE_DPHRESULT( 240 )
118 #define DPERR_UNAVAILABLE               MAKE_DPHRESULT( 250 )
119 #define DPERR_UNSUPPORTED               E_NOTIMPL
120 #define DPERR_BUSY                      MAKE_DPHRESULT( 270 )
121 #define DPERR_USERCANCEL                MAKE_DPHRESULT( 280 )
122 #define DPERR_NOINTERFACE               E_NOINTERFACE
123 #define DPERR_CANNOTCREATESERVER        MAKE_DPHRESULT( 290 )
124 #define DPERR_PLAYERLOST                MAKE_DPHRESULT( 300 )
125 #define DPERR_SESSIONLOST               MAKE_DPHRESULT( 310 )
126 #define DPERR_UNINITIALIZED             MAKE_DPHRESULT( 320 )
127 #define DPERR_NONEWPLAYERS              MAKE_DPHRESULT( 330 )
128 #define DPERR_INVALIDPASSWORD           MAKE_DPHRESULT( 340 )
129 #define DPERR_CONNECTING                MAKE_DPHRESULT( 350 )
130 #define DPERR_CONNECTIONLOST            MAKE_DPHRESULT( 360 )
131 #define DPERR_UNKNOWNMESSAGE            MAKE_DPHRESULT( 370 )
132 #define DPERR_CANCELFAILED              MAKE_DPHRESULT( 380 )
133 #define DPERR_INVALIDPRIORITY           MAKE_DPHRESULT( 390 )
134 #define DPERR_NOTHANDLED                MAKE_DPHRESULT( 400 )
135 #define DPERR_CANCELLED                 MAKE_DPHRESULT( 410 )
136 #define DPERR_ABORTED                   MAKE_DPHRESULT( 420 )
137 #define DPERR_BUFFERTOOLARGE            MAKE_DPHRESULT( 1000 )
138 #define DPERR_CANTCREATEPROCESS         MAKE_DPHRESULT( 1010 )
139 #define DPERR_APPNOTSTARTED             MAKE_DPHRESULT( 1020 )
140 #define DPERR_INVALIDINTERFACE          MAKE_DPHRESULT( 1030 )
141 #define DPERR_NOSERVICEPROVIDER         MAKE_DPHRESULT( 1040 )
142 #define DPERR_UNKNOWNAPPLICATION        MAKE_DPHRESULT( 1050 )
143 #define DPERR_NOTLOBBIED                MAKE_DPHRESULT( 1070 )
144 #define DPERR_SERVICEPROVIDERLOADED     MAKE_DPHRESULT( 1080 )
145 #define DPERR_ALREADYREGISTERED         MAKE_DPHRESULT( 1090 )
146 #define DPERR_NOTREGISTERED             MAKE_DPHRESULT( 1100 )
147 #define DPERR_AUTHENTICATIONFAILED      MAKE_DPHRESULT( 2000 )
148 #define DPERR_CANTLOADSSPI              MAKE_DPHRESULT( 2010 )
149 #define DPERR_ENCRYPTIONFAILED          MAKE_DPHRESULT( 2020 )
150 #define DPERR_SIGNFAILED                MAKE_DPHRESULT( 2030 )
151 #define DPERR_CANTLOADSECURITYPACKAGE   MAKE_DPHRESULT( 2040 )
152 #define DPERR_ENCRYPTIONNOTSUPPORTED    MAKE_DPHRESULT( 2050 )
153 #define DPERR_CANTLOADCAPI              MAKE_DPHRESULT( 2060 )
154 #define DPERR_NOTLOGGEDIN               MAKE_DPHRESULT( 2070 )
155 #define DPERR_LOGONDENIED               MAKE_DPHRESULT( 2080 )
156
157
158 /* DPID - DirectPlay player and group ID */
159 typedef DWORD DPID, *LPDPID;
160
161 /* DPID from whence originate messages - just an ID */
162 #define DPID_SYSMSG             0           /* DPID of system */
163 #define DPID_ALLPLAYERS         0           /* DPID of all players */
164 #define DPID_SERVERPLAYER       1           /* DPID of the server player */
165 #define DPID_UNKNOWN            0xFFFFFFFF  /* Player ID is unknown */
166
167 /*  DPCAPS -  Used to obtain the capabilities of a DirectPlay object */
168 typedef struct tagDPCAPS
169 {
170     DWORD dwSize;               /* Size of structure in bytes */
171     DWORD dwFlags;
172     DWORD dwMaxBufferSize;
173     DWORD dwMaxQueueSize;       /* Obsolete. */
174     DWORD dwMaxPlayers;         /* Maximum players/groups (local + remote) */
175     DWORD dwHundredBaud;        /* Bandwidth in 100 bits per second units;
176                                  * i.e. 24 is 2400, 96 is 9600, etc.
177                                  */
178     DWORD dwLatency;            /* Estimated latency; 0 = unknown */
179     DWORD dwMaxLocalPlayers;    /* Maximum # of locally created players */
180     DWORD dwHeaderLength;       /* Maximum header length in bytes */
181     DWORD dwTimeout;            /* Service provider's suggested timeout value
182                                  * This is how long DirectPlay will wait for
183                                  * responses to system messages
184                                  */
185 } DPCAPS, *LPDPCAPS;
186
187 typedef struct tagDPNAME
188 {
189     DWORD   dwSize;
190     DWORD   dwFlags;            /* Not used must be 0 */
191
192     union /*playerShortName */      /* Player's Handle? */
193     {
194         LPWSTR  lpszShortName;
195         LPSTR   lpszShortNameA;
196     } DUMMYUNIONNAME1;
197
198     union /*playerLongName */       /* Player's formal/real name */
199     {
200         LPWSTR  lpszLongName;
201         LPSTR   lpszLongNameA;
202     } DUMMYUNIONNAME2;
203
204 } DPNAME, *LPDPNAME;
205
206 #define DPLONGNAMELEN     52
207 #define DPSHORTNAMELEN    20
208 #define DPSESSIONNAMELEN  32
209 #define DPPASSWORDLEN     16
210 #define DPUSERRESERVED    16
211
212 typedef struct tagDPSESSIONDESC
213 {
214     DWORD   dwSize;
215     GUID    guidSession;
216     DWORD   dwSession;
217     DWORD   dwMaxPlayers;
218     DWORD   dwCurrentPlayers;
219     DWORD   dwFlags;
220     char    szSessionName[ DPSESSIONNAMELEN ];
221     char    szUserField[ DPUSERRESERVED ];
222     DWORD   dwReserved1;
223     char    szPassword[ DPPASSWORDLEN ];
224     DWORD   dwReserved2;
225     DWORD   dwUser1;
226     DWORD   dwUser2;
227     DWORD   dwUser3;
228     DWORD   dwUser4;
229 } DPSESSIONDESC, *LPDPSESSIONDESC;
230
231 typedef struct tagDPSESSIONDESC2
232 {
233     DWORD   dwSize;
234     DWORD   dwFlags;
235     GUID    guidInstance;
236     GUID    guidApplication;   /* GUID of the DP application, GUID_NULL if
237                                 * all applications! */
238
239     DWORD   dwMaxPlayers;
240     DWORD   dwCurrentPlayers;   /* (read only value) */
241
242     union  /* Session name */
243     {
244         LPWSTR  lpszSessionName;
245         LPSTR   lpszSessionNameA;
246     } DUMMYUNIONNAME1;
247
248     union  /* Optional password */
249     {
250         LPWSTR  lpszPassword;
251         LPSTR   lpszPasswordA;
252     } DUMMYUNIONNAME2;
253
254     DWORD   dwReserved1;
255     DWORD   dwReserved2;
256
257     DWORD   dwUser1;        /* For use by the application */
258     DWORD   dwUser2;
259     DWORD   dwUser3;
260     DWORD   dwUser4;
261 } DPSESSIONDESC2, *LPDPSESSIONDESC2;
262 typedef const DPSESSIONDESC2* LPCDPSESSIONDESC2;
263
264 #define DPOPEN_JOIN                     0x00000001
265 #define DPOPEN_CREATE                   0x00000002
266 #define DPOPEN_RETURNSTATUS             DPENUMSESSIONS_RETURNSTATUS
267
268 #define DPSESSION_NEWPLAYERSDISABLED    0x00000001
269 #define DPSESSION_MIGRATEHOST           0x00000004
270 #define DPSESSION_NOMESSAGEID           0x00000008
271 #define DPSESSION_JOINDISABLED          0x00000020
272 #define DPSESSION_KEEPALIVE             0x00000040
273 #define DPSESSION_NODATAMESSAGES        0x00000080
274 #define DPSESSION_SECURESERVER          0x00000100
275 #define DPSESSION_PRIVATE               0x00000200
276 #define DPSESSION_PASSWORDREQUIRED      0x00000400
277 #define DPSESSION_MULTICASTSERVER       0x00000800
278 #define DPSESSION_CLIENTSERVER          0x00001000
279
280 typedef struct tagDPLCONNECTION
281 {
282     DWORD               dwSize;
283     DWORD               dwFlags;
284     LPDPSESSIONDESC2    lpSessionDesc;  /* Ptr to session desc to use for connect */
285     LPDPNAME            lpPlayerName;   /* Ptr to player name structure */
286     GUID                guidSP;         /* GUID of Service Provider to use */
287     LPVOID              lpAddress;      /* Ptr to Address of Service Provider to use */
288     DWORD               dwAddressSize;  /* Size of address data */
289 } DPLCONNECTION, *LPDPLCONNECTION;
290
291 /* DPLCONNECTION flags (for dwFlags) */
292 #define DPLCONNECTION_CREATESESSION DPOPEN_CREATE
293 #define DPLCONNECTION_JOINSESSION   DPOPEN_JOIN
294
295 typedef struct tagDPCHAT
296 {
297     DWORD               dwSize;
298     DWORD               dwFlags;
299     union
300     {                          /* Message string */
301         LPWSTR  lpszMessage;   /* Unicode */
302         LPSTR   lpszMessageA;  /* ANSI */
303     } DUMMYUNIONNAME;
304 } DPCHAT, *LPDPCHAT;
305
306 typedef struct
307 {
308   UINT   len;
309   PUCHAR pData;
310 } SGBUFFER, *PSGBUFFER, *LPSGBUFFER;
311
312
313 typedef struct tagDPSECURITYDESC
314 {
315     DWORD dwSize;                   /* Size of structure */
316     DWORD dwFlags;                  /* Not used. Must be zero. */
317     union
318     {                               /* SSPI provider name */
319         LPWSTR  lpszSSPIProvider;   /* Unicode */
320         LPSTR   lpszSSPIProviderA;  /* ANSI */
321     } DUMMYUNIONNAME1;
322     union
323     {                               /* CAPI provider name */
324         LPWSTR lpszCAPIProvider;    /* Unicode */
325         LPSTR  lpszCAPIProviderA;   /* ANSI */
326     } DUMMYUNIONNAME2;
327     DWORD dwCAPIProviderType;       /* Crypto Service Provider type */
328     DWORD dwEncryptionAlgorithm;    /* Encryption Algorithm type */
329 } DPSECURITYDESC, *LPDPSECURITYDESC;
330
331 typedef const DPSECURITYDESC *LPCDPSECURITYDESC;
332
333 typedef struct tagDPCREDENTIALS
334 {
335     DWORD dwSize;               /* Size of structure */
336     DWORD dwFlags;              /* Not used. Must be zero. */
337     union
338     {                           /* User name of the account */
339         LPWSTR  lpszUsername;   /* Unicode */
340         LPSTR   lpszUsernameA;  /* ANSI */
341     } DUMMYUNIONNAME1;
342     union
343     {                           /* Password of the account */
344         LPWSTR  lpszPassword;   /* Unicode */
345         LPSTR   lpszPasswordA;  /* ANSI */
346     } DUMMYUNIONNAME2;
347     union
348     {                           /* Domain name of the account */
349         LPWSTR  lpszDomain;     /* Unicode */
350         LPSTR   lpszDomainA;    /* ANSI */
351     } DUMMYUNIONNAME3;
352 } DPCREDENTIALS, *LPDPCREDENTIALS;
353
354 typedef const DPCREDENTIALS *LPCDPCREDENTIALS;
355
356
357
358 typedef BOOL (CALLBACK *LPDPENUMDPCALLBACKW)(
359     LPGUID      lpguidSP,
360     LPWSTR      lpSPName,
361     DWORD       dwMajorVersion,
362     DWORD       dwMinorVersion,
363     LPVOID      lpContext);
364
365 typedef BOOL (CALLBACK *LPDPENUMDPCALLBACKA)(
366     LPGUID      lpguidSP,
367     LPSTR       lpSPName,       /* ptr to str w/ driver description */
368     DWORD       dwMajorVersion, /* Major # of driver spec in lpguidSP */
369     DWORD       dwMinorVersion, /* Minor # of driver spec in lpguidSP */
370     LPVOID      lpContext);     /* User given */
371
372 #ifndef __LPCGUID_DEFINED__
373 #define __LPCGUID_DEFINED__
374 typedef const GUID *LPCGUID;
375 #endif
376
377 typedef const DPNAME *LPCDPNAME;
378
379 typedef BOOL (CALLBACK *LPDPENUMCONNECTIONSCALLBACK)(
380     LPCGUID     lpguidSP,
381     LPVOID      lpConnection,
382     DWORD       dwConnectionSize,
383     LPCDPNAME   lpName,
384     DWORD       dwFlags,
385     LPVOID      lpContext);
386
387 typedef BOOL (CALLBACK *LPDPENUMSESSIONSCALLBACK)(
388     LPDPSESSIONDESC lpDPSessionDesc,
389     LPVOID      lpContext,
390     LPDWORD     lpdwTimeOut,
391     DWORD       dwFlags);
392
393
394 extern HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA, LPVOID );
395 extern HRESULT WINAPI DirectPlayEnumerateW( LPDPENUMDPCALLBACKW, LPVOID );
396 extern HRESULT WINAPI DirectPlayCreate( LPGUID lpGUID, LPDIRECTPLAY2 *lplpDP, IUnknown *pUnk);
397
398 typedef BOOL (CALLBACK *LPDPENUMPLAYERSCALLBACK)(
399     DPID   dpId,
400     LPSTR  lpFriendlyName,
401     LPSTR  lpFormalName,
402     DWORD  dwFlags,
403     LPVOID          lpContext );
404
405 typedef BOOL (CALLBACK *LPDPENUMPLAYERSCALLBACK2)(
406     DPID            dpId,
407     DWORD           dwPlayerType,
408     LPCDPNAME       lpName,
409     DWORD           dwFlags,
410     LPVOID          lpContext );
411
412 typedef BOOL (CALLBACK *LPDPENUMSESSIONSCALLBACK2)(
413     LPCDPSESSIONDESC2   lpThisSD,
414     LPDWORD             lpdwTimeOut,
415     DWORD               dwFlags,
416     LPVOID              lpContext );
417
418 #define DPESC_TIMEDOUT          0x00000001
419
420 /*****************************************************************************
421  * IDirectPlay interface
422  */
423 #define ICOM_INTERFACE IDirectPlay
424 #define IDirectPlay_METHODS \
425     ICOM_METHOD2(HRESULT,AddPlayerToGroup,      DPID,idGroup, DPID,idPlayer) \
426     ICOM_METHOD (HRESULT,Close) \
427     ICOM_METHOD4(HRESULT,CreatePlayer,          LPDPID,lpidPlayer, LPSTR,lpPlayerName, LPSTR,, LPHANDLE,) \
428     ICOM_METHOD3(HRESULT,CreateGroup,           LPDPID,lpidGroup, LPSTR,lpGroupName, LPSTR,) \
429     ICOM_METHOD2(HRESULT,DeletePlayerFromGroup, DPID,idGroup, DPID,idPlayer) \
430     ICOM_METHOD1(HRESULT,DestroyPlayer,         DPID,idPlayer) \
431     ICOM_METHOD1(HRESULT,DestroyGroup,          DPID,idGroup) \
432     ICOM_METHOD1(HRESULT,EnableNewPlayers,      BOOL,) \
433     ICOM_METHOD4(HRESULT,EnumGroupPlayers,      DPID,idGroup, LPDPENUMPLAYERSCALLBACK,lpEnumPlayersCallback, LPVOID,lpContext, DWORD,dwFlags) \
434     ICOM_METHOD4(HRESULT,EnumGroups,            DWORD,, LPDPENUMPLAYERSCALLBACK,lpEnumPlayersCallback, LPVOID,lpContext, DWORD,dwFlags) \
435     ICOM_METHOD4(HRESULT,EnumPlayers,           DWORD,, LPDPENUMPLAYERSCALLBACK,lpEnumPlayersCallback, LPVOID,lpContext, DWORD,dwFlags) \
436     ICOM_METHOD5(HRESULT,EnumSessions,          LPDPSESSIONDESC,lpsd, DWORD,dwTimeout, LPDPENUMSESSIONSCALLBACK,lpEnumSessionsCallback, LPVOID,lpContext, DWORD,dwFlags) \
437     ICOM_METHOD1(HRESULT,GetCaps,               LPDPCAPS,lpDPCaps) \
438     ICOM_METHOD2(HRESULT,GetMessageCount,       DPID,idPlayer, LPDWORD,lpdwCount) \
439     ICOM_METHOD2(HRESULT,GetPlayerCaps,         DPID,idPlayer, LPDPCAPS,lpPlayerCaps) \
440     ICOM_METHOD5(HRESULT,GetPlayerName,         DPID,idPlayer, LPSTR,, LPDWORD,, LPSTR,, LPDWORD,) \
441     ICOM_METHOD1(HRESULT,Initialize,            LPGUID,lpGUID) \
442     ICOM_METHOD1(HRESULT,Open,                  LPDPSESSIONDESC,lpsd) \
443     ICOM_METHOD5(HRESULT,Receive,               LPDPID,lpidFrom, LPDPID,lpidTo, DWORD,dwFlags, LPVOID,lpData, LPDWORD,lpdwDataSize) \
444     ICOM_METHOD1(HRESULT,SaveSession,           LPSTR,) \
445     ICOM_METHOD5(HRESULT,Send,                  DPID,idFrom, DPID,idTo, DWORD,dwFlags, LPVOID,lpData, DWORD,dwDataSize) \
446     ICOM_METHOD3(HRESULT,SetPlayerName,         DPID,idPlayer, LPSTR,lpPlayerName, LPSTR,)
447 #define IDirectPlay_IMETHODS \
448     IUnknown_IMETHODS \
449     IDirectPlay_METHODS
450 ICOM_DEFINE(IDirectPlay,IUnknown)
451 #undef ICOM_INTERFACE
452
453     /*** IUnknown methods ***/
454 #define IDirectPlay_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
455 #define IDirectPlay_AddRef(p)             ICOM_CALL (AddRef,p)
456 #define IDirectPlay_Release(p)            ICOM_CALL (Release,p)
457 /*** IDirectPlay methods ***/
458 #define IDirectPlay_AddPlayerToGroup(p,a,b)      ICOM_CALL2(AddPlayerToGroup,p,a,b)
459 #define IDirectPlay_Close(p)                     ICOM_CALL (Close,p)
460 #define IDirectPlay_CreatePlayer(p,a,b,c,d)      ICOM_CALL4(CreatePlayer,p,a,b,c,d)
461 #define IDirectPlay_CreateGroup(p,a,b,c)         ICOM_CALL3(CreateGroup,p,a,b,c)
462 #define IDirectPlay_DeletePlayerFromGroup(p,a,b) ICOM_CALL2(DeletePlayerFromGroup,p,a,b)
463 #define IDirectPlay_DestroyPlayer(p,a)           ICOM_CALL1(DestroyPlayer,p,a)
464 #define IDirectPlay_DestroyGroup(p,a)            ICOM_CALL1(DestroyGroup,p,a)
465 #define IDirectPlay_EnableNewPlayers(p,a)        ICOM_CALL1(EnableNewPlayers,p,a)
466 #define IDirectPlay_EnumGroupPlayers(p,a,b,c,d)  ICOM_CALL4(EnumGroupPlayers,p,a,b,c,d)
467 #define IDirectPlay_EnumGroups(p,a,b,c,d)        ICOM_CALL4(EnumGroups,p,a,b,c,d)
468 #define IDirectPlay_EnumPlayers(p,a,b,c,d)       ICOM_CALL4(EnumPlayers,p,a,b,c,d)
469 #define IDirectPlay_EnumSessions(p,a,b,c,d,e)    ICOM_CALL5(EnumSessions,p,a,b,c,d,e)
470 #define IDirectPlay_GetCaps(p,a)                 ICOM_CALL1(GetCaps,p,a)
471 #define IDirectPlay_GetMessageCount(p,a,b)       ICOM_CALL2(GetMessageCount,p,a,b)
472 #define IDirectPlay_GetPlayerCaps(p,a,b)         ICOM_CALL2(GetPlayerCaps,p,a,b)
473 #define IDirectPlay_GetPlayerName(p,a,b,c,d,e)   ICOM_CALL5(GetPlayerName,p,a,b,c,d,e)
474 #define IDirectPlay_Initialize(p,a)              ICOM_CALL1(Initialize,p,a)
475 #define IDirectPlay_Open(p,a)                    ICOM_CALL1(Open,p,a)
476 #define IDirectPlay_Receive(p,a,b,c,d,e)         ICOM_CALL5(Receive,p,a,b,c,d,e)
477 #define IDirectPlay_SaveSession(p,a)             ICOM_CALL1(SaveSession,p,a)
478 #define IDirectPlay_Send(p,a,b,c,d,e)            ICOM_CALL5(Send,p,a,b,c,d,e)
479 #define IDirectPlay_SetPlayerName(p,a,b,c)       ICOM_CALL3(SetPlayerName,p,a,b,c)
480
481
482 /*****************************************************************************
483  * IDirectPlay2 and IDirectPlay2A interface
484  */
485 #define ICOM_INTERFACE IDirectPlay2
486 #define IDirectPlay2_METHODS \
487     ICOM_METHOD2(HRESULT,AddPlayerToGroup,      DPID,idGroup, DPID,idPlayer) \
488     ICOM_METHOD (HRESULT,Close) \
489     ICOM_METHOD5(HRESULT,CreateGroup,           LPDPID,lpidGroup, LPDPNAME,lpGroupName, LPVOID,lpData, DWORD,dwDataSize, DWORD,dwFlags) \
490     ICOM_METHOD6(HRESULT,CreatePlayer,          LPDPID,lpidPlayer, LPDPNAME,lpPlayerName, HANDLE,hEvent, LPVOID,lpData, DWORD,dwDataSize, DWORD,dwFlags) \
491     ICOM_METHOD2(HRESULT,DeletePlayerFromGroup, DPID,idGroup, DPID,idPlayer) \
492     ICOM_METHOD1(HRESULT,DestroyGroup,          DPID,idGroup) \
493     ICOM_METHOD1(HRESULT,DestroyPlayer,         DPID,idPlayer) \
494     ICOM_METHOD5(HRESULT,EnumGroupPlayers,      DPID,idGroup, LPGUID,lpguidInstance, LPDPENUMPLAYERSCALLBACK2,lpEnumPlayersCallback2, LPVOID,lpContext, DWORD,dwFlags) \
495     ICOM_METHOD4(HRESULT,EnumGroups,            LPGUID,lpguidInstance, LPDPENUMPLAYERSCALLBACK2,lpEnumPlayersCallback2, LPVOID,lpContext, DWORD,dwFlags) \
496     ICOM_METHOD4(HRESULT,EnumPlayers,           LPGUID,lpguidInstance, LPDPENUMPLAYERSCALLBACK2,lpEnumPlayersCallback2, LPVOID,lpContext, DWORD,dwFlags) \
497     ICOM_METHOD5(HRESULT,EnumSessions,          LPDPSESSIONDESC2,lpsd, DWORD,dwTimeout, LPDPENUMSESSIONSCALLBACK2,lpEnumSessionsCallback2, LPVOID,lpContext, DWORD,dwFlags) \
498     ICOM_METHOD2(HRESULT,GetCaps,               LPDPCAPS,lpDPCaps, DWORD,dwFlags) \
499     ICOM_METHOD4(HRESULT,GetGroupData,          DPID,idGroup, LPVOID,lpData, LPDWORD,lpdwDataSize, DWORD,dwFlags) \
500     ICOM_METHOD3(HRESULT,GetGroupName,          DPID,idGroup, LPVOID,lpData, LPDWORD,lpdwDataSize) \
501     ICOM_METHOD2(HRESULT,GetMessageCount,       DPID,idPlayer, LPDWORD,lpdwCount) \
502     ICOM_METHOD3(HRESULT,GetPlayerAddress,      DPID,idPlayer, LPVOID,lpData, LPDWORD,lpdwDataSize) \
503     ICOM_METHOD3(HRESULT,GetPlayerCaps,         DPID,idPlayer, LPDPCAPS,lpPlayerCaps, DWORD,dwFlags) \
504     ICOM_METHOD4(HRESULT,GetPlayerData,         DPID,idPlayer, LPVOID,lpData, LPDWORD,lpdwDataSize, DWORD,dwFlags) \
505     ICOM_METHOD3(HRESULT,GetPlayerName,         DPID,idPlayer, LPVOID,lpData, LPDWORD,lpdwDataSize) \
506     ICOM_METHOD2(HRESULT,GetSessionDesc,        LPVOID,lpData, LPDWORD,lpdwDataSize) \
507     ICOM_METHOD1(HRESULT,Initialize,            LPGUID,lpGUID) \
508     ICOM_METHOD2(HRESULT,Open,                  LPDPSESSIONDESC2,lpsd, DWORD,dwFlags) \
509     ICOM_METHOD5(HRESULT,Receive,               LPDPID,lpidFrom, LPDPID,lpidTo, DWORD,dwFlags, LPVOID,lpData, LPDWORD,lpdwDataSize) \
510     ICOM_METHOD5(HRESULT,Send,                  DPID,idFrom, DPID,idTo, DWORD,dwFlags, LPVOID,lpData, DWORD,dwDataSize) \
511     ICOM_METHOD4(HRESULT,SetGroupData,          DPID,idGroup, LPVOID,lpData, DWORD,dwDataSize, DWORD,dwFlags) \
512     ICOM_METHOD3(HRESULT,SetGroupName,          DPID,idGroup, LPDPNAME,lpGroupName, DWORD,dwFlags) \
513     ICOM_METHOD4(HRESULT,SetPlayerData,         DPID,idPlayer, LPVOID,lpData, DWORD,dwDataSize, DWORD,dwFlags) \
514     ICOM_METHOD3(HRESULT,SetPlayerName,         DPID,idPlayer, LPDPNAME,lpPlayerName, DWORD,dwFlags) \
515     ICOM_METHOD2(HRESULT,SetSessionDesc,        LPDPSESSIONDESC2,lpSessDesc, DWORD,dwFlags)
516 #define IDirectPlay2_IMETHODS \
517     IUnknown_IMETHODS \
518     IDirectPlay2_METHODS
519 ICOM_DEFINE(IDirectPlay2,IUnknown)
520 #undef ICOM_INTERFACE
521
522 /*** IUnknown methods ***/
523 #define IDirectPlay2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
524 #define IDirectPlay2_AddRef(p)             ICOM_CALL (AddRef,p)
525 #define IDirectPlay2_Release(p)            ICOM_CALL (Release,p)
526     /*** IDirectPlay2 methods ***/
527 #define IDirectPlay2_AddPlayerToGroup(p,a,b)       ICOM_CALL2(AddPlayerToGroup,p,a,b)
528 #define IDirectPlay2_Close(p)                      ICOM_CALL (Close,p)
529 #define IDirectPlay2_CreateGroup(p,a,b,c,d,e)      ICOM_CALL5(CreateGroup,p,a,b,c,d,e)
530 #define IDirectPlay2_CreatePlayer(p,a,b,c,d,e,f)   ICOM_CALL6(CreatePlayer,p,a,b,c,d,e,f)
531 #define IDirectPlay2_DeletePlayerFromGroup(p,a,b)  ICOM_CALL2(DeletePlayerFromGroup,p,a,b)
532 #define IDirectPlay2_DestroyGroup(p,a)             ICOM_CALL1(DestroyGroup,p,a)
533 #define IDirectPlay2_DestroyPlayer(p,a)            ICOM_CALL1(DestroyPlayer,p,a)
534 #define IDirectPlay2_EnumGroupPlayers(p,a,b,c,d,e) ICOM_CALL5(EnumGroupPlayers,p,a,b,c,d,e)
535 #define IDirectPlay2_EnumGroups(p,a,b,c,d)         ICOM_CALL4(EnumGroups,p,a,b,c,d)
536 #define IDirectPlay2_EnumPlayers(p,a,b,c,d)        ICOM_CALL4(EnumPlayers,p,a,b,c,d)
537 #define IDirectPlay2_EnumSessions(p,a,b,c,d,e)     ICOM_CALL5(EnumSessions,p,a,b,c,d,e)
538 #define IDirectPlay2_GetCaps(p,a,b)                ICOM_CALL2(GetCaps,p,a,b)
539 #define IDirectPlay2_GetGroupData(p,a,b,c,d)       ICOM_CALL4(GetGroupData,p,a,b,c,d)
540 #define IDirectPlay2_GetGroupName(p,a,b,c)         ICOM_CALL3(GetGroupName,p,a,b,c)
541 #define IDirectPlay2_GetMessageCount(p,a,b)        ICOM_CALL2(GetMessageCount,p,a,b)
542 #define IDirectPlay2_GetPlayerAddress(p,a,b,c)     ICOM_CALL3(GetPlayerAddress,p,a,b,c)
543 #define IDirectPlay2_GetPlayerCaps(p,a,b,c)        ICOM_CALL3(GetPlayerCaps,p,a,b,c)
544 #define IDirectPlay2_GetPlayerData(p,a,b,c,d)      ICOM_CALL4(GetPlayerData,p,a,b,c,d)
545 #define IDirectPlay2_GetPlayerName(p,a,b,c)        ICOM_CALL3(GetPlayerName,p,a,b,c)
546 #define IDirectPlay2_GetSessionDesc(p,a,b)         ICOM_CALL2(GetSessionDesc,p,a,b)
547 #define IDirectPlay2_Initialize(p,a)               ICOM_CALL1(Initialize,p,a)
548 #define IDirectPlay2_Open(p,a,b)                   ICOM_CALL2(Open,p,a,b)
549 #define IDirectPlay2_Receive(p,a,b,c,d,e)          ICOM_CALL5(Receive,p,a,b,c,d,e)
550 #define IDirectPlay2_Send(p,a,b,c,d,e)             ICOM_CALL5(Send,p,a,b,c,d,e)
551 #define IDirectPlay2_SetGroupData(p,a,b,c,d)       ICOM_CALL4(SetGroupData,p,a,b,c,d)
552 #define IDirectPlay2_SetGroupName(p,a,b,c)         ICOM_CALL3(SetGroupName,p,a,b,c)
553 #define IDirectPlay2_SetPlayerData(p,a,b,c,d)      ICOM_CALL4(SetPlayerData,p,a,b,c,d)
554 #define IDirectPlay2_SetPlayerName(p,a,b,c)        ICOM_CALL3(SetPlayerName,p,a,b,c)
555 #define IDirectPlay2_SetSessionDesc(p,a,b)         ICOM_CALL2(SetSessionDesc,p,a,b)
556
557
558 /*****************************************************************************
559  * IDirectPlay3 and IDirectPlay3A interface
560  */
561 #define ICOM_INTERFACE IDirectPlay3
562 #define IDirectPlay3_METHODS \
563     ICOM_METHOD2(HRESULT,AddGroupToGroup,            DPID,idParentGroup, DPID,idGroup) \
564     ICOM_METHOD6(HRESULT,CreateGroupInGroup,         DPID,idParentGroup, LPDPID,lpidGroup, LPDPNAME,lpGroupName, LPVOID,lpData, DWORD,dwDataSize, DWORD,dwFlags) \
565     ICOM_METHOD2(HRESULT,DeleteGroupFromGroup,       DPID,idParentGroup, DPID,idGroup) \
566     ICOM_METHOD4(HRESULT,EnumConnections,            LPCGUID,lpguidApplication, LPDPENUMCONNECTIONSCALLBACK,lpEnumCallback, LPVOID,lpContext, DWORD,dwFlags) \
567     ICOM_METHOD5(HRESULT,EnumGroupsInGroup,          DPID,idGroup, LPGUID,lpguidInstance, LPDPENUMPLAYERSCALLBACK2,lpEnumCallback, LPVOID,lpContext, DWORD,dwFlags) \
568     ICOM_METHOD4(HRESULT,GetGroupConnectionSettings, DWORD,dwFlags, DPID,idGroup, LPVOID,lpData, LPDWORD,lpdwDataSize) \
569     ICOM_METHOD2(HRESULT,InitializeConnection,       LPVOID,lpConnection, DWORD,dwFlags) \
570     ICOM_METHOD4(HRESULT,SecureOpen,                 LPCDPSESSIONDESC2,lpsd, DWORD,dwFlags, LPCDPSECURITYDESC,lpSecurity, LPCDPCREDENTIALS,lpCredentials) \
571     ICOM_METHOD4(HRESULT,SendChatMessage,            DPID,idFrom, DPID,idTo, DWORD,dwFlags, LPDPCHAT,lpChatMessage) \
572     ICOM_METHOD3(HRESULT,SetGroupConnectionSettings, DWORD,dwFlags, DPID,idGroup, LPDPLCONNECTION,lpConnection) \
573     ICOM_METHOD2(HRESULT,StartSession,               DWORD,dwFlags, DPID,idGroup) \
574     ICOM_METHOD2(HRESULT,GetGroupFlags,              DPID,idGroup, LPDWORD,lpdwFlags) \
575     ICOM_METHOD2(HRESULT,GetGroupParent,             DPID,idGroup, LPDPID,lpidParent) \
576     ICOM_METHOD4(HRESULT,GetPlayerAccount,           DPID,idPlayer, DWORD,dwFlags, LPVOID,lpData, LPDWORD,lpdwDataSize) \
577     ICOM_METHOD2(HRESULT,GetPlayerFlags,             DPID,idPlayer, LPDWORD,lpdwFlags)
578 #define IDirectPlay3_IMETHODS \
579     IDirectPlay2_IMETHODS \
580     IDirectPlay3_METHODS
581 ICOM_DEFINE(IDirectPlay3,IDirectPlay2)
582 #undef ICOM_INTERFACE
583
584 /*** IUnknown methods ***/
585 #define IDirectPlay3_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
586 #define IDirectPlay3_AddRef(p)             ICOM_CALL (AddRef,p)
587 #define IDirectPlay3_Release(p)            ICOM_CALL (Release,p)
588 /*** IDirectPlay2 methods ***/
589 #define IDirectPlay3_AddPlayerToGroup(p,a,b)       ICOM_CALL2(AddPlayerToGroup,p,a,b)
590 #define IDirectPlay3_Close(p)                      ICOM_CALL (Close,p)
591 #define IDirectPlay3_CreateGroup(p,a,b,c,d,e)      ICOM_CALL5(CreateGroup,p,a,b,c,d,e)
592 #define IDirectPlay3_CreatePlayer(p,a,b,c,d,e,f)   ICOM_CALL6(CreatePlayer,p,a,b,c,d,e,f)
593 #define IDirectPlay3_DeletePlayerFromGroup(p,a,b)  ICOM_CALL2(DeletePlayerFromGroup,p,a,b)
594 #define IDirectPlay3_DestroyGroup(p,a)             ICOM_CALL1(DestroyGroup,p,a)
595 #define IDirectPlay3_DestroyPlayer(p,a)            ICOM_CALL1(DestroyPlayer,p,a)
596 #define IDirectPlay3_EnumGroupPlayers(p,a,b,c,d,e) ICOM_CALL5(EnumGroupPlayers,p,a,b,c,d,e)
597 #define IDirectPlay3_EnumGroups(p,a,b,c,d)         ICOM_CALL4(EnumGroups,p,a,b,c,d)
598 #define IDirectPlay3_EnumPlayers(p,a,b,c,d)        ICOM_CALL4(EnumPlayers,p,a,b,c,d)
599 #define IDirectPlay3_EnumSessions(p,a,b,c,d,e)     ICOM_CALL5(EnumSessions,p,a,b,c,d,e)
600 #define IDirectPlay3_GetCaps(p,a,b)                ICOM_CALL2(GetCaps,p,a,b)
601 #define IDirectPlay3_GetGroupData(p,a,b,c,d)       ICOM_CALL4(GetGroupData,p,a,b,c,d)
602 #define IDirectPlay3_GetGroupName(p,a,b,c)         ICOM_CALL3(GetGroupName,p,a,b,c)
603 #define IDirectPlay3_GetMessageCount(p,a,b)        ICOM_CALL2(GetMessageCount,p,a,b)
604 #define IDirectPlay3_GetPlayerAddress(p,a,b,c)     ICOM_CALL3(GetPlayerAddress,p,a,b,c)
605 #define IDirectPlay3_GetPlayerCaps(p,a,b,c)        ICOM_CALL3(GetPlayerCaps,p,a,b,c)
606 #define IDirectPlay3_GetPlayerData(p,a,b,c,d)      ICOM_CALL4(GetPlayerData,p,a,b,c,d)
607 #define IDirectPlay3_GetPlayerName(p,a,b,c)        ICOM_CALL3(GetPlayerName,p,a,b,c)
608 #define IDirectPlay3_GetSessionDesc(p,a,b)         ICOM_CALL2(GetSessionDesc,p,a,b)
609 #define IDirectPlay3_Initialize(p,a)               ICOM_CALL1(Initialize,p,a)
610 #define IDirectPlay3_Open(p,a,b)                   ICOM_CALL2(Open,p,a,b)
611 #define IDirectPlay3_Receive(p,a,b,c,d,e)          ICOM_CALL5(Receive,p,a,b,c,d,e)
612 #define IDirectPlay3_Send(p,a,b,c,d,e)             ICOM_CALL5(Send,p,a,b,c,d,e)
613 #define IDirectPlay3_SetGroupData(p,a,b,c,d)       ICOM_CALL4(SetGroupData,p,a,b,c,d)
614 #define IDirectPlay3_SetGroupName(p,a,b,c)         ICOM_CALL3(SetGroupName,p,a,b,c)
615 #define IDirectPlay3_SetPlayerData(p,a,b,c,d)      ICOM_CALL4(SetPlayerData,p,a,b,c,d)
616 #define IDirectPlay3_SetPlayerName(p,a,b,c)        ICOM_CALL3(SetPlayerName,p,a,b,c)
617 #define IDirectPlay3_SetSessionDesc(p,a,b)         ICOM_CALL2(SetSessionDesc,p,a,b)
618 /*** IDirectPlay3 methods ***/
619 #define IDirectPlay3_AddGroupToGroup(p,a,b)                ICOM_CALL2(AddGroupToGroup,p,a,b)
620 #define IDirectPlay3_CreateGroupInGroup(p,a,b,c,d,e,f)     ICOM_CALL6(CreateGroupInGroup,p,a,b,c,d,e,f)
621 #define IDirectPlay3_DeleteGroupFromGroup(p,a,b)           ICOM_CALL2(DeleteGroupFromGroup,p,a,b)
622 #define IDirectPlay3_EnumConnections(p,a,b,c,d)            ICOM_CALL4(EnumConnections,p,a,b,c,d)
623 #define IDirectPlay3_EnumGroupsInGroup(p,a,b,c,d,e)        ICOM_CALL5(EnumGroupsInGroup,p,a,b,c,d,e)
624 #define IDirectPlay3_GetGroupConnectionSettings(p,a,b,c,d) ICOM_CALL4(GetGroupConnectionSettings,p,a,b,c,d)
625 #define IDirectPlay3_InitializeConnection(p,a,b)           ICOM_CALL2(InitializeConnection,p,a,b)
626 #define IDirectPlay3_SecureOpen(p,a,b,c,d)                 ICOM_CALL4(SecureOpen,p,a,b,c,d)
627 #define IDirectPlay3_SendChatMessage(p,a,b,c,d)            ICOM_CALL4(SendChatMessage,p,a,b,c,d)
628 #define IDirectPlay3_SetGroupConnectionSettings(p,a,b,c)   ICOM_CALL3(SetGroupConnectionSettings,p,a,b,c)
629 #define IDirectPlay3_StartSession(p,a,b)                   ICOM_CALL2(StartSession,p,a,b)
630 #define IDirectPlay3_GetGroupFlags(p,a,b)                  ICOM_CALL2(GetGroupFlags,p,a,b)
631 #define IDirectPlay3_GetGroupParent(p,a,b)                 ICOM_CALL2(GetGroupParent,p,a,b)
632 #define IDirectPlay3_GetPlayerAccount(p,a,b,c,d)           ICOM_CALL4(GetPlayerAccount,p,a,b,c,d)
633 #define IDirectPlay3_GetPlayerFlags(p,a,b)                 ICOM_CALL2(GetPlayerFlags,p,a,b)
634
635 /*****************************************************************************
636  * IDirectPlay4 and IDirectPlay4A interface
637  */
638 #define ICOM_INTERFACE IDirectPlay4
639 #define IDirectPlay4_METHODS \
640     ICOM_METHOD2( HRESULT, GetGroupOwner,        DPID,, LPDPID, ) \
641     ICOM_METHOD2( HRESULT, SetGroupOwner,        DPID,, DPID, ) \
642     ICOM_METHOD9( HRESULT, SendEx,               DPID,, DPID,, DWORD,, LPVOID,, DWORD,, DWORD,, DWORD,, LPVOID,, LPDWORD, ) \
643     ICOM_METHOD5( HRESULT, GetMessageQueue,      DPID,, DPID,, DWORD,, LPDWORD,, LPDWORD, ) \
644     ICOM_METHOD2( HRESULT, CancelMessage,        DWORD,, DWORD, ) \
645     ICOM_METHOD3( HRESULT, CancelPriority,       DWORD,, DWORD,, DWORD, )
646
647 #define IDirectPlay4_IMETHODS \
648     IDirectPlay3_IMETHODS \
649     IDirectPlay4_METHODS
650 ICOM_DEFINE(IDirectPlay4,IDirectPlay3)
651 #undef ICOM_INTERFACE
652
653 /*** IUnknown methods ***/
654 #define IDirectPlayX_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
655 #define IDirectPlayX_AddRef(p)             ICOM_CALL (AddRef,p)
656 #define IDirectPlayX_Release(p)            ICOM_CALL (Release,p)
657 /*** IDirectPlay2 methods ***/
658 #define IDirectPlayX_AddPlayerToGroup(p,a,b)       ICOM_CALL2(AddPlayerToGroup,p,a,b)
659 #define IDirectPlayX_Close(p)                      ICOM_CALL (Close,p)
660 #define IDirectPlayX_CreateGroup(p,a,b,c,d,e)      ICOM_CALL5(CreateGroup,p,a,b,c,d,e)
661 #define IDirectPlayX_CreatePlayer(p,a,b,c,d,e,f)   ICOM_CALL6(CreatePlayer,p,a,b,c,d,e,f)
662 #define IDirectPlayX_DeletePlayerFromGroup(p,a,b)  ICOM_CALL2(DeletePlayerFromGroup,p,a,b)
663 #define IDirectPlayX_DestroyGroup(p,a)             ICOM_CALL1(DestroyGroup,p,a)
664 #define IDirectPlayX_DestroyPlayer(p,a)            ICOM_CALL1(DestroyPlayer,p,a)
665 #define IDirectPlayX_EnumGroupPlayers(p,a,b,c,d,e) ICOM_CALL5(EnumGroupPlayers,p,a,b,c,d,e)
666 #define IDirectPlayX_EnumGroups(p,a,b,c,d)         ICOM_CALL4(EnumGroups,p,a,b,c,d)
667 #define IDirectPlayX_EnumPlayers(p,a,b,c,d)        ICOM_CALL4(EnumPlayers,p,a,b,c,d)
668 #define IDirectPlayX_EnumSessions(p,a,b,c,d,e)     ICOM_CALL5(EnumSessions,p,a,b,c,d,e)
669 #define IDirectPlayX_GetCaps(p,a,b)                ICOM_CALL2(GetCaps,p,a,b)
670 #define IDirectPlayX_GetGroupData(p,a,b,c,d)       ICOM_CALL4(GetGroupData,p,a,b,c,d)
671 #define IDirectPlayX_GetGroupName(p,a,b,c)         ICOM_CALL3(GetGroupName,p,a,b,c)
672 #define IDirectPlayX_GetMessageCount(p,a,b)        ICOM_CALL2(GetMessageCount,p,a,b)
673 #define IDirectPlayX_GetPlayerAddress(p,a,b,c)     ICOM_CALL3(GetPlayerAddress,p,a,b,c)
674 #define IDirectPlayX_GetPlayerCaps(p,a,b,c)        ICOM_CALL3(GetPlayerCaps,p,a,b,c)
675 #define IDirectPlayX_GetPlayerData(p,a,b,c,d)      ICOM_CALL4(GetPlayerData,p,a,b,c,d)
676 #define IDirectPlayX_GetPlayerName(p,a,b,c)        ICOM_CALL3(GetPlayerName,p,a,b,c)
677 #define IDirectPlayX_GetSessionDesc(p,a,b)         ICOM_CALL2(GetSessionDesc,p,a,b)
678 #define IDirectPlayX_Initialize(p,a)               ICOM_CALL1(Initialize,p,a)
679 #define IDirectPlayX_Open(p,a,b)                   ICOM_CALL2(Open,p,a,b)
680 #define IDirectPlayX_Receive(p,a,b,c,d,e)          ICOM_CALL5(Receive,p,a,b,c,d,e)
681 #define IDirectPlayX_Send(p,a,b,c,d,e)             ICOM_CALL5(Send,p,a,b,c,d,e)
682 #define IDirectPlayX_SetGroupData(p,a,b,c,d)       ICOM_CALL4(SetGroupData,p,a,b,c,d)
683 #define IDirectPlayX_SetGroupName(p,a,b,c)         ICOM_CALL3(SetGroupName,p,a,b,c)
684 #define IDirectPlayX_SetPlayerData(p,a,b,c,d)      ICOM_CALL4(SetPlayerData,p,a,b,c,d)
685 #define IDirectPlayX_SetPlayerName(p,a,b,c)        ICOM_CALL3(SetPlayerName,p,a,b,c)
686 #define IDirectPlayX_SetSessionDesc(p,a,b)         ICOM_CALL2(SetSessionDesc,p,a,b)
687 /*** IDirectPlay3 methods ***/
688 #define IDirectPlayX_AddGroupToGroup(p,a,b)                ICOM_CALL2(AddGroupToGroup,p,a,b)
689 #define IDirectPlayX_CreateGroupInGroup(p,a,b,c,d,e,f)     ICOM_CALL6(CreateGroupInGroup,p,a,b,c,d,e,f)
690 #define IDirectPlayX_DeleteGroupFromGroup(p,a,b)           ICOM_CALL2(DeleteGroupFromGroup,p,a,b)
691 #define IDirectPlayX_EnumConnections(p,a,b,c,d)            ICOM_CALL4(EnumConnections,p,a,b,c,d)
692 #define IDirectPlayX_EnumGroupsInGroup(p,a,b,c,d,e)        ICOM_CALL5(EnumGroupsInGroup,p,a,b,c,d,e)
693 #define IDirectPlayX_GetGroupConnectionSettings(p,a,b,c,d) ICOM_CALL4(GetGroupConnectionSettings,p,a,b,c,d)
694 #define IDirectPlayX_InitializeConnection(p,a,b)           ICOM_CALL2(InitializeConnection,p,a,b)
695 #define IDirectPlayX_SecureOpen(p,a,b,c,d)                 ICOM_CALL4(SecureOpen,p,a,b,c,d)
696 #define IDirectPlayX_SendChatMessage(p,a,b,c,d)            ICOM_CALL4(SendChatMessage,p,a,b,c,d)
697 #define IDirectPlayX_SetGroupConnectionSettings(p,a,b,c)   ICOM_CALL3(SetGroupConnectionSettings,p,a,b,c)
698 #define IDirectPlayX_StartSession(p,a,b)                   ICOM_CALL2(StartSession,p,a,b)
699 #define IDirectPlayX_GetGroupFlags(p,a,b)                  ICOM_CALL2(GetGroupFlags,p,a,b)
700 #define IDirectPlayX_GetGroupParent(p,a,b)                 ICOM_CALL2(GetGroupParent,p,a,b)
701 #define IDirectPlayX_GetPlayerAccount(p,a,b,c,d)           ICOM_CALL4(GetPlayerAccount,p,a,b,c,d)
702 #define IDirectPlayX_GetPlayerFlags(p,a,b)                 ICOM_CALL2(GetPlayerFlags,p,a,b)
703 /*** IDirectPlay4 methods ***/
704 #define IDirectPlayX_GetGroupOwner(p,a,b)                  ICOM_CALL2(GetGroupOwner,p,a,b)
705 #define IDirectPlayX_SetGroupOwner(p,a,b)                  ICOM_CALL2(SetGroupOwner,p,a,b)
706 #define IDirectPlayX_SendEx(p,a,b,c,d,e,f,g,h,i)           ICOM_CALL9(SendEx,a,b,c,d,e,f,g,h,i)
707 #define IDirectPlayX_GetMessageQueue(p,a,b,c,d,e)          ICOM_CALL5(GetMessageQueue,a,b,c,d,e)
708 #define IDirectPlayX_CancelMessage(p,a,b)                  ICOM_CALL2(CancelMessage,a,b)
709 #define IDirectPlayX_CancelPriority(p,a,b,c)               ICOM_CALL3(CancelPriority,a,b,c)
710
711
712 /* For DirectPlay::EnumConnections */
713 #define DPCONNECTION_DIRECTPLAY      0x00000001
714 #define DPCONNECTION_DIRECTPLAYLOBBY 0x00000002
715
716 /* For DirectPlay::EnumPlayers and DirectPlay::EnumGroups */
717 #define DPENUMPLAYERS_ALL           0x00000000
718 #define DPENUMPLAYERS_LOCAL         0x00000008
719 #define DPENUMPLAYERS_REMOTE        0x00000010
720 #define DPENUMPLAYERS_GROUP         0x00000020
721 #define DPENUMPLAYERS_SESSION       0x00000080
722 #define DPENUMPLAYERS_SERVERPLAYER  0x00000100
723 #define DPENUMPLAYERS_SPECTATOR     0x00000200
724 #define DPENUMPLAYERS_OWNER         0x00002000
725
726 #define DPENUMGROUPS_ALL            DPENUMPLAYERS_ALL
727 #define DPENUMGROUPS_LOCAL          DPENUMPLAYERS_LOCAL
728 #define DPENUMGROUPS_REMOTE         DPENUMPLAYERS_REMOTE
729 #define DPENUMGROUPS_SESSION        DPENUMPLAYERS_SESSION
730 #define DPENUMGROUPS_SHORTCUT       0x00000400
731 #define DPENUMGROUPS_STAGINGAREA    0x00000800
732 #define DPENUMGROUPS_HIDDEN         0x00001000
733
734
735 /* For DirectPlay::CreatePlayer */
736 #define DPPLAYER_SERVERPLAYER  DPENUMPLAYERS_SERVERPLAYER
737 #define DPPLAYER_SPECTATOR     DPENUMPLAYERS_SPECTATOR
738 #define DPPLAYER_LOCAL         DPENUMPLAYERS_LOCAL
739 #define DPPLAYER_OWNER         DPENUMPLAYERS_OWNER
740
741 /* For DirectPlay::CreateGroup */
742 #define DPGROUP_STAGINGAREA  DPENUMGROUPS_STAGINGAREA
743 #define DPGROUP_LOCAL        DPENUMGROUPS_LOCAL
744 #define DPGROUP_HIDDEN       DPENUMGROUPS_HIDDEN
745
746 /* For DirectPlay::EnumSessions */
747 #define DPENUMSESSIONS_AVAILABLE         0x00000001
748 #define DPENUMSESSIONS_ALL               0x00000002
749 #define DPENUMSESSIONS_ASYNC             0x00000010
750 #define DPENUMSESSIONS_STOPASYNC         0x00000020
751 #define DPENUMSESSIONS_PASSWORDREQUIRED  0x00000040
752 #define DPENUMSESSIONS_RETURNSTATUS      0x00000080
753
754 /* For DirectPlay::GetCaps and DirectPlay::GetPlayerCaps */
755 #define DPGETCAPS_GUARANTEED  0x00000001
756
757 /* For DirectPlay::GetGroupData and DirectPlay::GetPlayerData */
758 #define DPGET_REMOTE  0x00000000
759 #define DPGET_LOCAL   0x00000001
760
761 /* For DirectPlay::Receive */
762 #define DPRECEIVE_ALL         0x00000001
763 #define DPRECEIVE_TOPLAYER    0x00000002
764 #define DPRECEIVE_FROMPLAYER  0x00000004
765 #define DPRECEIVE_PEEK        0x00000008
766
767 /* For DirectPlay::Send */
768 #define DPSEND_NONGUARANTEED       0x00000000
769 #define DPSEND_GUARANTEED          0x00000001
770 #define DPSEND_HIGHPRIORITY        0x00000002
771 #define DPSEND_OPENSTREAM          0x00000008
772 #define DPSEND_CLOSESTREAM         0x00000010
773 #define DPSEND_SIGNED              0x00000020
774 #define DPSEND_ENCRYPTED           0x00000040
775 #define DPSEND_LOBBYSYSTEMMESSAGE  0x00000080
776 #define DPSEND_ASYNC               0x00000200
777 #define DPSEND_NOSENDCOMPLETEMSG   0x00000400
778
779 #define DPSEND_MAX_PRI       0x0000FFFF
780 #define DPSEND_MAX_PRIORITY  DPSEND_MAX_PRI
781
782
783 /* For  DirectPlay::SetGroupData, DirectPlay::SetGroupName,
784  * DirectPlay::SetPlayerData, DirectPlay::SetPlayerName and
785  * DirectPlay::SetSessionDesc.
786  */
787 #define DPSET_REMOTE      0x00000000
788 #define DPSET_LOCAL       0x00000001
789 #define DPSET_GUARANTEED  0x00000002
790
791 /* For DirectPlay::GetMessageQueue */
792 #define DPMESSAGEQUEUE_SEND    0x00000001
793 #define DPMESSAGEQUEUE_RECEIVE 0x00000002
794
795 /* DirectPlay::Connect */
796 #define DPCONNECT_RETURNSTATUS  (DPENUMSESSIONS_RETURNSTATUS)
797
798
799 /** DirectPlay system messages **/
800
801 /* A new player or group has been created in the session */
802 #define DPSYS_CREATEPLAYERORGROUP   0x0003
803
804 /* A player or group has been deleted from the session */
805 #define DPSYS_DESTROYPLAYERORGROUP  0x0005
806
807 /* A player has been added to a group */
808 #define DPSYS_ADDPLAYERTOGROUP      0x0007
809
810 /* A player has been deleted from a group */
811 #define DPSYS_DELETEPLAYERFROMGROUP 0x0021
812
813 /* Session lost for this object - ie lost contact with all players */
814 #define DPSYS_SESSIONLOST           0x0031
815
816 /* The current host has left the session */
817 #define DPSYS_HOST                  0x0101
818
819 /* Player or group data has changed */
820 #define DPSYS_SETPLAYERORGROUPDATA  0x0102
821
822 /* The name of a player or group has changed */
823 #define DPSYS_SETPLAYERORGROUPNAME  0x0103
824
825 /* The session description has changed */
826 #define DPSYS_SETSESSIONDESC        0x0104
827
828 /* A group has been added to a group */
829 #define DPSYS_ADDGROUPTOGROUP           0x0105
830
831 /* A group has been deleted from a group */
832 #define DPSYS_DELETEGROUPFROMGROUP      0x0106
833
834 /* A secure player to player message has arrived */
835 #define DPSYS_SECUREMESSAGE         0x0107
836
837 /* Start a new session */
838 #define DPSYS_STARTSESSION          0x0108
839
840 /* A chat message has arrived */
841 #define DPSYS_CHAT                  0x0109
842
843 /* The owner of a group has changed */
844 #define DPSYS_SETGROUPOWNER         0x010A
845
846 /* An async send is done (finished normally, failed or cancelled) */
847 #define DPSYS_SENDCOMPLETE          0x010d
848
849 /** DirectPlay System Messages **/
850
851 #define DPPLAYERTYPE_GROUP   0x00000000
852 #define DPPLAYERTYPE_PLAYER  0x00000001
853
854
855 /* NOTE: DPMSG_HOST and DPMSG_GENERIC share the same format */
856 typedef struct tagDPMSG_GENERIC
857 {
858    DWORD       dwType; /* Use message type as described above */
859 } DPMSG_GENERIC,     *LPDPMSG_GENERIC,
860   DPMSG_HOST,        *LPDPMSG_HOST,
861   DPMSG_SESSIONLOST, *LPDPMSG_SESSIONLOST;
862
863 typedef struct tagDPMSG_CREATEPLAYERORGROUP
864 {
865    DWORD   dwType;           /* Use message type as described above */
866    DWORD   dwPlayerType;     /* Use DPPLAYERTYPE_GROUP or DPPLAYERTYPE_PLAYER */
867    DPID    dpId;             /* ID of the player/group */
868    DWORD   dwCurrentPlayers; /* Current number of players/groups in session */
869    LPVOID  lpData;           /* Pointer to data */
870    DWORD   dwDataSize;       /* Size of data */
871    DPNAME  dpnName;          /* Name info */
872
873    /* dpIdParent and dwFlags are only valid in DirectPlay3 and later. What
874     * does that mean about the message size before? -PH */
875    DPID   dpIdParent;  /* id of parent group */
876    DWORD  dwFlags;     /* Flags for the player/group */
877 } DPMSG_CREATEPLAYERORGROUP, *LPDPMSG_CREATEPLAYERORGROUP;
878
879 typedef struct tagDPMSG_DESTROYPLAYERORGROUP
880 {
881    DWORD   dwType;           /* Use message type as described above */
882    DWORD   dwPlayerType;     /* Use DPPLAYERTYPE_GROUP or DPPLAYERTYPE_PLAYER */
883    DPID    dpId;             /* ID of player/group to be deleted */
884    LPVOID  lpLocalData;      /* Pointer to local data */
885    DWORD   dwLocalDataSize;  /* Sizeof local data */
886    LPVOID  lpRemoteData;     /* Pointer to remote data */
887    DWORD   dwRemoteDataSize; /* Sizeof remote data */
888
889    /* dpnName, dpIdParent and dwFlags are only valid in DirectPlay3 and later. What
890     * does that mean about the message size before? -PH */
891    DPNAME  dpnName;     /* Name info */
892    DPID    dpIdParent;  /* id of parent group */
893    DWORD   dwFlags;     /* Flags for the player/group */
894 } DPMSG_DESTROYPLAYERORGROUP, *LPDPMSG_DESTROYPLAYERORGROUP;
895
896 /* NOTE: DPMSG_ADDPLAYERTOGROUP and DPMSG_DELETEPLAYERFROMGROUP are the same */
897 typedef struct tagDPMSG_ADDPLAYERTOGROUP
898 {
899    DWORD  dwType;      /* Use message type as described above */
900    DPID   dpIdGroup;   /* Group ID to add player into */
901    DPID   dpIdPlayer;  /* ID of player to add */
902 } DPMSG_ADDPLAYERTOGROUP,      *LPDPMSG_ADDPLAYERTOGROUP,
903   DPMSG_DELETEPLAYERFROMGROUP, *LPDPMSG_DELETEPLAYERFROMGROUP;
904
905 /* NOTE: DPMSG_ADDGROUPTOGROUP and DPMSG_DELETEGROUPFROMGROUP are the same */
906 typedef struct tagDPMSG_ADDGROUPTOGROUP
907 {
908    DWORD  dwType;          /* Use message type as described above */
909    DPID   dpIdParentGroup; /* Group ID to add group into */
910    DPID   dpIdGroup;       /* ID of group to add */
911 } DPMSG_ADDGROUPTOGROUP,      *LPDPMSG_ADDGROUPTOGROUP,
912   DPMSG_DELETEGROUPFROMGROUP, *LPDPMSG_DELETEGROUPFROMGROUP;
913
914 typedef struct tagDPMSG_SETPLAYERORGROUPDATA
915 {
916    DWORD   dwType;       /* Use message type as described above */
917    DWORD   dwPlayerType; /* Use DPPLAYERTYPE_GROUP or DPPLAYERTYPE_PLAYER */
918    DPID    dpId;         /* ID of player/group */
919    LPVOID  lpData;       /* Pointer to data */
920    DWORD   dwDataSize;   /* Size of data */
921 } DPMSG_SETPLAYERORGROUPDATA, *LPDPMSG_SETPLAYERORGROUPDATA;
922
923 typedef struct tagDPMSG_SETPLAYERORGROUPNAME
924 {
925    DWORD  dwType;       /* Use message type as described above */
926    DWORD  dwPlayerType; /* Use DPPLAYERTYPE_GROUP or DPPLAYERTYPE_PLAYER */
927    DPID   dpId;         /* ID of player/group */
928    DPNAME dpnName;      /* New name */
929 } DPMSG_SETPLAYERORGROUPNAME, *LPDPMSG_SETPLAYERORGROUPNAME;
930
931 typedef struct tagDPMSG_SETSESSIONDESC
932 {
933    DWORD           dwType; /* Use message type as described above */
934    DPSESSIONDESC2  dpDesc; /* New session desc */
935 } DPMSG_SETSESSIONDESC, *LPDPMSG_SETSESSIONDESC;
936
937 typedef struct tagDPMSG_SECUREMESSAGE
938 {
939    DWORD   dwType;     /* Use message type as described above */
940    DWORD   dwFlags;    /* Signed/Encrypted */
941    DPID    dpIdFrom;   /* ID of from player */
942    LPVOID  lpData;     /* Message sent */
943    DWORD   dwDataSize; /* Size of message */
944 } DPMSG_SECUREMESSAGE, *LPDPMSG_SECUREMESSAGE;
945
946 typedef struct tagDPMSG_STARTSESSION
947 {
948    DWORD            dwType; /* Use message type as described above */
949    LPDPLCONNECTION  lpConn; /* DPLCONNECTION structure */
950 } DPMSG_STARTSESSION, *LPDPMSG_STARTSESSION;
951
952 typedef struct tagDPMSG_CHAT
953 {
954    DWORD     dwType;       /* Use message type as described above */
955    DWORD     dwFlags;      /* Message flags */
956    DPID      idFromPlayer; /* ID of sender */
957    DPID      idToPlayer;   /* ID of who msg is for */
958    DPID      idToGroup;    /* ID of what group msg is for */
959    LPDPCHAT  lpChat;       /* Chat message */
960 } DPMSG_CHAT, *LPDPMSG_CHAT;
961
962 typedef struct tagDPMSG_SETGROUPOWNER
963 {
964    DWORD  dwType;     /* Use message type as described above */
965    DPID   idGroup;    /* Group ID */
966    DPID   idNewOwner; /* ID of player who now owns group */
967    DPID   idOldOwner; /* ID of player who used to own group */
968 } DPMSG_SETGROUPOWNER, *LPDPMSG_SETGROUPOWNER;
969
970 typedef struct
971 {
972    DWORD    dwType;      /* Use message type as described above */
973    DPID     idFrom;      /* ID from */
974    DPID     idTo;        /* ID to */
975    DWORD    dwFlags;
976    DWORD    dwPriority;
977    DWORD    dwTimeout;
978    LPVOID   lpvContext;
979    DWORD    dwMsgID;
980    HRESULT  hr;
981    DWORD    dwSendTime;  /* When sent ? */
982 } DPMSG_SENDCOMPLETE, *LPDPMSG_SENDCOMPLETE;
983
984
985
986 #ifdef __cplusplus
987 } /* extern "C" */
988 #endif /* defined(__cplusplus) */
989
990 #endif /* __WINE_DPLAY_H */