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