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