Added the IInternetSession interface.
[wine] / include / dplay8.h
1 /*
2  * Copyright (C) 2003 Raphael Junqueira
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #ifndef __WINE_DPLAY8_H
20 #define __WINE_DPLAY8_H
21
22 #include <ole2.h>
23 #include <dpaddr.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* defined(__cplusplus) */
28
29
30 typedef HRESULT (WINAPI *PFNDPNMESSAGEHANDLER)(PVOID, DWORD, PVOID);
31 typedef DWORD   DPNID, *PDPNID;
32 typedef DWORD   DPNHANDLE, *PDPNHANDLE;
33
34 /*****************************************************************************
35  * DirectPlay8 Message Id
36  */
37 #define DPN_MSGID_OFFSET                        0xFFFF0000
38 #define DPN_MSGID_ADD_PLAYER_TO_GROUP           (DPN_MSGID_OFFSET | 0x0001)
39 #define DPN_MSGID_APPLICATION_DESC              (DPN_MSGID_OFFSET | 0x0002)
40 #define DPN_MSGID_ASYNC_OP_COMPLETE             (DPN_MSGID_OFFSET | 0x0003)
41 #define DPN_MSGID_CLIENT_INFO                   (DPN_MSGID_OFFSET | 0x0004)
42 #define DPN_MSGID_CONNECT_COMPLETE              (DPN_MSGID_OFFSET | 0x0005)
43 #define DPN_MSGID_CREATE_GROUP                  (DPN_MSGID_OFFSET | 0x0006)
44 #define DPN_MSGID_CREATE_PLAYER                 (DPN_MSGID_OFFSET | 0x0007)
45 #define DPN_MSGID_DESTROY_GROUP                 (DPN_MSGID_OFFSET | 0x0008)
46 #define DPN_MSGID_DESTROY_PLAYER                (DPN_MSGID_OFFSET | 0x0009)
47 #define DPN_MSGID_ENUM_HOSTS_QUERY              (DPN_MSGID_OFFSET | 0x000A)
48 #define DPN_MSGID_ENUM_HOSTS_RESPONSE           (DPN_MSGID_OFFSET | 0x000B)
49 #define DPN_MSGID_GROUP_INFO                    (DPN_MSGID_OFFSET | 0x000C)
50 #define DPN_MSGID_HOST_MIGRATE                  (DPN_MSGID_OFFSET | 0x000D)
51 #define DPN_MSGID_INDICATE_CONNECT              (DPN_MSGID_OFFSET | 0x000E)
52 #define DPN_MSGID_INDICATED_CONNECT_ABORTED     (DPN_MSGID_OFFSET | 0x000F)
53 #define DPN_MSGID_PEER_INFO                     (DPN_MSGID_OFFSET | 0x0010)
54 #define DPN_MSGID_RECEIVE                       (DPN_MSGID_OFFSET | 0x0011)
55 #define DPN_MSGID_REMOVE_PLAYER_FROM_GROUP      (DPN_MSGID_OFFSET | 0x0012)
56 #define DPN_MSGID_RETURN_BUFFER                 (DPN_MSGID_OFFSET | 0x0013)
57 #define DPN_MSGID_SEND_COMPLETE                 (DPN_MSGID_OFFSET | 0x0014)
58 #define DPN_MSGID_SERVER_INFO                   (DPN_MSGID_OFFSET | 0x0015)
59 #define DPN_MSGID_TERMINATE_SESSION             (DPN_MSGID_OFFSET | 0x0016)
60
61 /*****************************************************************************
62  * DirectPlay8 Errors
63  */
64 #define _DPN_FACILITY_CODE              0x015
65 #define _DPNHRESULT_BASE                0x8000
66 #define MAKE_DPNHRESULT(code)           MAKE_HRESULT(1, _DPN_FACILITY_CODE, (code + _DPNHRESULT_BASE))
67
68 #define DPNSUCCESS_EQUAL                MAKE_HRESULT(0, _DPN_FACILITY_CODE, (0x05 + _DPNHRESULT_BASE))
69 #define DPNSUCCESS_NOTEQUAL             MAKE_HRESULT(0, _DPN_FACILITY_CODE, (0x0A + _DPNHRESULT_BASE))
70 #define DPNSUCCESS_PENDING              MAKE_HRESULT(0, _DPN_FACILITY_CODE, (0x0E + _DPNHRESULT_BASE))
71
72 #define DPN_OK                          S_OK
73 #define DPNERR_GENERIC                  E_FAIL
74 #define DPNERR_INVALIDPARAM             E_INVALIDARG
75 #define DPNERR_UNSUPPORTED              E_NOTIMPL
76 #define DPNERR_NOINTERFACE              E_NOINTERFACE
77 #define DPNERR_OUTOFMEMORY              E_OUTOFMEMORY
78 #define DPNERR_INVALIDPOINTER           E_POINTER
79 #define DPNERR_PENDING                  DPNSUCCESS_PENDING
80 #define DPNERR_ABORTED                  MAKE_DPNHRESULT(0x030)
81 #define DPNERR_ADDRESSING               MAKE_DPNHRESULT(0x040)
82 #define DPNERR_ALREADYCLOSING           MAKE_DPNHRESULT(0x050)
83 #define DPNERR_ALREADYCONNECTED         MAKE_DPNHRESULT(0x060)
84 #define DPNERR_ALREADYDISCONNECTING     MAKE_DPNHRESULT(0x070)
85 #define DPNERR_ALREADYINITIALIZED       MAKE_DPNHRESULT(0x080)
86 #define DPNERR_ALREADYREGISTERED        MAKE_DPNHRESULT(0x090)
87 #define DPNERR_BUFFERTOOSMALL           MAKE_DPNHRESULT(0x100)
88 #define DPNERR_CANNOTCANCEL             MAKE_DPNHRESULT(0x110)
89 #define DPNERR_CANTCREATEGROUP          MAKE_DPNHRESULT(0x120)
90 #define DPNERR_CANTCREATEPLAYER         MAKE_DPNHRESULT(0x130)
91 #define DPNERR_CANTLAUNCHAPPLICATION    MAKE_DPNHRESULT(0x140)
92 #define DPNERR_CONNECTING               MAKE_DPNHRESULT(0x150)
93 #define DPNERR_CONNECTIONLOST           MAKE_DPNHRESULT(0x160)
94 #define DPNERR_CONVERSION               MAKE_DPNHRESULT(0x170)
95 #define DPNERR_DATATOOLARGE             MAKE_DPNHRESULT(0x175)
96 #define DPNERR_DOESNOTEXIST             MAKE_DPNHRESULT(0x180)
97 #define DPNERR_DUPLICATECOMMAND         MAKE_DPNHRESULT(0x190)
98 #define DPNERR_ENDPOINTNOTRECEIVING     MAKE_DPNHRESULT(0x200)
99 #define DPNERR_ENUMQUERYTOOLARGE        MAKE_DPNHRESULT(0x210)
100 #define DPNERR_ENUMRESPONSETOOLARGE     MAKE_DPNHRESULT(0x220)
101 #define DPNERR_EXCEPTION                MAKE_DPNHRESULT(0x230)
102 #define DPNERR_GROUPNOTEMPTY            MAKE_DPNHRESULT(0x240)
103 #define DPNERR_HOSTING                  MAKE_DPNHRESULT(0x250)
104 #define DPNERR_HOSTREJECTEDCONNECTION   MAKE_DPNHRESULT(0x260)
105 #define DPNERR_HOSTTERMINATEDSESSION    MAKE_DPNHRESULT(0x270)
106 #define DPNERR_INCOMPLETEADDRESS        MAKE_DPNHRESULT(0x280)
107 #define DPNERR_INVALIDADDRESSFORMAT     MAKE_DPNHRESULT(0x290)
108 #define DPNERR_INVALIDAPPLICATION       MAKE_DPNHRESULT(0x300)
109 #define DPNERR_INVALIDCOMMAND           MAKE_DPNHRESULT(0x310)
110 #define DPNERR_INVALIDDEVICEADDRESS     MAKE_DPNHRESULT(0x320)
111 #define DPNERR_INVALIDENDPOINT          MAKE_DPNHRESULT(0x330)
112 #define DPNERR_INVALIDFLAGS             MAKE_DPNHRESULT(0x340)
113 #define DPNERR_INVALIDGROUP             MAKE_DPNHRESULT(0x350)
114 #define DPNERR_INVALIDHANDLE            MAKE_DPNHRESULT(0x360)
115 #define DPNERR_INVALIDHOSTADDRESS       MAKE_DPNHRESULT(0x370)
116 #define DPNERR_INVALIDINSTANCE          MAKE_DPNHRESULT(0x380)
117 #define DPNERR_INVALIDINTERFACE         MAKE_DPNHRESULT(0x390)
118 #define DPNERR_INVALIDOBJECT            MAKE_DPNHRESULT(0x400)
119 #define DPNERR_INVALIDPASSWORD          MAKE_DPNHRESULT(0x410)
120 #define DPNERR_INVALIDPLAYER            MAKE_DPNHRESULT(0x420)
121 #define DPNERR_INVALIDPRIORITY          MAKE_DPNHRESULT(0x430)
122 #define DPNERR_INVALIDSTRING            MAKE_DPNHRESULT(0x440)
123 #define DPNERR_INVALIDURL               MAKE_DPNHRESULT(0x450)
124 #define DPNERR_INVALIDVERSION           MAKE_DPNHRESULT(0x460)
125 #define DPNERR_NOCAPS                   MAKE_DPNHRESULT(0x470)
126 #define DPNERR_NOCONNECTION             MAKE_DPNHRESULT(0x480)
127 #define DPNERR_NOHOSTPLAYER             MAKE_DPNHRESULT(0x490)
128 #define DPNERR_NOMOREADDRESSCOMPONENTS  MAKE_DPNHRESULT(0x500)
129 #define DPNERR_NORESPONSE               MAKE_DPNHRESULT(0x510)
130 #define DPNERR_NOTALLOWED               MAKE_DPNHRESULT(0x520)
131 #define DPNERR_NOTHOST                  MAKE_DPNHRESULT(0x530)
132 #define DPNERR_NOTREADY                 MAKE_DPNHRESULT(0x540)
133 #define DPNERR_NOTREGISTERED            MAKE_DPNHRESULT(0x550)
134 #define DPNERR_PLAYERALREADYINGROUP     MAKE_DPNHRESULT(0x560)
135 #define DPNERR_PLAYERLOST               MAKE_DPNHRESULT(0x570)
136 #define DPNERR_PLAYERNOTINGROUP         MAKE_DPNHRESULT(0x580)
137 #define DPNERR_PLAYERNOTREACHABLE       MAKE_DPNHRESULT(0x590)
138 #define DPNERR_SENDTOOLARGE             MAKE_DPNHRESULT(0x600)
139 #define DPNERR_SESSIONFULL              MAKE_DPNHRESULT(0x610)
140 #define DPNERR_TABLEFULL                MAKE_DPNHRESULT(0x620)
141 #define DPNERR_TIMEDOUT                 MAKE_DPNHRESULT(0x630)
142 #define DPNERR_UNINITIALIZED            MAKE_DPNHRESULT(0x640)
143 #define DPNERR_USERCANCEL               MAKE_DPNHRESULT(0x650)
144
145 /*****************************************************************************
146  * DirectPlay8 defines
147  */
148 #define DPNOP_SYNC                            0x80000000
149 #define DPNADDPLAYERTOGROUP_SYNC              DPNOP_SYNC
150 #define DPNCANCEL_CONNECT                     0x0001
151 #define DPNCANCEL_ENUM                        0x0002
152 #define DPNCANCEL_SEND                        0x0004
153 #define DPNCANCEL_ALL_OPERATIONS              0x8000
154 #define DPNCONNECT_SYNC                       DPNOP_SYNC
155 #define DPNCONNECT_OKTOQUERYFORADDRESSING     0x0001
156 #define DPNCREATEGROUP_SYNC                   DPNOP_SYNC
157 #define DPNDESTROYGROUP_SYNC                  DPNOP_SYNC
158 #define DPNENUM_PLAYERS                       0x0001
159 #define DPNENUM_GROUPS                        0x0010
160 #define DPNENUMHOSTS_SYNC                     DPNOP_SYNC
161 #define DPNENUMHOSTS_OKTOQUERYFORADDRESSING   0x0001
162 #define DPNENUMHOSTS_NOBROADCASTFALLBACK      0x0002
163 #define DPNENUMSERVICEPROVIDERS_ALL           0x0001
164 #define DPNGETSENDQUEUEINFO_PRIORITY_NORMAL   0x0001
165 #define DPNGETSENDQUEUEINFO_PRIORITY_HIGH     0x0002
166 #define DPNGETSENDQUEUEINFO_PRIORITY_LOW      0x0004
167 #define DPNGROUP_AUTODESTRUCT                 0x0001
168 #define DPNHOST_OKTOQUERYFORADDRESSING        0x0001
169 #define DPNINFO_NAME                          0x0001
170 #define DPNINFO_DATA                          0x0002
171 #define DPNINITIALIZE_DISABLEPARAMVAL         0x0001
172 #define DPNLOBBY_REGISTER                     0x0001
173 #define DPNLOBBY_UNREGISTER                   0x0002
174 #define DPNPLAYER_LOCAL                       0x0002
175 #define DPNPLAYER_HOST                        0x0004
176 #define DPNREMOVEPLAYERFROMGROUP_SYNC         DPNOP_SYNC
177 #define DPNSEND_SYNC                          DPNOP_SYNC
178 #define DPNSEND_NOCOPY                        0x0001
179 #define DPNSEND_NOCOMPLETE                    0x0002
180 #define DPNSEND_COMPLETEONPROCESS             0x0004
181 #define DPNSEND_GUARANTEED                    0x0008
182 #define DPNSEND_NONSEQUENTIAL                 0x0010
183 #define DPNSEND_NOLOOPBACK                    0x0020
184 #define DPNSEND_PRIORITY_LOW                  0x0040
185 #define DPNSEND_PRIORITY_HIGH                 0x0080
186 #define DPNSESSION_CLIENT_SERVER              0x0001
187 #define DPNSESSION_MIGRATE_HOST               0x0004
188 #define DPNSESSION_NODPNSVR                   0x0040
189 #define DPNSESSION_REQUIREPASSWORD            0x0080
190 #define DPNSETCLIENTINFO_SYNC                 DPNOP_SYNC
191 #define DPNSETGROUPINFO_SYNC                  DPNOP_SYNC
192 #define DPNSETPEERINFO_SYNC                   DPNOP_SYNC
193 #define DPNSETSERVERINFO_SYNC                 DPNOP_SYNC
194 #define DPNSPCAPS_SUPPORTSDPNSRV              0x0001
195 #define DPNSPCAPS_SUPPORTSBROADCAST           0x0002
196 #define DPNSPCAPS_SUPPORTSALLADAPTERS         0x0004
197
198
199 /*****************************************************************************
200  * DirectPlay8 structures Typedefs
201  */
202 typedef struct _DPN_APPLICATION_DESC {
203   DWORD   dwSize;
204   DWORD   dwFlags;
205   GUID    guidInstance;
206   GUID    guidApplication;
207   DWORD   dwMaxPlayers;
208   DWORD   dwCurrentPlayers;
209   WCHAR*  pwszSessionName;
210   WCHAR*  pwszPassword;
211   PVOID   pvReservedData;
212   DWORD   dwReservedDataSize;
213   PVOID   pvApplicationReservedData;
214   DWORD   dwApplicationReservedDataSize;
215 } DPN_APPLICATION_DESC, *PDPN_APPLICATION_DESC;
216
217 typedef struct _BUFFERDESC {
218   DWORD   dwBufferSize;         
219   BYTE*   pBufferData;          
220 } BUFFERDESC, DPN_BUFFER_DESC, *PDPN_BUFFER_DESC, *PBUFFERDESC;
221
222 typedef struct _DPN_CAPS {
223   DWORD   dwSize;
224   DWORD   dwFlags;
225   DWORD   dwConnectTimeout;
226   DWORD   dwConnectRetries;
227   DWORD   dwTimeoutUntilKeepAlive;
228 } DPN_CAPS, *PDPN_CAPS;
229
230 typedef struct _DPN_CONNECTION_INFO {
231   DWORD   dwSize;
232   DWORD   dwRoundTripLatencyMS;
233   DWORD   dwThroughputBPS;
234   DWORD   dwPeakThroughputBPS;
235   DWORD   dwBytesSentGuaranteed;
236   DWORD   dwPacketsSentGuaranteed;
237   DWORD   dwBytesSentNonGuaranteed;
238   DWORD   dwPacketsSentNonGuaranteed;
239   DWORD   dwBytesRetried;
240   DWORD   dwPacketsRetried;
241   DWORD   dwBytesDropped;
242   DWORD   dwPacketsDropped;
243   DWORD   dwMessagesTransmittedHighPriority;
244   DWORD   dwMessagesTimedOutHighPriority;
245   DWORD   dwMessagesTransmittedNormalPriority;
246   DWORD   dwMessagesTimedOutNormalPriority;
247   DWORD   dwMessagesTransmittedLowPriority;
248   DWORD   dwMessagesTimedOutLowPriority;
249   DWORD   dwBytesReceivedGuaranteed;
250   DWORD   dwPacketsReceivedGuaranteed;
251   DWORD   dwBytesReceivedNonGuaranteed;
252   DWORD   dwPacketsReceivedNonGuaranteed;
253   DWORD   dwMessagesReceived;
254 } DPN_CONNECTION_INFO, *PDPN_CONNECTION_INFO;
255
256 typedef struct _DPN_GROUP_INFO {
257   DWORD   dwSize;
258   DWORD   dwInfoFlags;
259   PWSTR   pwszName;
260   PVOID   pvData;
261   DWORD   dwDataSize;
262   DWORD   dwGroupFlags;
263 } DPN_GROUP_INFO, *PDPN_GROUP_INFO;
264
265 typedef struct _DPN_PLAYER_INFO {
266   DWORD   dwSize;
267   DWORD   dwInfoFlags;
268   PWSTR   pwszName;
269   PVOID   pvData;
270   DWORD   dwDataSize;
271   DWORD   dwPlayerFlags;
272 } DPN_PLAYER_INFO, *PDPN_PLAYER_INFO;
273
274 typedef struct _DPN_SERVICE_PROVIDER_INFO {
275   DWORD   dwFlags;
276   GUID    guid;
277   WCHAR*  pwszName;
278   PVOID   pvReserved;   
279   DWORD   dwReserved;
280 } DPN_SERVICE_PROVIDER_INFO, *PDPN_SERVICE_PROVIDER_INFO;
281
282 typedef struct _DPN_SP_CAPS {
283   DWORD   dwSize;
284   DWORD   dwFlags;
285   DWORD   dwNumThreads;
286   DWORD   dwDefaultEnumCount;
287   DWORD   dwDefaultEnumRetryInterval;
288   DWORD   dwDefaultEnumTimeout;
289   DWORD   dwMaxEnumPayloadSize;
290   DWORD   dwBuffersPerThread;
291   DWORD   dwSystemBufferSize;
292 } DPN_SP_CAPS, *PDPN_SP_CAPS;
293
294 typedef struct _DPN_SECURITY_CREDENTIALS  DPN_SECURITY_CREDENTIALS, *PDPN_SECURITY_CREDENTIALS;
295 typedef struct _DPN_SECURITY_DESC         DPN_SECURITY_DESC, *PDPN_SECURITY_DESC;
296
297 typedef struct _DPNMSG_ADD_PLAYER_TO_GROUP {
298   DWORD   dwSize;
299   DPNID   dpnidGroup;
300   PVOID   pvGroupContext;
301   DPNID   dpnidPlayer;
302   PVOID   pvPlayerContext;
303 } DPNMSG_ADD_PLAYER_TO_GROUP, *PDPNMSG_ADD_PLAYER_TO_GROUP;
304
305 typedef struct _DPNMSG_ASYNC_OP_COMPLETE {
306   DWORD      dwSize;
307   DPNHANDLE  hAsyncOp;
308   PVOID      pvUserContext;
309   HRESULT    hResultCode;
310 } DPNMSG_ASYNC_OP_COMPLETE, *PDPNMSG_ASYNC_OP_COMPLETE;
311
312 typedef struct _DPNMSG_CLIENT_INFO {
313   DWORD   dwSize;
314   DPNID   dpnidClient;
315   PVOID   pvPlayerContext;
316 } DPNMSG_CLIENT_INFO, *PDPNMSG_CLIENT_INFO;
317
318 typedef struct _DPNMSG_CONNECT_COMPLETE {
319   DWORD      dwSize;
320   DPNHANDLE  hAsyncOp;
321   PVOID      pvUserContext;
322   HRESULT    hResultCode;
323   PVOID      pvApplicationReplyData;
324   DWORD      dwApplicationReplyDataSize;
325 } DPNMSG_CONNECT_COMPLETE, *PDPNMSG_CONNECT_COMPLETE;
326
327 typedef struct _DPNMSG_CREATE_GROUP {
328   DWORD   dwSize;
329   DPNID   dpnidGroup;
330   DPNID   dpnidOwner;
331   PVOID   pvGroupContext;
332 } DPNMSG_CREATE_GROUP, *PDPNMSG_CREATE_GROUP;
333
334 typedef struct _DPNMSG_CREATE_PLAYER {
335   DWORD   dwSize;
336   DPNID   dpnidPlayer;
337   PVOID   pvPlayerContext;
338 } DPNMSG_CREATE_PLAYER, *PDPNMSG_CREATE_PLAYER;
339
340 typedef struct _DPNMSG_DESTROY_GROUP {
341   DWORD   dwSize;
342   DPNID   dpnidGroup;
343   PVOID   pvGroupContext;
344   DWORD   dwReason;
345 } DPNMSG_DESTROY_GROUP, *PDPNMSG_DESTROY_GROUP;
346
347 typedef struct _DPNMSG_DESTROY_PLAYER {
348   DWORD  dwSize;
349   DPNID  dpnidPlayer;
350   PVOID  pvPlayerContext;
351   DWORD  dwReason;
352 } DPNMSG_DESTROY_PLAYER, *PDPNMSG_DESTROY_PLAYER;
353
354 typedef struct _DPNMSG_ENUM_HOSTS_QUERY {
355   DWORD                 dwSize;
356   IDirectPlay8Address*  pAddressSender;
357   IDirectPlay8Address*  pAddressDevice;
358   PVOID                 pvReceivedData;
359   DWORD                 dwReceivedDataSize;
360   DWORD                 dwMaxResponseDataSize;
361   PVOID                 pvResponseData;
362   DWORD                 dwResponseDataSize;
363   PVOID                 pvResponseContext;
364 } DPNMSG_ENUM_HOSTS_QUERY, *PDPNMSG_ENUM_HOSTS_QUERY;
365
366 typedef struct _DPNMSG_ENUM_HOSTS_RESPONSE {
367   DWORD                        dwSize;
368   IDirectPlay8Address*         pAddressSender;
369   IDirectPlay8Address*         pAddressDevice;
370   const DPN_APPLICATION_DESC*  pApplicationDescription;
371   PVOID                        pvResponseData;
372   DWORD                        dwResponseDataSize;
373   PVOID                        pvUserContext;
374   DWORD                        dwRoundTripLatencyMS;
375 } DPNMSG_ENUM_HOSTS_RESPONSE, *PDPNMSG_ENUM_HOSTS_RESPONSE;
376
377 typedef struct _DPNMSG_GROUP_INFO {
378   DWORD   dwSize;
379   DPNID   dpnidGroup;
380   PVOID   pvGroupContext;
381 } DPNMSG_GROUP_INFO, *PDPNMSG_GROUP_INFO;
382
383 typedef struct _DPNMSG_HOST_MIGRATE {
384   DWORD   dwSize;
385   DPNID   dpnidNewHost;
386   PVOID   pvPlayerContext;
387 } DPNMSG_HOST_MIGRATE, *PDPNMSG_HOST_MIGRATE;
388
389 typedef struct _DPNMSG_INDICATE_CONNECT {
390   DWORD                 dwSize;
391   PVOID                 pvUserConnectData;
392   DWORD                 dwUserConnectDataSize;
393   PVOID                 pvReplyData;
394   DWORD                 dwReplyDataSize;
395   PVOID                 pvReplyContext;
396   PVOID                 pvPlayerContext;
397   IDirectPlay8Address*  pAddressPlayer;
398   IDirectPlay8Address*  pAddressDevice;
399 } DPNMSG_INDICATE_CONNECT, *PDPNMSG_INDICATE_CONNECT;
400
401 typedef struct _DPNMSG_INDICATED_CONNECT_ABORTED {
402   DWORD   dwSize;
403   PVOID   pvPlayerContext;
404 } DPNMSG_INDICATED_CONNECT_ABORTED, *PDPNMSG_INDICATED_CONNECT_ABORTED;
405
406 typedef struct _DPNMSG_PEER_INFO {
407   DWORD   dwSize;
408   DPNID   dpnidPeer;
409   PVOID   pvPlayerContext;
410 } DPNMSG_PEER_INFO, *PDPNMSG_PEER_INFO;
411
412 typedef struct _DPNMSG_RECEIVE {
413   DWORD      dwSize;
414   DPNID      dpnidSender;
415   PVOID      pvPlayerContext;
416   PBYTE      pReceiveData;
417   DWORD      dwReceiveDataSize;
418   DPNHANDLE  hBufferHandle;
419 } DPNMSG_RECEIVE, *PDPNMSG_RECEIVE;
420
421 typedef struct _DPNMSG_REMOVE_PLAYER_FROM_GROUP {
422   DWORD   dwSize;
423   DPNID   dpnidGroup;
424   PVOID   pvGroupContext;
425   DPNID   dpnidPlayer;
426   PVOID   pvPlayerContext;
427 } DPNMSG_REMOVE_PLAYER_FROM_GROUP, *PDPNMSG_REMOVE_PLAYER_FROM_GROUP;
428
429 typedef struct _DPNMSG_RETURN_BUFFER {
430   DWORD     dwSize;
431   HRESULT   hResultCode;
432   PVOID     pvBuffer;
433   PVOID     pvUserContext;
434 } DPNMSG_RETURN_BUFFER, *PDPNMSG_RETURN_BUFFER;
435
436 typedef struct _DPNMSG_SEND_COMPLETE {
437   DWORD       dwSize;
438   DPNHANDLE   hAsyncOp;
439   PVOID       pvUserContext;
440   HRESULT     hResultCode;
441   DWORD       dwSendTime;
442 } DPNMSG_SEND_COMPLETE, *PDPNMSG_SEND_COMPLETE;
443
444 typedef struct _DPNMSG_SERVER_INFO {
445   DWORD   dwSize;
446   DPNID   dpnidServer;
447   PVOID   pvPlayerContext;
448 } DPNMSG_SERVER_INFO, *PDPNMSG_SERVER_INFO;
449
450 typedef struct _DPNMSG_TERMINATE_SESSION {
451   DWORD    dwSize;
452   HRESULT  hResultCode;
453   PVOID    pvTerminateData;
454   DWORD    dwTerminateDataSize;
455 } DPNMSG_TERMINATE_SESSION, *PDPNMSG_TERMINATE_SESSION;
456
457
458 /*****************************************************************************
459  * Predeclare the interfaces
460  */
461 DEFINE_GUID(CLSID_DirectPlay8Peer,     0x286f484d,0x375e,0x4458,0xa2,0x72,0xb1,0x38,0xe2,0xf8,0xa,0x6a);
462 DEFINE_GUID(CLSID_DirectPlay8Client,   0x743f1dc6,0x5aba,0x429f,0x8b,0xdf,0xc5,0x4d,0x3,0x25,0x3d,0xc2);
463 DEFINE_GUID(CLSID_DirectPlay8Server,   0xda825e1b,0x6830,0x43d7,0x83,0x5d,0xb,0x5a,0xd8,0x29,0x56,0xa2);
464
465 DEFINE_GUID(IID_IDirectPlay8Peer,      0x5102dacf,0x241b,0x11d3,0xae,0xa7,0x0,0x60,0x97,0xb0,0x14,0x11);
466 typedef struct IDirectPlay8Peer        IDirectPlay8Peer, *PDIRECTPLAY8PEER;
467 DEFINE_GUID(IID_IDirectPlay8Client,    0x5102dacd,0x241b,0x11d3,0xae,0xa7,0x0,0x60,0x97,0xb0,0x14,0x11);
468 typedef struct IDirectPlay8Client      IDirectPlay8Client, *PDIRECTPLAY8CLIENT;
469 DEFINE_GUID(IID_IDirectPlay8Server,    0x5102dace,0x241b,0x11d3,0xae,0xa7,0x0,0x60,0x97,0xb0,0x14,0x11);
470 typedef struct IDirectPlay8Server      IDirectPlay8Server, *PDIRECTPLAY8SERVER;
471
472 DEFINE_GUID(CLSID_DP8SP_IPX,           0x53934290,0x628d,0x11d2,0xae,0xf,0x0,0x60,0x97,0xb0,0x14,0x11);
473 DEFINE_GUID(CLSID_DP8SP_TCPIP,         0xebfe7ba0,0x628d,0x11d2,0xae,0xf,0x0,0x60,0x97,0xb0,0x14,0x11);
474 DEFINE_GUID(CLSID_DP8SP_SERIAL,        0x743b5d60,0x628d,0x11d2,0xae,0xf,0x0,0x60,0x97,0xb0,0x14,0x11);
475 DEFINE_GUID(CLSID_DP8SP_MODEM,         0x6d4a3650,0x628d,0x11d2,0xae,0xf,0x0,0x60,0x97,0xb0,0x14,0x11);
476
477 typedef struct IDirectPlay8LobbiedApplication   *PIDirectPlay8LobbiedApplication, DNLOBBIEDAPPLICATION;
478
479
480 /*****************************************************************************
481  * IDirectPlay8Client interface
482  */
483 #define INTERFACE IDirectPlay8Client
484 #define IDirectPlay8Client_METHODS \
485   IUnknown_METHODS \
486   STDMETHOD(Initialize)(THIS_ PVOID CONST pvUserContext, CONST PFNDPNMESSAGEHANDLER pfn, CONST DWORD dwFlags) PURE; \
487   STDMETHOD(EnumServiceProviders)(THIS_ CONST GUID * CONST pguidServiceProvider, CONST GUID * CONST pguidApplication, DPN_SERVICE_PROVIDER_INFO * CONST pSPInfoBuffer, PDWORD CONST pcbEnumData, PDWORD CONST pcReturned, CONST DWORD dwFlags) PURE; \
488   STDMETHOD(EnumHosts)(THIS_ PDPN_APPLICATION_DESC CONST pApplicationDesc,IDirectPlay8Address * CONST pAddrHost,IDirectPlay8Address * CONST pDeviceInfo, PVOID CONST pUserEnumData, CONST DWORD dwUserEnumDataSize, CONST DWORD dwEnumCount, CONST DWORD dwRetryInterval, CONST DWORD dwTimeOut, PVOID CONST pvUserContext, DPNHANDLE * CONST pAsyncHandle, CONST DWORD dwFlags) PURE; \
489   STDMETHOD(CancelAsyncOperation)(THIS_ CONST DPNHANDLE hAsyncHandle, CONST DWORD dwFlags) PURE; \
490   STDMETHOD(Connect)(THIS_ CONST DPN_APPLICATION_DESC * CONST pdnAppDesc,IDirectPlay8Address * CONST pHostAddr,IDirectPlay8Address * CONST pDeviceInfo, CONST DPN_SECURITY_DESC * CONST pdnSecurity, CONST DPN_SECURITY_CREDENTIALS * CONST pdnCredentials, CONST void * CONST pvUserConnectData, CONST DWORD dwUserConnectDataSize,void * CONST pvAsyncContext, DPNHANDLE * CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
491   STDMETHOD(Send)(THIS_ CONST DPN_BUFFER_DESC * CONST prgBufferDesc, CONST DWORD cBufferDesc, CONST DWORD dwTimeOut, void * CONST pvAsyncContext, DPNHANDLE * CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
492   STDMETHOD(GetSendQueueInfo)(THIS_ DWORD * CONST pdwNumMsgs, DWORD * CONST pdwNumBytes, CONST DWORD dwFlags) PURE; \
493   STDMETHOD(GetApplicationDesc)(THIS_ DPN_APPLICATION_DESC * CONST pAppDescBuffer, DWORD * CONST pcbDataSize, CONST DWORD dwFlags) PURE; \
494   STDMETHOD(SetClientInfo)(THIS_ CONST DPN_PLAYER_INFO * CONST pdpnPlayerInfo, PVOID CONST pvAsyncContext, DPNHANDLE * CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
495   STDMETHOD(GetServerInfo)(THIS_ DPN_PLAYER_INFO * CONST pdpnPlayerInfo, DWORD * CONST pdwSize, CONST DWORD dwFlags) PURE; \
496   STDMETHOD(GetServerAddress)(THIS_ IDirectPlay8Address ** CONST pAddress, CONST DWORD dwFlags) PURE; \
497   STDMETHOD(Close)(THIS_ CONST DWORD dwFlags) PURE; \
498   STDMETHOD(ReturnBuffer)(THIS_ CONST DPNHANDLE hBufferHandle, CONST DWORD dwFlags) PURE; \
499   STDMETHOD(GetCaps)(THIS_ DPN_CAPS * CONST pdpCaps, CONST DWORD dwFlags) PURE; \
500   STDMETHOD(SetCaps)(THIS_ CONST DPN_CAPS * CONST pdpCaps, CONST DWORD dwFlags) PURE; \
501   STDMETHOD(SetSPCaps)(THIS_ CONST GUID * CONST pguidSP, CONST DPN_SP_CAPS * CONST pdpspCaps, CONST DWORD dwFlags ) PURE; \
502   STDMETHOD(GetSPCaps)(THIS_ CONST GUID * CONST pguidSP, DPN_SP_CAPS * CONST pdpspCaps, CONST DWORD dwFlags) PURE; \
503   STDMETHOD(GetConnectionInfo)(THIS_ DPN_CONNECTION_INFO * CONST pdpConnectionInfo, CONST DWORD dwFlags) PURE; \
504   STDMETHOD(RegisterLobby)(THIS_ CONST DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication * CONST pIDP8LobbiedApplication, CONST DWORD dwFlags) PURE;
505 ICOM_DEFINE(IDirectPlay8Client,IUnknown)
506 #undef INTERFACE
507
508 #ifdef COBJMACROS
509 /*** IUnknown methods ***/
510 #define IDirectPlay8Client_QueryInterface(p,a,b)                (p)->lpVtbl->QueryInterface(p,a,b)
511 #define IDirectPlay8Client_AddRef(p)                            (p)->lpVtbl->AddRef(p)
512 #define IDirectPlay8Client_Release(p)                           (p)->lpVtbl->Release(p)
513 /*** IDirectPlay8Client methods ***/
514 #define IDirectPlay8Client_Initialize(p,a,b,c)                  (p)->lpVtbl->Initialize(p,a,b,c)
515 #define IDirectPlay8Client_EnumServiceProviders(p,a,b,c,d,e,f)  (p)->lpVtbl->EnumServiceProviders(p,a,b,c,d,e,f)
516 #define IDirectPlay8Client_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k)   (p)->lpVtbl->EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k)
517 #define IDirectPlay8Client_CancelAsyncOperation(p,a,b)          (p)->lpVtbl->CancelAsyncOperation(p,a,b)
518 #define IDirectPlay8Client_Connect(p,a,b,c,d,e,f,g,h,i,j)       (p)->lpVtbl->Connect(p,a,b,c,d,e,f,g,h,i,j)
519 #define IDirectPlay8Client_Send(p,a,b,c,d,e,f)                  (p)->lpVtbl->Send(p,a,b,c,d,e,f)
520 #define IDirectPlay8Client_GetSendQueueInfo(p,a,b,c)            (p)->lpVtbl->GetSendQueueInfo(p,a,b,c)
521 #define IDirectPlay8Client_GetApplicationDesc(p,a,b,c)          (p)->lpVtbl->GetApplicationDesc(p,a,b,c)
522 #define IDirectPlay8Client_SetClientInfo(p,a,b,c,d)             (p)->lpVtbl->SetClientInfo(p,a,b,c,d)
523 #define IDirectPlay8Client_GetServerInfo(p,a,b,c)               (p)->lpVtbl->GetServerInfo(p,a,b,c)
524 #define IDirectPlay8Client_GetServerAddress(p,a,b)              (p)->lpVtbl->GetServerAddress(p,a,b)
525 #define IDirectPlay8Client_Close(p,a)                           (p)->lpVtbl->Close(p,a)
526 #define IDirectPlay8Client_ReturnBuffer(p,a,b)                  (p)->lpVtbl->ReturnBuffer(p,a,b)
527 #define IDirectPlay8Client_GetCaps(p,a,b)                       (p)->lpVtbl->GetCaps(p,a,b)
528 #define IDirectPlay8Client_SetCaps(p,a,b)                       (p)->lpVtbl->SetCaps(p,a,b)
529 #define IDirectPlay8Client_SetSPCaps(p,a,b,c)                   (p)->lpVtbl->SetSPCaps(p,a,b,c)
530 #define IDirectPlay8Client_GetSPCaps(p,a,b,c)                   (p)->lpVtbl->GetSPCaps(p,a,b,c)
531 #define IDirectPlay8Client_GetConnectionInfo(p,a,b)             (p)->lpVtbl->GetConnectionInfo(p,a,b)
532 #define IDirectPlay8Client_RegisterLobby(p,a,b,c)               (p)->lpVtbl->RegisterLobby(p,a,b,c)
533 #endif
534
535 /*****************************************************************************
536  * IDirectPlay8Server interface
537  */
538 #define INTERFACE IDirectPlay8Server
539 #define IDirectPlay8Server_METHODS \
540   IUnknown_METHODS \
541   STDMETHOD(Initialize)(THIS_ PVOID CONST pvUserContext, CONST PFNDPNMESSAGEHANDLER pfn, CONST DWORD dwFlags) PURE; \
542   STDMETHOD(EnumServiceProviders)(THIS_ CONST GUID * CONST pguidServiceProvider, CONST GUID * CONST pguidApplication, DPN_SERVICE_PROVIDER_INFO * CONST pSPInfoBuffer, PDWORD CONST pcbEnumData, PDWORD CONST pcReturned, CONST DWORD dwFlags) PURE; \
543   STDMETHOD(CancelAsyncOperation)(THIS_ CONST DPNHANDLE hAsyncHandle, CONST DWORD dwFlags) PURE; \
544   STDMETHOD(GetSendQueueInfo)(THIS_ CONST DPNID dpnid, DWORD * CONST pdwNumMsgs, DWORD * CONST pdwNumBytes, CONST DWORD dwFlags) PURE; \
545   STDMETHOD(GetApplicationDesc)(THIS_ DPN_APPLICATION_DESC * CONST pAppDescBuffer, DWORD * CONST pcbDataSize, CONST DWORD dwFlags) PURE; \
546   STDMETHOD(SetServerInfo)(THIS_ CONST DPN_PLAYER_INFO * CONST pdpnPlayerInfo, PVOID CONST pvAsyncContext, DPNHANDLE * CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
547   STDMETHOD(GetClientInfo)(THIS_ CONST DPNID dpnid, DPN_PLAYER_INFO * CONST pdpnPlayerInfo, DWORD * CONST pdwSize, CONST DWORD dwFlags) PURE; \
548   STDMETHOD(GetClientAddress)(THIS_ CONST DPNID dpnid, IDirectPlay8Address ** CONST pAddress, CONST DWORD dwFlags) PURE; \
549   STDMETHOD(GetLocalHostAddresses)(THIS_ IDirectPlay8Address ** CONST prgpAddress, DWORD * CONST pcAddress, CONST DWORD dwFlags) PURE; \
550   STDMETHOD(SetApplicationDesc)(THIS_ CONST DPN_APPLICATION_DESC * CONST pad, CONST DWORD dwFlags) PURE; \
551   STDMETHOD(Host)(THIS_ CONST DPN_APPLICATION_DESC * CONST pdnAppDesc, IDirectPlay8Address ** CONST prgpDeviceInfo, CONST DWORD cDeviceInfo, CONST DPN_SECURITY_DESC * CONST pdnSecurity, CONST DPN_SECURITY_CREDENTIALS * CONST pdnCredentials, void * CONST pvPlayerContext, CONST DWORD dwFlags) PURE; \
552   STDMETHOD(SendTo)(THIS_ CONST DPNID dpnid, CONST DPN_BUFFER_DESC * CONST prgBufferDesc, CONST DWORD cBufferDesc, CONST DWORD dwTimeOut, void * CONST pvAsyncContext, DPNHANDLE * CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
553   STDMETHOD(CreateGroup)(THIS_ CONST DPN_GROUP_INFO * CONST pdpnGroupInfo, void * CONST pvGroupContext, void * CONST pvAsyncContext, DPNHANDLE * CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
554   STDMETHOD(DestroyGroup)(THIS_ CONST DPNID idGroup, PVOID CONST pvAsyncContext, DPNHANDLE * CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
555   STDMETHOD(AddPlayerToGroup)(THIS_ CONST DPNID idGroup, CONST DPNID idClient, PVOID CONST pvAsyncContext, DPNHANDLE * CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
556   STDMETHOD(RemovePlayerFromGroup)(THIS_ CONST DPNID idGroup, CONST DPNID idClient, PVOID CONST pvAsyncContext, DPNHANDLE * CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
557   STDMETHOD(SetGroupInfo)(THIS_ CONST DPNID dpnid, DPN_GROUP_INFO * CONST pdpnGroupInfo, PVOID CONST pvAsyncContext, DPNHANDLE * CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
558   STDMETHOD(GetGroupInfo)(THIS_ CONST DPNID dpnid, DPN_GROUP_INFO * CONST pdpnGroupInfo, DWORD * CONST pdwSize, CONST DWORD dwFlags) PURE; \
559   STDMETHOD(EnumPlayersAndGroups)(THIS_ DPNID * CONST prgdpnid, DWORD * CONST pcdpnid, CONST DWORD dwFlags) PURE; \
560   STDMETHOD(EnumGroupMembers)(THIS_ CONST DPNID dpnid, DPNID * CONST prgdpnid, DWORD * CONST pcdpnid, CONST DWORD dwFlags) PURE; \
561   STDMETHOD(Close)(THIS_ CONST DWORD dwFlags) PURE; \
562   STDMETHOD(DestroyClient)(THIS_ CONST DPNID dpnidClient, CONST void * CONST pvDestroyData, CONST DWORD dwDestroyDataSize, CONST DWORD dwFlags) PURE; \
563   STDMETHOD(ReturnBuffer)(THIS_ CONST DPNHANDLE hBufferHandle, CONST DWORD dwFlags) PURE; \
564   STDMETHOD(GetPlayerContext)(THIS_ CONST DPNID dpnid, PVOID * CONST ppvPlayerContext, CONST DWORD dwFlags) PURE; \
565   STDMETHOD(GetGroupContext)(THIS_ CONST DPNID dpnid, PVOID * CONST ppvGroupContext, CONST DWORD dwFlags) PURE; \
566   STDMETHOD(GetCaps)(THIS_ DPN_CAPS * CONST pdpCaps, CONST DWORD dwFlags) PURE; \
567   STDMETHOD(SetCaps)(THIS_ CONST DPN_CAPS * CONST pdpCaps, CONST DWORD dwFlags) PURE; \
568   STDMETHOD(SetSPCaps)(THIS_ CONST GUID * CONST pguidSP, CONST DPN_SP_CAPS * CONST pdpspCaps, CONST DWORD dwFlags ) PURE; \
569   STDMETHOD(GetSPCaps)(THIS_ CONST GUID * CONST pguidSP, DPN_SP_CAPS * CONST pdpspCaps, CONST DWORD dwFlags) PURE; \
570   STDMETHOD(GetConnectionInfo)(THIS_ CONST DPNID dpnid, DPN_CONNECTION_INFO * CONST pdpConnectionInfo, CONST DWORD dwFlags) PURE; \
571   STDMETHOD(RegisterLobby)(THIS_ CONST DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication * CONST pIDP8LobbiedApplication, CONST DWORD dwFlags) PURE;
572 ICOM_DEFINE(IDirectPlay8Server,IUnknown)
573 #undef INTERFACE
574
575 #ifdef COBJMACROS
576 /*** IUnknown methods ***/
577 #define IDirectPlay8Server_QueryInterface(p,a,b)                (p)->lpVtbl->QueryInterface(p,a,b)
578 #define IDirectPlay8Server_AddRef(p)                            (p)->lpVtbl->AddRef(p)
579 #define IDirectPlay8Server_Release(p)                           (p)->lpVtbl->Release(p)
580 /*** IDirectPlay8Server methods ***/
581 #define IDirectPlay8Server_Initialize(p,a,b,c)                  (p)->lpVtbl->Initialize(p,a,b,c)
582 #define IDirectPlay8Server_EnumServiceProviders(p,a,b,c,d,e,f)  (p)->lpVtbl->EnumServiceProviders(p,a,b,c,d,e,f)
583 #define IDirectPlay8Server_CancelAsyncOperation(p,a,b)          (p)->lpVtbl->CancelAsyncOperation(p,a,b)
584 #define IDirectPlay8Server_GetSendQueueInfo(p,a,b,c,d)          (p)->lpVtbl->GetSendQueueInfo(p,a,b,c,d)
585 #define IDirectPlay8Server_GetApplicationDesc(p,a,b,c)          (p)->lpVtbl->GetApplicationDesc(p,a,b,c)
586 #define IDirectPlay8Server_SetServerInfo(p,a,b,c,d)             (p)->lpVtbl->SetServerInfo(p,a,b,c,d)
587 #define IDirectPlay8Server_GetClientInfo(p,a,b,c,d)             (p)->lpVtbl->GetClientInfo(p,a,b,c,d)
588 #define IDirectPlay8Server_GetClientAddress(p,a,b,c)            (p)->lpVtbl->GetClientAddress(p,a,b,c)
589 #define IDirectPlay8Server_GetLocalHostAddresses(p,a,b,c)       (p)->lpVtbl->GetLocalHostAddresses(p,a,b,c)
590 #define IDirectPlay8Server_SetApplicationDesc(p,a,b)            (p)->lpVtbl->SetApplicationDesc(p,a,b)
591 #define IDirectPlay8Server_Host(p,a,b,c,d,e,f,g)                (p)->lpVtbl->Host(p,a,b,c,d,e,f,g)
592 #define IDirectPlay8Server_SendTo(p,a,b,c,d,e,f,g)              (p)->lpVtbl->SendTo(p,a,b,c,d,e,f,g)
593 #define IDirectPlay8Server_CreateGroup(p,a,b,c,d,e)             (p)->lpVtbl->CreateGroup(p,a,b,c,d,e)
594 #define IDirectPlay8Server_DestroyGroup(p,a,b,c,d)              (p)->lpVtbl->DestroyGroup(p,a,b,c,d)
595 #define IDirectPlay8Server_AddPlayerToGroup(p,a,b,c,d,e)        (p)->lpVtbl->AddPlayerToGroup(p,a,b,c,d,e)
596 #define IDirectPlay8Server_RemovePlayerFromGroup(p,a,b,c,d,e)   (p)->lpVtbl->RemovePlayerFromGroup(p,a,b,c,d,e)
597 #define IDirectPlay8Server_SetGroupInfo(p,a,b,c,d,e)            (p)->lpVtbl->SetGroupInfo(p,a,b,c,d,e)
598 #define IDirectPlay8Server_GetGroupInfo(p,a,b,c,d)              (p)->lpVtbl->GetGroupInfo(p,a,b,c,d)
599 #define IDirectPlay8Server_EnumPlayersAndGroups(p,a,b,c)        (p)->lpVtbl->EnumPlayersAndGroups(p,a,b,c)
600 #define IDirectPlay8Server_EnumGroupMembers(p,a,b,c,d)          (p)->lpVtbl->EnumGroupMembers(p,a,b,c,d)
601 #define IDirectPlay8Server_Close(p,a)                           (p)->lpVtbl->Close(p,a)
602 #define IDirectPlay8Server_DestroyClient(p,a,b,c,d)             (p)->lpVtbl->DestroyClient(p,a,b,c,d)
603 #define IDirectPlay8Server_ReturnBuffer(p,a,b)                  (p)->lpVtbl->ReturnBuffer(p,a,b)
604 #define IDirectPlay8Server_GetPlayerContext(p,a,b,c)            (p)->lpVtbl->GetPlayerContext(p,a,b,c)
605 #define IDirectPlay8Server_GetGroupContext(p,a,b,c)             (p)->lpVtbl->GetGroupContext(p,a,b,c)
606 #define IDirectPlay8Server_GetCaps(p,a,b)                       (p)->lpVtbl->GetCaps(p,a,b)
607 #define IDirectPlay8Server_SetCaps(p,a,b)                       (p)->lpVtbl->SetCaps(p,a,b)
608 #define IDirectPlay8Server_SetSPCaps(p,a,b,c)                   (p)->lpVtbl->SetSPCaps(p,a,b,c)
609 #define IDirectPlay8Server_GetSPCaps(p,a,b,c)                   (p)->lpVtbl->GetSPCaps(p,a,b,c)
610 #define IDirectPlay8Server_GetConnectionInfo(p,a,b,c)           (p)->lpVtbl->GetConnectionInfo(p,a,b,c)
611 #define IDirectPlay8Server_RegisterLobby(p,a,b,c)               (p)->lpVtbl->RegisterLobby(p,a,b,c)
612 #endif
613
614 /*****************************************************************************
615  * IDirectPlay8Peer interface
616  */
617 #define INTERFACE IDirectPlay8Peer
618 #define IDirectPlay8Peer_METHODS \
619   IUnknown_METHODS \
620   STDMETHOD(Initialize)(THIS_ PVOID CONST pvUserContext, CONST PFNDPNMESSAGEHANDLER pfn, CONST DWORD dwFlags) PURE; \
621   STDMETHOD(EnumServiceProviders)(THIS_ CONST GUID* CONST pguidServiceProvider, CONST GUID* CONST pguidApplication, DPN_SERVICE_PROVIDER_INFO* CONST pSPInfoBuffer, DWORD* CONST pcbEnumData, DWORD* CONST pcReturned, CONST DWORD dwFlags) PURE; \
622   STDMETHOD(CancelAsyncOperation)(THIS_ CONST DPNHANDLE hAsyncHandle, CONST DWORD dwFlags) PURE; \
623   STDMETHOD(Connect)(THIS_ CONST DPN_APPLICATION_DESC* CONST pdnAppDesc, IDirectPlay8Address* CONST pHostAddr, IDirectPlay8Address* CONST pDeviceInfo, CONST DPN_SECURITY_DESC* CONST pdnSecurity, CONST DPN_SECURITY_CREDENTIALS* CONST pdnCredentials, CONST void* CONST pvUserConnectData, CONST DWORD dwUserConnectDataSize, void* CONST pvPlayerContext, void* CONST pvAsyncContext, DPNHANDLE* CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
624   STDMETHOD(SendTo)(THIS_ CONST DPNID dpnid, CONST DPN_BUFFER_DESC* CONST prgBufferDesc, CONST DWORD cBufferDesc, CONST DWORD dwTimeOut, void* CONST pvAsyncContext, DPNHANDLE* CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
625   STDMETHOD(GetSendQueueInfo)(THIS_ CONST DPNID dpnid, DWORD* CONST pdwNumMsgs, DWORD* CONST pdwNumBytes, CONST DWORD dwFlags) PURE; \
626   STDMETHOD(Host)(THIS_ CONST DPN_APPLICATION_DESC* CONST pdnAppDesc, IDirectPlay8Address **CONST prgpDeviceInfo, CONST DWORD cDeviceInfo, CONST DPN_SECURITY_DESC* CONST pdnSecurity, CONST DPN_SECURITY_CREDENTIALS* CONST pdnCredentials, void* CONST pvPlayerContext, CONST DWORD dwFlags) PURE; \
627   STDMETHOD(GetApplicationDesc)(THIS_ DPN_APPLICATION_DESC* CONST pAppDescBuffer, DWORD* CONST pcbDataSize, CONST DWORD dwFlags) PURE; \
628   STDMETHOD(SetApplicationDesc)(THIS_ CONST DPN_APPLICATION_DESC* CONST pad, CONST DWORD dwFlags) PURE; \
629   STDMETHOD(CreateGroup)(THIS_ CONST DPN_GROUP_INFO* CONST pdpnGroupInfo, void* CONST pvGroupContext, void* CONST pvAsyncContext, DPNHANDLE* CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
630   STDMETHOD(DestroyGroup)(THIS_ CONST DPNID idGroup, PVOID CONST pvAsyncContext, DPNHANDLE* CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
631   STDMETHOD(AddPlayerToGroup)(THIS_ CONST DPNID idGroup, CONST DPNID idClient, PVOID CONST pvAsyncContext, DPNHANDLE* CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
632   STDMETHOD(RemovePlayerFromGroup)(THIS_ CONST DPNID idGroup, CONST DPNID idClient, PVOID CONST pvAsyncContext, DPNHANDLE* CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
633   STDMETHOD(SetGroupInfo)(THIS_ CONST DPNID dpnid, DPN_GROUP_INFO* CONST pdpnGroupInfo,PVOID CONST pvAsyncContext, DPNHANDLE* CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
634   STDMETHOD(GetGroupInfo)(THIS_ CONST DPNID dpnid, DPN_GROUP_INFO* CONST pdpnGroupInfo, DWORD* CONST pdwSize, CONST DWORD dwFlags) PURE; \
635   STDMETHOD(EnumPlayersAndGroups)(THIS_ DPNID* CONST prgdpnid, DWORD* CONST pcdpnid, CONST DWORD dwFlags) PURE; \
636   STDMETHOD(EnumGroupMembers)(THIS_ CONST DPNID dpnid, DPNID* CONST prgdpnid, DWORD* CONST pcdpnid, CONST DWORD dwFlags) PURE; \
637   STDMETHOD(SetPeerInfo)(THIS_ CONST DPN_PLAYER_INFO* CONST pdpnPlayerInfo,PVOID CONST pvAsyncContext, DPNHANDLE* CONST phAsyncHandle, CONST DWORD dwFlags) PURE; \
638   STDMETHOD(GetPeerInfo)(THIS_ CONST DPNID dpnid, DPN_PLAYER_INFO* CONST pdpnPlayerInfo, DWORD* CONST pdwSize, CONST DWORD dwFlags) PURE; \
639   STDMETHOD(GetPeerAddress)(THIS_ CONST DPNID dpnid, IDirectPlay8Address** CONST pAddress, CONST DWORD dwFlags) PURE; \
640   STDMETHOD(GetLocalHostAddresses)(THIS_ IDirectPlay8Address** CONST prgpAddress, DWORD* CONST pcAddress, CONST DWORD dwFlags) PURE; \
641   STDMETHOD(Close)(THIS_ CONST DWORD dwFlags) PURE; \
642   STDMETHOD(EnumHosts)(THIS_ PDPN_APPLICATION_DESC CONST pApplicationDesc, IDirectPlay8Address* CONST pAddrHost, IDirectPlay8Address* CONST pDeviceInfo,PVOID CONST pUserEnumData, CONST DWORD dwUserEnumDataSize, CONST DWORD dwEnumCount, CONST DWORD dwRetryInterval, CONST DWORD dwTimeOut,PVOID CONST pvUserContext, DPNHANDLE* CONST pAsyncHandle, CONST DWORD dwFlags) PURE; \
643   STDMETHOD(DestroyPeer)(THIS_ CONST DPNID dpnidClient, CONST void* CONST pvDestroyData, CONST DWORD dwDestroyDataSize, CONST DWORD dwFlags) PURE; \
644   STDMETHOD(ReturnBuffer)(THIS_ CONST DPNHANDLE hBufferHandle, CONST DWORD dwFlags) PURE; \
645   STDMETHOD(GetPlayerContext)(THIS_ CONST DPNID dpnid,PVOID* CONST ppvPlayerContext, CONST DWORD dwFlags) PURE; \
646   STDMETHOD(GetGroupContext)(THIS_ CONST DPNID dpnid,PVOID* CONST ppvGroupContext, CONST DWORD dwFlags) PURE; \
647   STDMETHOD(GetCaps)(THIS_ DPN_CAPS* CONST pdpCaps, CONST DWORD dwFlags) PURE; \
648   STDMETHOD(SetCaps)(THIS_ CONST DPN_CAPS* CONST pdpCaps, CONST DWORD dwFlags) PURE; \
649   STDMETHOD(SetSPCaps)(THIS_ CONST GUID* CONST pguidSP, CONST DPN_SP_CAPS* CONST pdpspCaps, CONST DWORD dwFlags ) PURE; \
650   STDMETHOD(GetSPCaps)(THIS_ CONST GUID* CONST pguidSP, DPN_SP_CAPS* CONST pdpspCaps, CONST DWORD dwFlags) PURE; \
651   STDMETHOD(GetConnectionInfo)(THIS_ CONST DPNID dpnid, DPN_CONNECTION_INFO* CONST pdpConnectionInfo, CONST DWORD dwFlags) PURE; \
652   STDMETHOD(RegisterLobby)(THIS_ CONST DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication* CONST pIDP8LobbiedApplication, CONST DWORD dwFlags) PURE; \
653   STDMETHOD(TerminateSession)(THIS_ void* CONST pvTerminateData, CONST DWORD dwTerminateDataSize, CONST DWORD dwFlags) PURE;
654 ICOM_DEFINE(IDirectPlay8Peer, IUnknown)
655 #undef INTERFACE
656
657 #ifdef COBJMACROS
658 /*** IUnknown methods ***/
659 #define IDirectPlay8Peer_QueryInterface(p,a,b)                  (p)->lpVtbl->QueryInterface(p,a,b)
660 #define IDirectPlay8Peer_AddRef(p)                              (p)->lpVtbl->AddRef(p)
661 #define IDirectPlay8Peer_Release(p)                             (p)->lpVtbl->Release(p)
662 /*** IDirectPlay8Peer methods ***/
663 #define IDirectPlay8Peer_Initialize(p,a,b,c)                    (p)->lpVtbl->Initialize(p,a,b,c)
664 #define IDirectPlay8Peer_EnumServiceProviders(p,a,b,c,d,e,f)    (p)->lpVtbl->EnumServiceProviders(p,a,b,c,d,e,f)
665 #define IDirectPlay8Peer_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k)     (p)->lpVtbl->EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k)
666 #define IDirectPlay8Peer_CancelAsyncOperation(p,a,b)            (p)->lpVtbl->CancelAsyncOperation(p,a,b)
667 #define IDirectPlay8Peer_Connect(p,a,b,c,d,e,f,g,h,i,j,k)       (p)->lpVtbl->Connect(p,a,b,c,d,e,f,g,h,i,j,k)
668 #define IDirectPlay8Peer_SendTo(p,a,b,c,d,e,f,g)                (p)->lpVtbl->SendTo(p,a,b,c,d,e,f,g)
669 #define IDirectPlay8Peer_GetSendQueueInfo(p,a,b,c,d)            (p)->lpVtbl->GetSendQueueInfo(p,a,b,c,d)
670 #define IDirectPlay8Peer_Host(p,a,b,c,d,e,f,g)                  (p)->lpVtbl->Host(p,a,b,c,d,e,f,g)
671 #define IDirectPlay8Peer_GetApplicationDesc(p,a,b,c)            (p)->lpVtbl->GetApplicationDesc(p,a,b,c)
672 #define IDirectPlay8Peer_SetApplicationDesc(p,a,b)              (p)->lpVtbl->SetApplicationDesc(p,a,b)
673 #define IDirectPlay8Peer_CreateGroup(p,a,b,c,d,e)               (p)->lpVtbl->CreateGroup(p,a,b,c,d,e)
674 #define IDirectPlay8Peer_DestroyGroup(p,a,b,c,d)                (p)->lpVtbl->DestroyGroup(p,a,b,c,d)
675 #define IDirectPlay8Peer_AddPlayerToGroup(p,a,b,c,d,e)          (p)->lpVtbl->AddPlayerToGroup(p,a,b,c,d,e)
676 #define IDirectPlay8Peer_RemovePlayerFromGroup(p,a,b,c,d,e)     (p)->lpVtbl->RemovePlayerFromGroup(p,a,b,c,d,e)
677 #define IDirectPlay8Peer_SetGroupInfo(p,a,b,c,d,e)              (p)->lpVtbl->SetGroupInfo(p,a,b,c,d,e)
678 #define IDirectPlay8Peer_GetGroupInfo(p,a,b,c,d)                (p)->lpVtbl->GetGroupInfo(p,a,b,c,d)
679 #define IDirectPlay8Peer_EnumPlayersAndGroups(p,a,b,c)          (p)->lpVtbl->EnumPlayersAndGroups(p,a,b,c)
680 #define IDirectPlay8Peer_EnumGroupMembers(p,a,b,c,d)            (p)->lpVtbl->EnumGroupMembers(p,a,b,c,d)
681 #define IDirectPlay8Peer_SetPeerInfo(p,a,b,c,d)                 (p)->lpVtbl->SetPeerInfo(p,a,b,c,d)
682 #define IDirectPlay8Peer_GetPeerInfo(p,a,b,c,d)                 (p)->lpVtbl->GetPeerInfo(p,a,b,c,d)
683 #define IDirectPlay8Peer_GetPeerAddress(p,a,b,c)                (p)->lpVtbl->GetPeerAddress(p,a,b,c)
684 #define IDirectPlay8Peer_GetLocalHostAddresses(p,a,b,c)         (p)->lpVtbl->GetLocalHostAddresses(p,a,b,c)
685 #define IDirectPlay8Peer_Close(p,a)                             (p)->lpVtbl->Close(p,a)
686 #define IDirectPlay8Peer_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k)     (p)->lpVtbl->EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k)
687 #define IDirectPlay8Peer_DestroyPeer(p,a,b,c,d)                 (p)->lpVtbl->DestroyPeer(p,a,b,c,d)
688 #define IDirectPlay8Peer_ReturnBuffer(p,a,b)                    (p)->lpVtbl->ReturnBuffer(p,a,b)
689 #define IDirectPlay8Peer_GetPlayerContext(p,a,b,c)              (p)->lpVtbl->GetPlayerContext(p,a,b,c)
690 #define IDirectPlay8Peer_GetGroupContext(p,a,b,c)               (p)->lpVtbl->GetGroupContext(p,a,b,c)
691 #define IDirectPlay8Peer_GetCaps(p,a,b)                         (p)->lpVtbl->GetCaps(p,a,b)
692 #define IDirectPlay8Peer_SetCaps(p,a,b)                         (p)->lpVtbl->SetCaps(p,a,b)
693 #define IDirectPlay8Peer_SetSPCaps(p,a,b,c)                     (p)->lpVtbl->SetSPCaps(p,a,b,c)
694 #define IDirectPlay8Peer_GetSPCaps(p,a,b,c)                     (p)->lpVtbl->GetSPCaps(p,a,b,c)
695 #define IDirectPlay8Peer_GetConnectionInfo(p,a,b,c)             (p)->lpVtbl->GetConnectionInfo(p,a,b,c)
696 #define IDirectPlay8Peer_RegisterLobby(p,a,b,c)                 (p)->lpVtbl->RegisterLobby(p,a,b,c)
697 #define IDirectPlay8Peer_TerminateSession(p,a,b,c)              (p)->lpVtbl->TerminateSession(p,a,b,c)
698 #endif
699
700 #ifdef __cplusplus
701 }
702 #endif
703
704 #endif