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