Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2154 lines
83 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) 1994-1997 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dplay.h
  6. * Content: DirectPlay include file
  7. *
  8. ***************************************************************************/
  9. #ifndef __DPLAY_INCLUDED__
  10. #define __DPLAY_INCLUDED__
  11. #include <ole2.h> // for DECLARE_INTERFACE and HRESULT
  12. /* avoid warnings in MSVC at Level4 */
  13. #if _MSC_VER >= 1200
  14. #pragma warning(push)
  15. #endif
  16. #pragma warning(disable:4201)
  17. /*
  18. * Some types
  19. */
  20. #ifndef _WIN64
  21. #define DWORD_PTR DWORD
  22. #endif
  23. typedef LPVOID (*LPRGLPVOID)[];
  24. typedef LPRGLPVOID PRGPVOID, LPRGPVOID, PRGLPVOID, PAPVOID, LPAPVOID, PALPVOID, LPALPVOID;
  25. #define VOL volatile
  26. typedef VOID *VOL LPVOIDV;
  27. #define _FACDP 0x877
  28. #define MAKE_DPHRESULT( code ) MAKE_HRESULT( 1, _FACDP, code )
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. /*
  33. * GUIDS used by DirectPlay objects
  34. */
  35. DEFINE_GUID(IID_IDirectPlay2, 0x2b74f7c0, 0x9154, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3);
  36. DEFINE_GUID(IID_IDirectPlay2A,0x9d460580, 0xa822, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82);
  37. DEFINE_GUID(IID_IDirectPlay3, 0x133efe40, 0x32dc, 0x11d0, 0x9c, 0xfb, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
  38. DEFINE_GUID(IID_IDirectPlay3A,0x133efe41, 0x32dc, 0x11d0, 0x9c, 0xfb, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
  39. DEFINE_GUID(IID_IDirectPlay4, 0xab1c530, 0x4745, 0x11d1, 0xa7, 0xa1, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
  40. DEFINE_GUID(IID_IDirectPlay4A,0xab1c531, 0x4745, 0x11d1, 0xa7, 0xa1, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
  41. // {D1EB6D20-8923-11d0-9D97-00A0C90A43CB}
  42. DEFINE_GUID(CLSID_DirectPlay,0xd1eb6d20, 0x8923, 0x11d0, 0x9d, 0x97, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
  43. /*
  44. * GUIDS used by Service Providers shipped with DirectPlay
  45. * Use these to identify Service Provider returned by EnumConnections
  46. */
  47. // GUID for IPX service provider
  48. // {685BC400-9D2C-11cf-A9CD-00AA006886E3}
  49. DEFINE_GUID(DPSPGUID_IPX,
  50. 0x685bc400, 0x9d2c, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3);
  51. // GUID for TCP/IP service provider
  52. // 36E95EE0-8577-11cf-960C-0080C7534E82
  53. DEFINE_GUID(DPSPGUID_TCPIP,
  54. 0x36E95EE0, 0x8577, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82);
  55. // GUID for Serial service provider
  56. // {0F1D6860-88D9-11cf-9C4E-00A0C905425E}
  57. DEFINE_GUID(DPSPGUID_SERIAL,
  58. 0xf1d6860, 0x88d9, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  59. // GUID for Modem service provider
  60. // {44EAA760-CB68-11cf-9C4E-00A0C905425E}
  61. DEFINE_GUID(DPSPGUID_MODEM,
  62. 0x44eaa760, 0xcb68, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  63. /****************************************************************************
  64. *
  65. * DirectPlay Structures
  66. *
  67. * Various structures used to invoke DirectPlay.
  68. *
  69. ****************************************************************************/
  70. #ifndef IDIRECTPLAY2_OR_GREATER
  71. typedef struct IDirectPlay FAR *LPDIRECTPLAY;
  72. #else
  73. typedef struct IUnknown FAR *LPDIRECTPLAY;
  74. #endif
  75. typedef struct IDirectPlay2 FAR *LPDIRECTPLAY2;
  76. typedef struct IDirectPlay2 FAR *LPDIRECTPLAY2A;
  77. typedef struct IDirectPlay2 IDirectPlay2A;
  78. typedef struct IDirectPlay3 FAR *LPDIRECTPLAY3;
  79. typedef struct IDirectPlay3 FAR *LPDIRECTPLAY3A;
  80. typedef struct IDirectPlay3 IDirectPlay3A;
  81. typedef struct IDirectPlay4 FAR *LPDIRECTPLAY4;
  82. typedef struct IDirectPlay4 FAR *LPDIRECTPLAY4A;
  83. typedef struct IDirectPlay4 IDirectPlay4A;
  84. /*
  85. * DPID
  86. * DirectPlay player and group ID
  87. */
  88. typedef DWORD DPID, FAR *LPDPID;
  89. /*
  90. * DPID that system messages come from
  91. */
  92. #define DPID_SYSMSG 0
  93. /*
  94. * DPID representing all players in the session
  95. */
  96. #define DPID_ALLPLAYERS 0
  97. /*
  98. * DPID representing the server player
  99. */
  100. #define DPID_SERVERPLAYER 1
  101. /*
  102. * DPID representing the maxiumum ID in the range of DPID's reserved for
  103. * use by DirectPlay.
  104. */
  105. #define DPID_RESERVEDRANGE 100
  106. /*
  107. * The player ID is unknown (used with e.g. DPSESSION_NOMESSAGEID)
  108. */
  109. #define DPID_UNKNOWN 0xFFFFFFFF
  110. /*
  111. * DPCAPS
  112. * Used to obtain the capabilities of a DirectPlay object
  113. */
  114. typedef struct
  115. {
  116. DWORD dwSize; // Size of structure, in bytes
  117. DWORD dwFlags; // DPCAPS_xxx flags
  118. DWORD dwMaxBufferSize; // Maximum message size, in bytes, for this service provider
  119. DWORD dwMaxQueueSize; // Obsolete.
  120. DWORD dwMaxPlayers; // Maximum players/groups (local + remote)
  121. DWORD dwHundredBaud; // Bandwidth in 100 bits per second units;
  122. // i.e. 24 is 2400, 96 is 9600, etc.
  123. DWORD dwLatency; // Estimated latency; 0 = unknown
  124. DWORD dwMaxLocalPlayers; // Maximum # of locally created players allowed
  125. DWORD dwHeaderLength; // Maximum header length, in bytes, on messages
  126. // added by the service provider
  127. DWORD dwTimeout; // Service provider's suggested timeout value
  128. // This is how long DirectPlay will wait for
  129. // responses to system messages
  130. } DPCAPS, FAR *LPDPCAPS;
  131. /*
  132. * This DirectPlay object is the session host. If the host exits the
  133. * session, another application will become the host and receive a
  134. * DPSYS_HOST system message.
  135. */
  136. #define DPCAPS_ISHOST 0x00000002
  137. /*
  138. * The service provider bound to this DirectPlay object can optimize
  139. * group messaging.
  140. */
  141. #define DPCAPS_GROUPOPTIMIZED 0x00000008
  142. /*
  143. * The service provider bound to this DirectPlay object can optimize
  144. * keep alives (see DPSESSION_KEEPALIVE)
  145. */
  146. #define DPCAPS_KEEPALIVEOPTIMIZED 0x00000010
  147. /*
  148. * The service provider bound to this DirectPlay object can optimize
  149. * guaranteed message delivery.
  150. */
  151. #define DPCAPS_GUARANTEEDOPTIMIZED 0x00000020
  152. /*
  153. * This DirectPlay object supports guaranteed message delivery.
  154. */
  155. #define DPCAPS_GUARANTEEDSUPPORTED 0x00000040
  156. /*
  157. * This DirectPlay object supports digital signing of messages.
  158. */
  159. #define DPCAPS_SIGNINGSUPPORTED 0x00000080
  160. /*
  161. * This DirectPlay object supports encryption of messages.
  162. */
  163. #define DPCAPS_ENCRYPTIONSUPPORTED 0x00000100
  164. /*
  165. * This DirectPlay player was created on this machine
  166. */
  167. #define DPPLAYERCAPS_LOCAL 0x00000800
  168. /*
  169. * Current Open settings supports all forms of Cancel
  170. */
  171. #define DPCAPS_ASYNCCANCELSUPPORTED 0x00001000
  172. /*
  173. * Current Open settings supports CancelAll, but not Cancel
  174. */
  175. #define DPCAPS_ASYNCCANCELALLSUPPORTED 0x00002000
  176. /*
  177. * Current Open settings supports Send Timeouts for sends
  178. */
  179. #define DPCAPS_SENDTIMEOUTSUPPORTED 0x00004000
  180. /*
  181. * Current Open settings supports send priority
  182. */
  183. #define DPCAPS_SENDPRIORITYSUPPORTED 0x00008000
  184. /*
  185. * Current Open settings supports DPSEND_ASYNC flag
  186. */
  187. #define DPCAPS_ASYNCSUPPORTED 0x00010000
  188. /*
  189. * DPSESSIONDESC2
  190. * Used to describe the properties of a DirectPlay
  191. * session instance
  192. */
  193. typedef struct
  194. {
  195. DWORD dwSize; // Size of structure
  196. DWORD dwFlags; // DPSESSION_xxx flags
  197. GUID guidInstance; // ID for the session instance
  198. GUID guidApplication; // GUID of the DirectPlay application.
  199. // GUID_NULL for all applications.
  200. DWORD dwMaxPlayers; // Maximum # players allowed in session
  201. DWORD dwCurrentPlayers; // Current # players in session (read only)
  202. union
  203. { // Name of the session
  204. LPWSTR lpszSessionName; // Unicode
  205. LPSTR lpszSessionNameA; // ANSI
  206. };
  207. union
  208. { // Password of the session (optional)
  209. LPWSTR lpszPassword; // Unicode
  210. LPSTR lpszPasswordA; // ANSI
  211. };
  212. DWORD_PTR dwReserved1; // Reserved for future MS use.
  213. DWORD_PTR dwReserved2;
  214. DWORD_PTR dwUser1; // For use by the application
  215. DWORD_PTR dwUser2;
  216. DWORD_PTR dwUser3;
  217. DWORD_PTR dwUser4;
  218. } DPSESSIONDESC2, FAR *LPDPSESSIONDESC2;
  219. typedef DPSESSIONDESC2 * VOL LPDPSESSIONDESC2_V;
  220. /*
  221. * LPCDPSESSIONDESC2
  222. * A constant pointer to DPSESSIONDESC2
  223. */
  224. typedef const DPSESSIONDESC2 FAR *LPCDPSESSIONDESC2;
  225. /*
  226. * Applications cannot create new players in this session.
  227. */
  228. #define DPSESSION_NEWPLAYERSDISABLED 0x00000001
  229. /*
  230. * If the DirectPlay object that created the session, the host,
  231. * quits, then the host will attempt to migrate to another
  232. * DirectPlay object so that new players can continue to be created
  233. * and new applications can join the session.
  234. */
  235. #define DPSESSION_MIGRATEHOST 0x00000004
  236. /*
  237. * This flag tells DirectPlay not to set the idPlayerTo and idPlayerFrom
  238. * fields in player messages. This cuts two DWORD's off the message
  239. * overhead.
  240. */
  241. #define DPSESSION_NOMESSAGEID 0x00000008
  242. /*
  243. * This flag tells DirectPlay to not allow any new applications to
  244. * join the session. Applications already in the session can still
  245. * create new players.
  246. */
  247. #define DPSESSION_JOINDISABLED 0x00000020
  248. /*
  249. * This flag tells DirectPlay to detect when remote players
  250. * exit abnormally (e.g. their computer or modem gets unplugged)
  251. */
  252. #define DPSESSION_KEEPALIVE 0x00000040
  253. /*
  254. * This flag tells DirectPlay not to send a message to all players
  255. * when a players remote data changes
  256. */
  257. #define DPSESSION_NODATAMESSAGES 0x00000080
  258. /*
  259. * This flag indicates that the session belongs to a secure server
  260. * and needs user authentication
  261. */
  262. #define DPSESSION_SECURESERVER 0x00000100
  263. /*
  264. * This flag indicates that the session is private and requirs a password
  265. * for EnumSessions as well as Open.
  266. */
  267. #define DPSESSION_PRIVATE 0x00000200
  268. /*
  269. * This flag indicates that the session requires a password for joining.
  270. */
  271. #define DPSESSION_PASSWORDREQUIRED 0x00000400
  272. /*
  273. * This flag tells DirectPlay to route all messages through the server
  274. */
  275. #define DPSESSION_MULTICASTSERVER 0x00000800
  276. /*
  277. * This flag tells DirectPlay to only download information about the
  278. * DPPLAYER_SERVERPLAYER.
  279. */
  280. #define DPSESSION_CLIENTSERVER 0x00001000
  281. /*
  282. * This flag tells DirectPlay to use the protocol built into dplay
  283. * for reliability and statistics all the time. When this bit is
  284. * set, only other sessions with this bit set can join or be joined.
  285. */
  286. #define DPSESSION_DIRECTPLAYPROTOCOL 0x00002000
  287. /*
  288. * This flag tells DirectPlay that preserving order of received
  289. * packets is not important, when using reliable delivery. This
  290. * will allow messages to be indicated out of order if preceding
  291. * messages have not yet arrived. Otherwise DPLAY will wait for
  292. * earlier messages before delivering later reliable messages.
  293. */
  294. #define DPSESSION_NOPRESERVEORDER 0x00004000
  295. /*
  296. * This flag tells DirectPlay to optimize communication for latency
  297. */
  298. #define DPSESSION_OPTIMIZELATENCY 0x00008000
  299. /*
  300. * This flag allows lobby launched games that aren't voice enabled
  301. * to get voice capabilities.
  302. */
  303. #define DPSESSION_ALLOWVOICERETRO 0x00010000
  304. /*
  305. * This flag supresses transmission of session desc changes.
  306. * DPSESSION_NODATAMESSAGES was supposed to do that, but SetSessionDesc
  307. * was ignoring the flag and some apps depended on the broken behavior, this
  308. * flag allows applications to get the right behaviour without breaking apps depending
  309. * on old broken behavior.
  310. */
  311. #define DPSESSION_NOSESSIONDESCMESSAGES 0x00020000
  312. /*
  313. * DPNAME
  314. * Used to hold the name of a DirectPlay entity
  315. * like a player or a group
  316. */
  317. typedef struct
  318. {
  319. DWORD dwSize; // Size of structure
  320. DWORD dwFlags; // Not used. Must be zero.
  321. union
  322. { // The short or friendly name
  323. LPWSTR lpszShortName; // Unicode
  324. LPSTR lpszShortNameA; // ANSI
  325. };
  326. union
  327. { // The long or formal name
  328. LPWSTR lpszLongName; // Unicode
  329. LPSTR lpszLongNameA; // ANSI
  330. };
  331. } DPNAME, FAR *LPDPNAME;
  332. /*
  333. * LPCDPNAME
  334. * A constant pointer to DPNAME
  335. */
  336. typedef const DPNAME FAR *LPCDPNAME;
  337. /*
  338. * DPCREDENTIALS
  339. * Used to hold the user name and password of a DirectPlay user
  340. */
  341. typedef struct
  342. {
  343. DWORD dwSize; // Size of structure
  344. DWORD dwFlags; // Not used. Must be zero.
  345. union
  346. { // User name of the account
  347. LPWSTR lpszUsername; // Unicode
  348. LPSTR lpszUsernameA; // ANSI
  349. };
  350. union
  351. { // Password of the account
  352. LPWSTR lpszPassword; // Unicode
  353. LPSTR lpszPasswordA; // ANSI
  354. };
  355. union
  356. { // Domain name of the account
  357. LPWSTR lpszDomain; // Unicode
  358. LPSTR lpszDomainA; // ANSI
  359. };
  360. } DPCREDENTIALS, FAR *LPDPCREDENTIALS;
  361. typedef const DPCREDENTIALS FAR *LPCDPCREDENTIALS;
  362. /*
  363. * DPSECURITYDESC
  364. * Used to describe the security properties of a DirectPlay
  365. * session instance
  366. */
  367. typedef struct
  368. {
  369. DWORD dwSize; // Size of structure
  370. DWORD dwFlags; // Not used. Must be zero.
  371. union
  372. { // SSPI provider name
  373. LPWSTR lpszSSPIProvider; // Unicode
  374. LPSTR lpszSSPIProviderA; // ANSI
  375. };
  376. union
  377. { // CAPI provider name
  378. LPWSTR lpszCAPIProvider; // Unicode
  379. LPSTR lpszCAPIProviderA; // ANSI
  380. };
  381. DWORD dwCAPIProviderType; // Crypto Service Provider type
  382. DWORD dwEncryptionAlgorithm; // Encryption Algorithm type
  383. } DPSECURITYDESC, FAR *LPDPSECURITYDESC;
  384. typedef const DPSECURITYDESC FAR *LPCDPSECURITYDESC;
  385. /*
  386. * DPACCOUNTDESC
  387. * Used to describe a user membership account
  388. */
  389. typedef struct
  390. {
  391. DWORD dwSize; // Size of structure
  392. DWORD dwFlags; // Not used. Must be zero.
  393. union
  394. { // Account identifier
  395. LPWSTR lpszAccountID; // Unicode
  396. LPSTR lpszAccountIDA; // ANSI
  397. };
  398. } DPACCOUNTDESC, FAR *LPDPACCOUNTDESC;
  399. typedef const DPACCOUNTDESC FAR *LPCDPACCOUNTDESC;
  400. /*
  401. * LPCGUID
  402. * A constant pointer to a guid
  403. */
  404. typedef const GUID FAR *LPCGUID;
  405. /*
  406. * DPLCONNECTION
  407. * Used to hold all in the informaion needed to connect
  408. * an application to a session or create a session
  409. */
  410. typedef struct
  411. {
  412. DWORD dwSize; // Size of this structure
  413. DWORD dwFlags; // Flags specific to this structure
  414. LPDPSESSIONDESC2 lpSessionDesc; // Pointer to session desc to use on connect
  415. LPDPNAME lpPlayerName; // Pointer to Player name structure
  416. GUID guidSP; // GUID of the DPlay SP to use
  417. LPVOID lpAddress; // Address for service provider
  418. DWORD dwAddressSize; // Size of address data
  419. } DPLCONNECTION, FAR *LPDPLCONNECTION;
  420. /*
  421. * LPCDPLCONNECTION
  422. * A constant pointer to DPLCONNECTION
  423. */
  424. typedef const DPLCONNECTION FAR *LPCDPLCONNECTION;
  425. /*
  426. * DPCHAT
  427. * Used to hold the a DirectPlay chat message
  428. */
  429. typedef struct
  430. {
  431. DWORD dwSize;
  432. DWORD dwFlags;
  433. union
  434. { // Message string
  435. LPWSTR lpszMessage; // Unicode
  436. LPSTR lpszMessageA; // ANSI
  437. };
  438. } DPCHAT, FAR * LPDPCHAT;
  439. /*
  440. * SGBUFFER
  441. * Scatter Gather Buffer used for SendEx
  442. */
  443. typedef struct
  444. {
  445. UINT len; // length of buffer data
  446. PUCHAR pData; // pointer to buffer data
  447. } SGBUFFER, *PSGBUFFER, FAR *LPSGBUFFER;
  448. /****************************************************************************
  449. *
  450. * Prototypes for DirectPlay callback functions
  451. *
  452. ****************************************************************************/
  453. /*
  454. * Callback for IDirectPlay2::EnumSessions
  455. */
  456. typedef BOOL (FAR PASCAL * LPDPENUMSESSIONSCALLBACK2)(
  457. LPCDPSESSIONDESC2 lpThisSD,
  458. LPDWORD lpdwTimeOut,
  459. DWORD dwFlags,
  460. LPVOID lpContext );
  461. /*
  462. * This flag is set on the EnumSessions callback dwFlags parameter when
  463. * the time out has occurred. There will be no session data for this
  464. * callback. If *lpdwTimeOut is set to a non-zero value and the
  465. * EnumSessionsCallback function returns TRUE then EnumSessions will
  466. * continue waiting until the next timeout occurs. Timeouts are in
  467. * milliseconds.
  468. */
  469. #define DPESC_TIMEDOUT 0x00000001
  470. /*
  471. * Callback for IDirectPlay2::EnumPlayers
  472. * IDirectPlay2::EnumGroups
  473. * IDirectPlay2::EnumGroupPlayers
  474. */
  475. typedef BOOL (FAR PASCAL *LPDPENUMPLAYERSCALLBACK2)(
  476. DPID dpId,
  477. DWORD dwPlayerType,
  478. LPCDPNAME lpName,
  479. DWORD dwFlags,
  480. LPVOID lpContext );
  481. /*
  482. * Unicode callback for DirectPlayEnumerate
  483. * This callback prototype will be used if compiling
  484. * for Unicode strings
  485. */
  486. typedef BOOL (FAR PASCAL * LPDPENUMDPCALLBACK)(
  487. LPGUID lpguidSP,
  488. LPWSTR lpSPName,
  489. DWORD dwMajorVersion,
  490. DWORD dwMinorVersion,
  491. LPVOID lpContext);
  492. /*
  493. * ANSI callback for DirectPlayEnumerate
  494. * This callback prototype will be used if compiling
  495. * for ANSI strings
  496. */
  497. typedef BOOL (FAR PASCAL * LPDPENUMDPCALLBACKA)(
  498. LPGUID lpguidSP,
  499. LPSTR lpSPName,
  500. DWORD dwMajorVersion,
  501. DWORD dwMinorVersion,
  502. LPVOID lpContext);
  503. /*
  504. * Callback for IDirectPlay3(A)::EnumConnections
  505. */
  506. typedef BOOL (FAR PASCAL * LPDPENUMCONNECTIONSCALLBACK)(
  507. LPCGUID lpguidSP,
  508. LPVOID lpConnection,
  509. DWORD dwConnectionSize,
  510. LPCDPNAME lpName,
  511. DWORD dwFlags,
  512. LPVOID lpContext);
  513. /*
  514. * API's
  515. */
  516. #ifdef UNICODE
  517. #define DirectPlayEnumerate DirectPlayEnumerateW
  518. #else
  519. #define DirectPlayEnumerate DirectPlayEnumerateA
  520. #endif // UNICODE
  521. extern HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA, LPVOID );
  522. extern HRESULT WINAPI DirectPlayEnumerateW( LPDPENUMDPCALLBACK, LPVOID );
  523. extern HRESULT WINAPI DirectPlayCreate( LPGUID lpGUID, LPDIRECTPLAY *lplpDP, IUnknown *pUnk);
  524. /****************************************************************************
  525. *
  526. * IDirectPlay2 (and IDirectPlay2A) Interface
  527. *
  528. ****************************************************************************/
  529. #undef INTERFACE
  530. #define INTERFACE IDirectPlay2
  531. DECLARE_INTERFACE_( IDirectPlay2, IUnknown )
  532. {
  533. /*** IUnknown methods ***/
  534. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  535. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  536. STDMETHOD_(ULONG,Release) (THIS) PURE;
  537. /*** IDirectPlay2 methods ***/
  538. STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE;
  539. STDMETHOD(Close) (THIS) PURE;
  540. STDMETHOD(CreateGroup) (THIS_ LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE;
  541. STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPDPNAME,HANDLE,LPVOID,DWORD,DWORD) PURE;
  542. STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE;
  543. STDMETHOD(DestroyGroup) (THIS_ DPID) PURE;
  544. STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE;
  545. STDMETHOD(EnumGroupPlayers) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE;
  546. STDMETHOD(EnumGroups) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE;
  547. STDMETHOD(EnumPlayers) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE;
  548. STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC2,DWORD,LPDPENUMSESSIONSCALLBACK2,LPVOID,DWORD) PURE;
  549. STDMETHOD(GetCaps) (THIS_ LPDPCAPS,DWORD) PURE;
  550. STDMETHOD(GetGroupData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE;
  551. STDMETHOD(GetGroupName) (THIS_ DPID,LPVOID,LPDWORD) PURE;
  552. STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE;
  553. STDMETHOD(GetPlayerAddress) (THIS_ DPID,LPVOID,LPDWORD) PURE;
  554. STDMETHOD(GetPlayerCaps) (THIS_ DPID,LPDPCAPS,DWORD) PURE;
  555. STDMETHOD(GetPlayerData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE;
  556. STDMETHOD(GetPlayerName) (THIS_ DPID,LPVOID,LPDWORD) PURE;
  557. STDMETHOD(GetSessionDesc) (THIS_ LPVOID,LPDWORD) PURE;
  558. STDMETHOD(Initialize) (THIS_ LPGUID) PURE;
  559. STDMETHOD(Open) (THIS_ LPDPSESSIONDESC2,DWORD) PURE;
  560. STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE;
  561. STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE;
  562. STDMETHOD(SetGroupData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE;
  563. STDMETHOD(SetGroupName) (THIS_ DPID,LPDPNAME,DWORD) PURE;
  564. STDMETHOD(SetPlayerData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE;
  565. STDMETHOD(SetPlayerName) (THIS_ DPID,LPDPNAME,DWORD) PURE;
  566. STDMETHOD(SetSessionDesc) (THIS_ LPDPSESSIONDESC2,DWORD) PURE;
  567. };
  568. /****************************************************************************
  569. *
  570. * IDirectPlay2 interface macros
  571. *
  572. ****************************************************************************/
  573. #if !defined(__cplusplus) || defined(CINTERFACE)
  574. #define IDirectPlay2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  575. #define IDirectPlay2_AddRef(p) (p)->lpVtbl->AddRef(p)
  576. #define IDirectPlay2_Release(p) (p)->lpVtbl->Release(p)
  577. #define IDirectPlay2_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b)
  578. #define IDirectPlay2_Close(p) (p)->lpVtbl->Close(p)
  579. #define IDirectPlay2_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e)
  580. #define IDirectPlay2_CreatePlayer(p,a,b,c,d,e,f) (p)->lpVtbl->CreatePlayer(p,a,b,c,d,e,f)
  581. #define IDirectPlay2_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b)
  582. #define IDirectPlay2_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a)
  583. #define IDirectPlay2_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a)
  584. #define IDirectPlay2_EnumGroupPlayers(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d,e)
  585. #define IDirectPlay2_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d)
  586. #define IDirectPlay2_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d)
  587. #define IDirectPlay2_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e)
  588. #define IDirectPlay2_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b)
  589. #define IDirectPlay2_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b)
  590. #define IDirectPlay2_GetGroupData(p,a,b,c,d) (p)->lpVtbl->GetGroupData(p,a,b,c,d)
  591. #define IDirectPlay2_GetGroupName(p,a,b,c) (p)->lpVtbl->GetGroupName(p,a,b,c)
  592. #define IDirectPlay2_GetPlayerAddress(p,a,b,c) (p)->lpVtbl->GetPlayerAddress(p,a,b,c)
  593. #define IDirectPlay2_GetPlayerCaps(p,a,b,c) (p)->lpVtbl->GetPlayerCaps(p,a,b,c)
  594. #define IDirectPlay2_GetPlayerData(p,a,b,c,d) (p)->lpVtbl->GetPlayerData(p,a,b,c,d)
  595. #define IDirectPlay2_GetPlayerName(p,a,b,c) (p)->lpVtbl->GetPlayerName(p,a,b,c)
  596. #define IDirectPlay2_GetSessionDesc(p,a,b) (p)->lpVtbl->GetSessionDesc(p,a,b)
  597. #define IDirectPlay2_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
  598. #define IDirectPlay2_Open(p,a,b) (p)->lpVtbl->Open(p,a,b)
  599. #define IDirectPlay2_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e)
  600. #define IDirectPlay2_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e)
  601. #define IDirectPlay2_SetGroupData(p,a,b,c,d) (p)->lpVtbl->SetGroupData(p,a,b,c,d)
  602. #define IDirectPlay2_SetGroupName(p,a,b,c) (p)->lpVtbl->SetGroupName(p,a,b,c)
  603. #define IDirectPlay2_SetPlayerData(p,a,b,c,d) (p)->lpVtbl->SetPlayerData(p,a,b,c,d)
  604. #define IDirectPlay2_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c)
  605. #define IDirectPlay2_SetSessionDesc(p,a,b) (p)->lpVtbl->SetSessionDesc(p,a,b)
  606. #else /* C++ */
  607. #define IDirectPlay2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  608. #define IDirectPlay2_AddRef(p) (p)->AddRef()
  609. #define IDirectPlay2_Release(p) (p)->Release()
  610. #define IDirectPlay2_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b)
  611. #define IDirectPlay2_Close(p) (p)->Close()
  612. #define IDirectPlay2_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e)
  613. #define IDirectPlay2_CreatePlayer(p,a,b,c,d,e,f) (p)->CreatePlayer(a,b,c,d,e,f)
  614. #define IDirectPlay2_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b)
  615. #define IDirectPlay2_DestroyGroup(p,a) (p)->DestroyGroup(a)
  616. #define IDirectPlay2_DestroyPlayer(p,a) (p)->DestroyPlayer(a)
  617. #define IDirectPlay2_EnumGroupPlayers(p,a,b,c,d,e) (p)->EnumGroupPlayers(a,b,c,d,e)
  618. #define IDirectPlay2_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d)
  619. #define IDirectPlay2_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d)
  620. #define IDirectPlay2_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e)
  621. #define IDirectPlay2_GetCaps(p,a,b) (p)->GetCaps(a,b)
  622. #define IDirectPlay2_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b)
  623. #define IDirectPlay2_GetGroupData(p,a,b,c,d) (p)->GetGroupData(a,b,c,d)
  624. #define IDirectPlay2_GetGroupName(p,a,b,c) (p)->GetGroupName(a,b,c)
  625. #define IDirectPlay2_GetPlayerAddress(p,a,b,c) (p)->GetPlayerAddress(a,b,c)
  626. #define IDirectPlay2_GetPlayerCaps(p,a,b,c) (p)->GetPlayerCaps(a,b,c)
  627. #define IDirectPlay2_GetPlayerData(p,a,b,c,d) (p)->GetPlayerData(a,b,c,d)
  628. #define IDirectPlay2_GetPlayerName(p,a,b,c) (p)->GetPlayerName(a,b,c)
  629. #define IDirectPlay2_GetSessionDesc(p,a,b) (p)->GetSessionDesc(a,b)
  630. #define IDirectPlay2_Initialize(p,a) (p)->Initialize(a)
  631. #define IDirectPlay2_Open(p,a,b) (p)->Open(a,b)
  632. #define IDirectPlay2_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e)
  633. #define IDirectPlay2_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e)
  634. #define IDirectPlay2_SetGroupData(p,a,b,c,d) (p)->SetGroupData(a,b,c,d)
  635. #define IDirectPlay2_SetGroupName(p,a,b,c) (p)->SetGroupName(a,b,c)
  636. #define IDirectPlay2_SetPlayerData(p,a,b,c,d) (p)->SetPlayerData(a,b,c,d)
  637. #define IDirectPlay2_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c)
  638. #define IDirectPlay2_SetSessionDesc(p,a,b) (p)->SetSessionDesc(a,b)
  639. #endif
  640. /****************************************************************************
  641. *
  642. * IDirectPlay3 (and IDirectPlay3A) Interface
  643. *
  644. ****************************************************************************/
  645. #undef INTERFACE
  646. #define INTERFACE IDirectPlay3
  647. DECLARE_INTERFACE_( IDirectPlay3, IDirectPlay2 )
  648. {
  649. /*** IUnknown methods ***/
  650. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  651. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  652. STDMETHOD_(ULONG,Release) (THIS) PURE;
  653. /*** IDirectPlay2 methods ***/
  654. STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE;
  655. STDMETHOD(Close) (THIS) PURE;
  656. STDMETHOD(CreateGroup) (THIS_ LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE;
  657. STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPDPNAME,HANDLE,LPVOID,DWORD,DWORD) PURE;
  658. STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE;
  659. STDMETHOD(DestroyGroup) (THIS_ DPID) PURE;
  660. STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE;
  661. STDMETHOD(EnumGroupPlayers) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE;
  662. STDMETHOD(EnumGroups) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE;
  663. STDMETHOD(EnumPlayers) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE;
  664. STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC2,DWORD,LPDPENUMSESSIONSCALLBACK2,LPVOID,DWORD) PURE;
  665. STDMETHOD(GetCaps) (THIS_ LPDPCAPS,DWORD) PURE;
  666. STDMETHOD(GetGroupData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE;
  667. STDMETHOD(GetGroupName) (THIS_ DPID,LPVOID,LPDWORD) PURE;
  668. STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE;
  669. STDMETHOD(GetPlayerAddress) (THIS_ DPID,LPVOID,LPDWORD) PURE;
  670. STDMETHOD(GetPlayerCaps) (THIS_ DPID,LPDPCAPS,DWORD) PURE;
  671. STDMETHOD(GetPlayerData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE;
  672. STDMETHOD(GetPlayerName) (THIS_ DPID,LPVOID,LPDWORD) PURE;
  673. STDMETHOD(GetSessionDesc) (THIS_ LPVOID,LPDWORD) PURE;
  674. STDMETHOD(Initialize) (THIS_ LPGUID) PURE;
  675. STDMETHOD(Open) (THIS_ LPDPSESSIONDESC2,DWORD) PURE;
  676. STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE;
  677. STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE;
  678. STDMETHOD(SetGroupData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE;
  679. STDMETHOD(SetGroupName) (THIS_ DPID,LPDPNAME,DWORD) PURE;
  680. STDMETHOD(SetPlayerData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE;
  681. STDMETHOD(SetPlayerName) (THIS_ DPID,LPDPNAME,DWORD) PURE;
  682. STDMETHOD(SetSessionDesc) (THIS_ LPDPSESSIONDESC2,DWORD) PURE;
  683. /*** IDirectPlay3 methods ***/
  684. STDMETHOD(AddGroupToGroup) (THIS_ DPID, DPID) PURE;
  685. STDMETHOD(CreateGroupInGroup) (THIS_ DPID,LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE;
  686. STDMETHOD(DeleteGroupFromGroup) (THIS_ DPID,DPID) PURE;
  687. STDMETHOD(EnumConnections) (THIS_ LPCGUID,LPDPENUMCONNECTIONSCALLBACK,LPVOID,DWORD) PURE;
  688. STDMETHOD(EnumGroupsInGroup) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE;
  689. STDMETHOD(GetGroupConnectionSettings)(THIS_ DWORD, DPID, LPVOID, LPDWORD) PURE;
  690. STDMETHOD(InitializeConnection) (THIS_ LPVOID,DWORD) PURE;
  691. STDMETHOD(SecureOpen) (THIS_ LPCDPSESSIONDESC2,DWORD,LPCDPSECURITYDESC,LPCDPCREDENTIALS) PURE;
  692. STDMETHOD(SendChatMessage) (THIS_ DPID,DPID,DWORD,LPDPCHAT) PURE;
  693. STDMETHOD(SetGroupConnectionSettings)(THIS_ DWORD,DPID,LPDPLCONNECTION) PURE;
  694. STDMETHOD(StartSession) (THIS_ DWORD,DPID) PURE;
  695. STDMETHOD(GetGroupFlags) (THIS_ DPID,LPDWORD) PURE;
  696. STDMETHOD(GetGroupParent) (THIS_ DPID,LPDPID) PURE;
  697. STDMETHOD(GetPlayerAccount) (THIS_ DPID, DWORD, LPVOID, LPDWORD) PURE;
  698. STDMETHOD(GetPlayerFlags) (THIS_ DPID,LPDWORD) PURE;
  699. };
  700. /****************************************************************************
  701. *
  702. * IDirectPlay3 interface macros
  703. *
  704. ****************************************************************************/
  705. #if !defined(__cplusplus) || defined(CINTERFACE)
  706. #define IDirectPlay3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  707. #define IDirectPlay3_AddRef(p) (p)->lpVtbl->AddRef(p)
  708. #define IDirectPlay3_Release(p) (p)->lpVtbl->Release(p)
  709. #define IDirectPlay3_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b)
  710. #define IDirectPlay3_Close(p) (p)->lpVtbl->Close(p)
  711. #define IDirectPlay3_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e)
  712. #define IDirectPlay3_CreatePlayer(p,a,b,c,d,e,f) (p)->lpVtbl->CreatePlayer(p,a,b,c,d,e,f)
  713. #define IDirectPlay3_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b)
  714. #define IDirectPlay3_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a)
  715. #define IDirectPlay3_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a)
  716. #define IDirectPlay3_EnumGroupPlayers(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d,e)
  717. #define IDirectPlay3_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d)
  718. #define IDirectPlay3_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d)
  719. #define IDirectPlay3_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e)
  720. #define IDirectPlay3_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b)
  721. #define IDirectPlay3_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b)
  722. #define IDirectPlay3_GetGroupData(p,a,b,c,d) (p)->lpVtbl->GetGroupData(p,a,b,c,d)
  723. #define IDirectPlay3_GetGroupName(p,a,b,c) (p)->lpVtbl->GetGroupName(p,a,b,c)
  724. #define IDirectPlay3_GetPlayerAddress(p,a,b,c) (p)->lpVtbl->GetPlayerAddress(p,a,b,c)
  725. #define IDirectPlay3_GetPlayerCaps(p,a,b,c) (p)->lpVtbl->GetPlayerCaps(p,a,b,c)
  726. #define IDirectPlay3_GetPlayerData(p,a,b,c,d) (p)->lpVtbl->GetPlayerData(p,a,b,c,d)
  727. #define IDirectPlay3_GetPlayerName(p,a,b,c) (p)->lpVtbl->GetPlayerName(p,a,b,c)
  728. #define IDirectPlay3_GetSessionDesc(p,a,b) (p)->lpVtbl->GetSessionDesc(p,a,b)
  729. #define IDirectPlay3_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
  730. #define IDirectPlay3_Open(p,a,b) (p)->lpVtbl->Open(p,a,b)
  731. #define IDirectPlay3_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e)
  732. #define IDirectPlay3_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e)
  733. #define IDirectPlay3_SetGroupData(p,a,b,c,d) (p)->lpVtbl->SetGroupData(p,a,b,c,d)
  734. #define IDirectPlay3_SetGroupName(p,a,b,c) (p)->lpVtbl->SetGroupName(p,a,b,c)
  735. #define IDirectPlay3_SetPlayerData(p,a,b,c,d) (p)->lpVtbl->SetPlayerData(p,a,b,c,d)
  736. #define IDirectPlay3_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c)
  737. #define IDirectPlay3_SetSessionDesc(p,a,b) (p)->lpVtbl->SetSessionDesc(p,a,b)
  738. #define IDirectPlay3_AddGroupToGroup(p,a,b) (p)->lpVtbl->AddGroupToGroup(p,a,b)
  739. #define IDirectPlay3_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->lpVtbl->CreateGroupInGroup(p,a,b,c,d,e,f)
  740. #define IDirectPlay3_DeleteGroupFromGroup(p,a,b) (p)->lpVtbl->DeleteGroupFromGroup(p,a,b)
  741. #define IDirectPlay3_EnumConnections(p,a,b,c,d) (p)->lpVtbl->EnumConnections(p,a,b,c,d)
  742. #define IDirectPlay3_EnumGroupsInGroup(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupsInGroup(p,a,b,c,d,e)
  743. #define IDirectPlay3_GetGroupConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetGroupConnectionSettings(p,a,b,c,d)
  744. #define IDirectPlay3_InitializeConnection(p,a,b) (p)->lpVtbl->InitializeConnection(p,a,b)
  745. #define IDirectPlay3_SecureOpen(p,a,b,c,d) (p)->lpVtbl->SecureOpen(p,a,b,c,d)
  746. #define IDirectPlay3_SendChatMessage(p,a,b,c,d) (p)->lpVtbl->SendChatMessage(p,a,b,c,d)
  747. #define IDirectPlay3_SetGroupConnectionSettings(p,a,b,c) (p)->lpVtbl->SetGroupConnectionSettings(p,a,b,c)
  748. #define IDirectPlay3_StartSession(p,a,b) (p)->lpVtbl->StartSession(p,a,b)
  749. #define IDirectPlay3_GetGroupFlags(p,a,b) (p)->lpVtbl->GetGroupFlags(p,a,b)
  750. #define IDirectPlay3_GetGroupParent(p,a,b) (p)->lpVtbl->GetGroupParent(p,a,b)
  751. #define IDirectPlay3_GetPlayerAccount(p,a,b,c,d) (p)->lpVtbl->GetPlayerAccount(p,a,b,c,d)
  752. #define IDirectPlay3_GetPlayerFlags(p,a,b) (p)->lpVtbl->GetPlayerFlags(p,a,b)
  753. #else /* C++ */
  754. #define IDirectPlay3_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  755. #define IDirectPlay3_AddRef(p) (p)->AddRef()
  756. #define IDirectPlay3_Release(p) (p)->Release()
  757. #define IDirectPlay3_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b)
  758. #define IDirectPlay3_Close(p) (p)->Close()
  759. #define IDirectPlay3_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e)
  760. #define IDirectPlay3_CreatePlayer(p,a,b,c,d,e,f) (p)->CreatePlayer(a,b,c,d,e,f)
  761. #define IDirectPlay3_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b)
  762. #define IDirectPlay3_DestroyGroup(p,a) (p)->DestroyGroup(a)
  763. #define IDirectPlay3_DestroyPlayer(p,a) (p)->DestroyPlayer(a)
  764. #define IDirectPlay3_EnumGroupPlayers(p,a,b,c,d,e) (p)->EnumGroupPlayers(a,b,c,d,e)
  765. #define IDirectPlay3_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d)
  766. #define IDirectPlay3_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d)
  767. #define IDirectPlay3_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e)
  768. #define IDirectPlay3_GetCaps(p,a,b) (p)->GetCaps(a,b)
  769. #define IDirectPlay3_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b)
  770. #define IDirectPlay3_GetGroupData(p,a,b,c,d) (p)->GetGroupData(a,b,c,d)
  771. #define IDirectPlay3_GetGroupName(p,a,b,c) (p)->GetGroupName(a,b,c)
  772. #define IDirectPlay3_GetPlayerAddress(p,a,b,c) (p)->GetPlayerAddress(a,b,c)
  773. #define IDirectPlay3_GetPlayerCaps(p,a,b,c) (p)->GetPlayerCaps(a,b,c)
  774. #define IDirectPlay3_GetPlayerData(p,a,b,c,d) (p)->GetPlayerData(a,b,c,d)
  775. #define IDirectPlay3_GetPlayerName(p,a,b,c) (p)->GetPlayerName(a,b,c)
  776. #define IDirectPlay3_GetSessionDesc(p,a,b) (p)->GetSessionDesc(a,b)
  777. #define IDirectPlay3_Initialize(p,a) (p)->Initialize(a)
  778. #define IDirectPlay3_Open(p,a,b) (p)->Open(a,b)
  779. #define IDirectPlay3_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e)
  780. #define IDirectPlay3_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e)
  781. #define IDirectPlay3_SetGroupData(p,a,b,c,d) (p)->SetGroupData(a,b,c,d)
  782. #define IDirectPlay3_SetGroupName(p,a,b,c) (p)->SetGroupName(a,b,c)
  783. #define IDirectPlay3_SetPlayerData(p,a,b,c,d) (p)->SetPlayerData(a,b,c,d)
  784. #define IDirectPlay3_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c)
  785. #define IDirectPlay3_SetSessionDesc(p,a,b) (p)->SetSessionDesc(a,b)
  786. #define IDirectPlay3_AddGroupToGroup(p,a,b) (p)->AddGroupToGroup(a,b)
  787. #define IDirectPlay3_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->CreateGroupInGroup(a,b,c,d,e,f)
  788. #define IDirectPlay3_DeleteGroupFromGroup(p,a,b) (p)->DeleteGroupFromGroup(a,b)
  789. #define IDirectPlay3_EnumConnections(p,a,b,c,d) (p)->EnumConnections(a,b,c,d)
  790. #define IDirectPlay3_EnumGroupsInGroup(p,a,b,c,d,e) (p)->EnumGroupsInGroup(a,b,c,d,e)
  791. #define IDirectPlay3_GetGroupConnectionSettings(p,a,b,c,d) (p)->GetGroupConnectionSettings(a,b,c,d)
  792. #define IDirectPlay3_InitializeConnection(p,a,b) (p)->InitializeConnection(a,b)
  793. #define IDirectPlay3_SecureOpen(p,a,b,c,d) (p)->SecureOpen(a,b,c,d)
  794. #define IDirectPlay3_SendChatMessage(p,a,b,c,d) (p)->SendChatMessage(a,b,c,d)
  795. #define IDirectPlay3_SetGroupConnectionSettings(p,a,b,c) (p)->SetGroupConnectionSettings(a,b,c)
  796. #define IDirectPlay3_StartSession(p,a,b) (p)->StartSession(a,b)
  797. #define IDirectPlay3_GetGroupFlags(p,a,b) (p)->GetGroupFlags(a,b)
  798. #define IDirectPlay3_GetGroupParent(p,a,b) (p)->GetGroupParent(a,b)
  799. #define IDirectPlay3_GetPlayerAccount(p,a,b,c,d) (p)->GetPlayerAccount(a,b,c,d)
  800. #define IDirectPlay3_GetPlayerFlags(p,a,b) (p)->GetPlayerFlags(a,b)
  801. #endif
  802. /****************************************************************************
  803. *
  804. * IDirectPlay4 (and IDirectPlay4A) Interface
  805. *
  806. ****************************************************************************/
  807. #undef INTERFACE
  808. #define INTERFACE IDirectPlay4
  809. DECLARE_INTERFACE_( IDirectPlay4, IDirectPlay3 )
  810. {
  811. /*** IUnknown methods ***/
  812. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  813. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  814. STDMETHOD_(ULONG,Release) (THIS) PURE;
  815. /*** IDirectPlay2 methods ***/
  816. STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE;
  817. STDMETHOD(Close) (THIS) PURE;
  818. STDMETHOD(CreateGroup) (THIS_ LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE;
  819. STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPDPNAME,HANDLE,LPVOID,DWORD,DWORD) PURE;
  820. STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE;
  821. STDMETHOD(DestroyGroup) (THIS_ DPID) PURE;
  822. STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE;
  823. STDMETHOD(EnumGroupPlayers) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE;
  824. STDMETHOD(EnumGroups) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE;
  825. STDMETHOD(EnumPlayers) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE;
  826. STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC2,DWORD,LPDPENUMSESSIONSCALLBACK2,LPVOID,DWORD) PURE;
  827. STDMETHOD(GetCaps) (THIS_ LPDPCAPS,DWORD) PURE;
  828. STDMETHOD(GetGroupData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE;
  829. STDMETHOD(GetGroupName) (THIS_ DPID,LPVOID,LPDWORD) PURE;
  830. STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE;
  831. STDMETHOD(GetPlayerAddress) (THIS_ DPID,LPVOID,LPDWORD) PURE;
  832. STDMETHOD(GetPlayerCaps) (THIS_ DPID,LPDPCAPS,DWORD) PURE;
  833. STDMETHOD(GetPlayerData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE;
  834. STDMETHOD(GetPlayerName) (THIS_ DPID,LPVOID,LPDWORD) PURE;
  835. STDMETHOD(GetSessionDesc) (THIS_ LPVOID,LPDWORD) PURE;
  836. STDMETHOD(Initialize) (THIS_ LPGUID) PURE;
  837. STDMETHOD(Open) (THIS_ LPDPSESSIONDESC2,DWORD) PURE;
  838. STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE;
  839. STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE;
  840. STDMETHOD(SetGroupData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE;
  841. STDMETHOD(SetGroupName) (THIS_ DPID,LPDPNAME,DWORD) PURE;
  842. STDMETHOD(SetPlayerData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE;
  843. STDMETHOD(SetPlayerName) (THIS_ DPID,LPDPNAME,DWORD) PURE;
  844. STDMETHOD(SetSessionDesc) (THIS_ LPDPSESSIONDESC2,DWORD) PURE;
  845. /*** IDirectPlay3 methods ***/
  846. STDMETHOD(AddGroupToGroup) (THIS_ DPID, DPID) PURE;
  847. STDMETHOD(CreateGroupInGroup) (THIS_ DPID,LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE;
  848. STDMETHOD(DeleteGroupFromGroup) (THIS_ DPID,DPID) PURE;
  849. STDMETHOD(EnumConnections) (THIS_ LPCGUID,LPDPENUMCONNECTIONSCALLBACK,LPVOID,DWORD) PURE;
  850. STDMETHOD(EnumGroupsInGroup) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE;
  851. STDMETHOD(GetGroupConnectionSettings)(THIS_ DWORD, DPID, LPVOID, LPDWORD) PURE;
  852. STDMETHOD(InitializeConnection) (THIS_ LPVOID,DWORD) PURE;
  853. STDMETHOD(SecureOpen) (THIS_ LPCDPSESSIONDESC2,DWORD,LPCDPSECURITYDESC,LPCDPCREDENTIALS) PURE;
  854. STDMETHOD(SendChatMessage) (THIS_ DPID,DPID,DWORD,LPDPCHAT) PURE;
  855. STDMETHOD(SetGroupConnectionSettings)(THIS_ DWORD,DPID,LPDPLCONNECTION) PURE;
  856. STDMETHOD(StartSession) (THIS_ DWORD,DPID) PURE;
  857. STDMETHOD(GetGroupFlags) (THIS_ DPID,LPDWORD) PURE;
  858. STDMETHOD(GetGroupParent) (THIS_ DPID,LPDPID) PURE;
  859. STDMETHOD(GetPlayerAccount) (THIS_ DPID, DWORD, LPVOID, LPDWORD) PURE;
  860. STDMETHOD(GetPlayerFlags) (THIS_ DPID,LPDWORD) PURE;
  861. /*** IDirectPlay4 methods ***/
  862. STDMETHOD(GetGroupOwner) (THIS_ DPID, LPDPID) PURE;
  863. STDMETHOD(SetGroupOwner) (THIS_ DPID, DPID) PURE;
  864. STDMETHOD(SendEx) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD, DWORD, DWORD, LPVOID, DWORD_PTR *) PURE;
  865. STDMETHOD(GetMessageQueue) (THIS_ DPID, DPID, DWORD, LPDWORD, LPDWORD) PURE;
  866. STDMETHOD(CancelMessage) (THIS_ DWORD, DWORD) PURE;
  867. STDMETHOD(CancelPriority) (THIS_ DWORD, DWORD, DWORD) PURE;
  868. };
  869. /****************************************************************************
  870. *
  871. * IDirectPlayX interface macros (for IDirectPlay4 and beyond)
  872. *
  873. ****************************************************************************/
  874. #if !defined(__cplusplus) || defined(CINTERFACE)
  875. #define IDirectPlayX_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  876. #define IDirectPlayX_AddRef(p) (p)->lpVtbl->AddRef(p)
  877. #define IDirectPlayX_Release(p) (p)->lpVtbl->Release(p)
  878. #define IDirectPlayX_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b)
  879. #define IDirectPlayX_CancelMessage(p,a,b) (p)->lpVtbl->CancelMessage(p,a,b)
  880. #define IDirectPlayX_CancelPriority(p,a,b,c) (p)->lpVtbl->CancelPriority(p,a,b,c)
  881. #define IDirectPlayX_Close(p) (p)->lpVtbl->Close(p)
  882. #define IDirectPlayX_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e)
  883. #define IDirectPlayX_CreatePlayer(p,a,b,c,d,e,f) (p)->lpVtbl->CreatePlayer(p,a,b,c,d,e,f)
  884. #define IDirectPlayX_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b)
  885. #define IDirectPlayX_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a)
  886. #define IDirectPlayX_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a)
  887. #define IDirectPlayX_EnumGroupPlayers(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d,e)
  888. #define IDirectPlayX_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d)
  889. #define IDirectPlayX_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d)
  890. #define IDirectPlayX_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e)
  891. #define IDirectPlayX_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b)
  892. #define IDirectPlayX_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b)
  893. #define IDirectPlayX_GetMessageQueue(p,a,b,c,d,e) (p)->lpVtbl->GetMessageQueue(p,a,b,c,d,e)
  894. #define IDirectPlayX_GetGroupData(p,a,b,c,d) (p)->lpVtbl->GetGroupData(p,a,b,c,d)
  895. #define IDirectPlayX_GetGroupName(p,a,b,c) (p)->lpVtbl->GetGroupName(p,a,b,c)
  896. #define IDirectPlayX_GetPlayerAddress(p,a,b,c) (p)->lpVtbl->GetPlayerAddress(p,a,b,c)
  897. #define IDirectPlayX_GetPlayerCaps(p,a,b,c) (p)->lpVtbl->GetPlayerCaps(p,a,b,c)
  898. #define IDirectPlayX_GetPlayerData(p,a,b,c,d) (p)->lpVtbl->GetPlayerData(p,a,b,c,d)
  899. #define IDirectPlayX_GetPlayerName(p,a,b,c) (p)->lpVtbl->GetPlayerName(p,a,b,c)
  900. #define IDirectPlayX_GetSessionDesc(p,a,b) (p)->lpVtbl->GetSessionDesc(p,a,b)
  901. #define IDirectPlayX_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
  902. #define IDirectPlayX_Open(p,a,b) (p)->lpVtbl->Open(p,a,b)
  903. #define IDirectPlayX_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e)
  904. #define IDirectPlayX_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e)
  905. #define IDirectPlayX_SendEx(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->SendEx(p,a,b,c,d,e,f,g,h,i)
  906. #define IDirectPlayX_SetGroupData(p,a,b,c,d) (p)->lpVtbl->SetGroupData(p,a,b,c,d)
  907. #define IDirectPlayX_SetGroupName(p,a,b,c) (p)->lpVtbl->SetGroupName(p,a,b,c)
  908. #define IDirectPlayX_SetPlayerData(p,a,b,c,d) (p)->lpVtbl->SetPlayerData(p,a,b,c,d)
  909. #define IDirectPlayX_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c)
  910. #define IDirectPlayX_SetSessionDesc(p,a,b) (p)->lpVtbl->SetSessionDesc(p,a,b)
  911. #define IDirectPlayX_AddGroupToGroup(p,a,b) (p)->lpVtbl->AddGroupToGroup(p,a,b)
  912. #define IDirectPlayX_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->lpVtbl->CreateGroupInGroup(p,a,b,c,d,e,f)
  913. #define IDirectPlayX_DeleteGroupFromGroup(p,a,b) (p)->lpVtbl->DeleteGroupFromGroup(p,a,b)
  914. #define IDirectPlayX_EnumConnections(p,a,b,c,d) (p)->lpVtbl->EnumConnections(p,a,b,c,d)
  915. #define IDirectPlayX_EnumGroupsInGroup(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupsInGroup(p,a,b,c,d,e)
  916. #define IDirectPlayX_GetGroupConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetGroupConnectionSettings(p,a,b,c,d)
  917. #define IDirectPlayX_InitializeConnection(p,a,b) (p)->lpVtbl->InitializeConnection(p,a,b)
  918. #define IDirectPlayX_SecureOpen(p,a,b,c,d) (p)->lpVtbl->SecureOpen(p,a,b,c,d)
  919. #define IDirectPlayX_SendChatMessage(p,a,b,c,d) (p)->lpVtbl->SendChatMessage(p,a,b,c,d)
  920. #define IDirectPlayX_SetGroupConnectionSettings(p,a,b,c) (p)->lpVtbl->SetGroupConnectionSettings(p,a,b,c)
  921. #define IDirectPlayX_StartSession(p,a,b) (p)->lpVtbl->StartSession(p,a,b)
  922. #define IDirectPlayX_GetGroupFlags(p,a,b) (p)->lpVtbl->GetGroupFlags(p,a,b)
  923. #define IDirectPlayX_GetGroupParent(p,a,b) (p)->lpVtbl->GetGroupParent(p,a,b)
  924. #define IDirectPlayX_GetPlayerAccount(p,a,b,c,d) (p)->lpVtbl->GetPlayerAccount(p,a,b,c,d)
  925. #define IDirectPlayX_GetPlayerFlags(p,a,b) (p)->lpVtbl->GetPlayerFlags(p,a,b)
  926. #define IDirectPlayX_GetGroupOwner(p,a,b) (p)->lpVtbl->GetGroupOwner(p,a,b)
  927. #define IDirectPlayX_SetGroupOwner(p,a,b) (p)->lpVtbl->SetGroupOwner(p,a,b)
  928. #else /* C++ */
  929. #define IDirectPlayX_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  930. #define IDirectPlayX_AddRef(p) (p)->AddRef()
  931. #define IDirectPlayX_Release(p) (p)->Release()
  932. #define IDirectPlayX_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b)
  933. #define IDirectPlayX_CancelMessage(p,a,b) (p)->CancelMessage(a,b)
  934. #define IDirectPlayX_CancelPriority(p,a,b,c) (p)->CancelPriority(a,b,c)
  935. #define IDirectPlayX_Close(p) (p)->Close()
  936. #define IDirectPlayX_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e)
  937. #define IDirectPlayX_CreatePlayer(p,a,b,c,d,e,f) (p)->CreatePlayer(a,b,c,d,e,f)
  938. #define IDirectPlayX_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b)
  939. #define IDirectPlayX_DestroyGroup(p,a) (p)->DestroyGroup(a)
  940. #define IDirectPlayX_DestroyPlayer(p,a) (p)->DestroyPlayer(a)
  941. #define IDirectPlayX_EnumGroupPlayers(p,a,b,c,d,e) (p)->EnumGroupPlayers(a,b,c,d,e)
  942. #define IDirectPlayX_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d)
  943. #define IDirectPlayX_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d)
  944. #define IDirectPlayX_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e)
  945. #define IDirectPlayX_GetCaps(p,a,b) (p)->GetCaps(a,b)
  946. #define IDirectPlayX_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b)
  947. #define IDirectPlayX_GetMessageQueue(p,a,b,c,d,e) (p)->GetMessageQueue(a,b,c,d,e)
  948. #define IDirectPlayX_GetGroupData(p,a,b,c,d) (p)->GetGroupData(a,b,c,d)
  949. #define IDirectPlayX_GetGroupName(p,a,b,c) (p)->GetGroupName(a,b,c)
  950. #define IDirectPlayX_GetPlayerAddress(p,a,b,c) (p)->GetPlayerAddress(a,b,c)
  951. #define IDirectPlayX_GetPlayerCaps(p,a,b,c) (p)->GetPlayerCaps(a,b,c)
  952. #define IDirectPlayX_GetPlayerData(p,a,b,c,d) (p)->GetPlayerData(a,b,c,d)
  953. #define IDirectPlayX_GetPlayerName(p,a,b,c) (p)->GetPlayerName(a,b,c)
  954. #define IDirectPlayX_GetSessionDesc(p,a,b) (p)->GetSessionDesc(a,b)
  955. #define IDirectPlayX_Initialize(p,a) (p)->Initialize(a)
  956. #define IDirectPlayX_Open(p,a,b) (p)->Open(a,b)
  957. #define IDirectPlayX_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e)
  958. #define IDirectPlayX_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e)
  959. #define IDirectPlayX_SendEx(p,a,b,c,d,e,f,g,h,i) (p)->SendEx(a,b,c,d,e,f,g,h,i)
  960. #define IDirectPlayX_SetGroupData(p,a,b,c,d) (p)->SetGroupData(a,b,c,d)
  961. #define IDirectPlayX_SetGroupName(p,a,b,c) (p)->SetGroupName(a,b,c)
  962. #define IDirectPlayX_SetPlayerData(p,a,b,c,d) (p)->SetPlayerData(a,b,c,d)
  963. #define IDirectPlayX_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c)
  964. #define IDirectPlayX_SetSessionDesc(p,a,b) (p)->SetSessionDesc(a,b)
  965. #define IDirectPlayX_AddGroupToGroup(p,a,b) (p)->AddGroupToGroup(a,b)
  966. #define IDirectPlayX_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->CreateGroupInGroup(a,b,c,d,e,f)
  967. #define IDirectPlayX_DeleteGroupFromGroup(p,a,b) (p)->DeleteGroupFromGroup(a,b)
  968. #define IDirectPlayX_EnumConnections(p,a,b,c,d) (p)->EnumConnections(a,b,c,d)
  969. #define IDirectPlayX_EnumGroupsInGroup(p,a,b,c,d,e) (p)->EnumGroupsInGroup(a,b,c,d,e)
  970. #define IDirectPlayX_GetGroupConnectionSettings(p,a,b,c,d) (p)->GetGroupConnectionSettings(a,b,c,d)
  971. #define IDirectPlayX_InitializeConnection(p,a,b) (p)->InitializeConnection(a,b)
  972. #define IDirectPlayX_SecureOpen(p,a,b,c,d) (p)->SecureOpen(a,b,c,d)
  973. #define IDirectPlayX_SendChatMessage(p,a,b,c,d) (p)->SendChatMessage(a,b,c,d)
  974. #define IDirectPlayX_SetGroupConnectionSettings(p,a,b,c) (p)->SetGroupConnectionSettings(a,b,c)
  975. #define IDirectPlayX_StartSession(p,a,b) (p)->StartSession(a,b)
  976. #define IDirectPlayX_GetGroupFlags(p,a,b) (p)->GetGroupFlags(a,b)
  977. #define IDirectPlayX_GetGroupParent(p,a,b) (p)->GetGroupParent(a,b)
  978. #define IDirectPlayX_GetPlayerAccount(p,a,b,c,d) (p)->GetPlayerAccount(a,b,c,d)
  979. #define IDirectPlayX_GetPlayerFlags(p,a,b) (p)->GetPlayerFlags(a,b)
  980. #define IDirectPlayX_GetGroupOwner(p,a,b) (p)->GetGroupOwner(a,b)
  981. #define IDirectPlayX_SetGroupOwner(p,a,b) (p)->SetGroupOwner(a,b)
  982. #endif
  983. /****************************************************************************
  984. *
  985. * EnumConnections API flags
  986. *
  987. ****************************************************************************/
  988. /*
  989. * Enumerate Service Providers
  990. */
  991. #define DPCONNECTION_DIRECTPLAY 0x00000001
  992. /*
  993. * Enumerate Lobby Providers
  994. */
  995. #define DPCONNECTION_DIRECTPLAYLOBBY 0x00000002
  996. /****************************************************************************
  997. *
  998. * EnumPlayers API flags
  999. *
  1000. ****************************************************************************/
  1001. /*
  1002. * Enumerate all players in the current session
  1003. */
  1004. #define DPENUMPLAYERS_ALL 0x00000000
  1005. #define DPENUMGROUPS_ALL DPENUMPLAYERS_ALL
  1006. /*
  1007. * Enumerate only local (created by this application) players
  1008. * or groups
  1009. */
  1010. #define DPENUMPLAYERS_LOCAL 0x00000008
  1011. #define DPENUMGROUPS_LOCAL DPENUMPLAYERS_LOCAL
  1012. /*
  1013. * Enumerate only remote (non-local) players
  1014. * or groups
  1015. */
  1016. #define DPENUMPLAYERS_REMOTE 0x00000010
  1017. #define DPENUMGROUPS_REMOTE DPENUMPLAYERS_REMOTE
  1018. /*
  1019. * Enumerate groups along with the players
  1020. */
  1021. #define DPENUMPLAYERS_GROUP 0x00000020
  1022. /*
  1023. * Enumerate players or groups in another session
  1024. * (must supply lpguidInstance)
  1025. */
  1026. #define DPENUMPLAYERS_SESSION 0x00000080
  1027. #define DPENUMGROUPS_SESSION DPENUMPLAYERS_SESSION
  1028. /*
  1029. * Enumerate server players
  1030. */
  1031. #define DPENUMPLAYERS_SERVERPLAYER 0x00000100
  1032. /*
  1033. * Enumerate spectator players
  1034. */
  1035. #define DPENUMPLAYERS_SPECTATOR 0x00000200
  1036. /*
  1037. * Enumerate shortcut groups
  1038. */
  1039. #define DPENUMGROUPS_SHORTCUT 0x00000400
  1040. /*
  1041. * Enumerate staging area groups
  1042. */
  1043. #define DPENUMGROUPS_STAGINGAREA 0x00000800
  1044. /*
  1045. * Enumerate hidden groups
  1046. */
  1047. #define DPENUMGROUPS_HIDDEN 0x00001000
  1048. /*
  1049. * Enumerate the group's owner
  1050. */
  1051. #define DPENUMPLAYERS_OWNER 0x00002000
  1052. /****************************************************************************
  1053. *
  1054. * CreatePlayer API flags
  1055. *
  1056. ****************************************************************************/
  1057. /*
  1058. * This flag indicates that this player should be designated
  1059. * the server player. The app should specify this at CreatePlayer.
  1060. */
  1061. #define DPPLAYER_SERVERPLAYER DPENUMPLAYERS_SERVERPLAYER
  1062. /*
  1063. * This flag indicates that this player should be designated
  1064. * a spectator. The app should specify this at CreatePlayer.
  1065. */
  1066. #define DPPLAYER_SPECTATOR DPENUMPLAYERS_SPECTATOR
  1067. /*
  1068. * This flag indicates that this player was created locally.
  1069. * (returned from GetPlayerFlags)
  1070. */
  1071. #define DPPLAYER_LOCAL DPENUMPLAYERS_LOCAL
  1072. /*
  1073. * This flag indicates that this player is the group's owner
  1074. * (Only returned in EnumGroupPlayers)
  1075. */
  1076. #define DPPLAYER_OWNER DPENUMPLAYERS_OWNER
  1077. /****************************************************************************
  1078. *
  1079. * CreateGroup API flags
  1080. *
  1081. ****************************************************************************/
  1082. /*
  1083. * This flag indicates that the StartSession can be called on the group.
  1084. * The app should specify this at CreateGroup, or CreateGroupInGroup.
  1085. */
  1086. #define DPGROUP_STAGINGAREA DPENUMGROUPS_STAGINGAREA
  1087. /*
  1088. * This flag indicates that this group was created locally.
  1089. * (returned from GetGroupFlags)
  1090. */
  1091. #define DPGROUP_LOCAL DPENUMGROUPS_LOCAL
  1092. /*
  1093. * This flag indicates that this group was created hidden.
  1094. */
  1095. #define DPGROUP_HIDDEN DPENUMGROUPS_HIDDEN
  1096. /****************************************************************************
  1097. *
  1098. * EnumSessions API flags
  1099. *
  1100. ****************************************************************************/
  1101. /*
  1102. * Enumerate sessions which can be joined
  1103. */
  1104. #define DPENUMSESSIONS_AVAILABLE 0x00000001
  1105. /*
  1106. * Enumerate all sessions even if they can't be joined.
  1107. */
  1108. #define DPENUMSESSIONS_ALL 0x00000002
  1109. /*
  1110. * Start an asynchronous enum sessions
  1111. */
  1112. #define DPENUMSESSIONS_ASYNC 0x00000010
  1113. /*
  1114. * Stop an asynchronous enum sessions
  1115. */
  1116. #define DPENUMSESSIONS_STOPASYNC 0x00000020
  1117. /*
  1118. * Enumerate sessions even if they require a password
  1119. */
  1120. #define DPENUMSESSIONS_PASSWORDREQUIRED 0x00000040
  1121. /*
  1122. * Return status about progress of enumeration instead of
  1123. * showing any status dialogs.
  1124. */
  1125. #define DPENUMSESSIONS_RETURNSTATUS 0x00000080
  1126. /****************************************************************************
  1127. *
  1128. * GetCaps and GetPlayerCaps API flags
  1129. *
  1130. ****************************************************************************/
  1131. /*
  1132. * The latency returned should be for guaranteed message sending.
  1133. * Default is non-guaranteed messaging.
  1134. */
  1135. #define DPGETCAPS_GUARANTEED 0x00000001
  1136. /****************************************************************************
  1137. *
  1138. * GetGroupData, GetPlayerData API flags
  1139. * Remote and local Group/Player data is maintained separately.
  1140. * Default is DPGET_REMOTE.
  1141. *
  1142. ****************************************************************************/
  1143. /*
  1144. * Get the remote data (set by any DirectPlay object in
  1145. * the session using DPSET_REMOTE)
  1146. */
  1147. #define DPGET_REMOTE 0x00000000
  1148. /*
  1149. * Get the local data (set by this DirectPlay object
  1150. * using DPSET_LOCAL)
  1151. */
  1152. #define DPGET_LOCAL 0x00000001
  1153. /****************************************************************************
  1154. *
  1155. * Open API flags
  1156. *
  1157. ****************************************************************************/
  1158. /*
  1159. * Join the session that is described by the DPSESSIONDESC2 structure
  1160. */
  1161. #define DPOPEN_JOIN 0x00000001
  1162. /*
  1163. * Create a new session as described by the DPSESSIONDESC2 structure
  1164. */
  1165. #define DPOPEN_CREATE 0x00000002
  1166. /*
  1167. * Return status about progress of open instead of showing
  1168. * any status dialogs.
  1169. */
  1170. #define DPOPEN_RETURNSTATUS DPENUMSESSIONS_RETURNSTATUS
  1171. /****************************************************************************
  1172. *
  1173. * DPLCONNECTION flags
  1174. *
  1175. ****************************************************************************/
  1176. /*
  1177. * This application should create a new session as
  1178. * described by the DPSESIONDESC structure
  1179. */
  1180. #define DPLCONNECTION_CREATESESSION DPOPEN_CREATE
  1181. /*
  1182. * This application should join the session described by
  1183. * the DPSESIONDESC structure with the lpAddress data
  1184. */
  1185. #define DPLCONNECTION_JOINSESSION DPOPEN_JOIN
  1186. /****************************************************************************
  1187. *
  1188. * Receive API flags
  1189. * Default is DPRECEIVE_ALL
  1190. *
  1191. ****************************************************************************/
  1192. /*
  1193. * Get the first message in the queue
  1194. */
  1195. #define DPRECEIVE_ALL 0x00000001
  1196. /*
  1197. * Get the first message in the queue directed to a specific player
  1198. */
  1199. #define DPRECEIVE_TOPLAYER 0x00000002
  1200. /*
  1201. * Get the first message in the queue from a specific player
  1202. */
  1203. #define DPRECEIVE_FROMPLAYER 0x00000004
  1204. /*
  1205. * Get the message but don't remove it from the queue
  1206. */
  1207. #define DPRECEIVE_PEEK 0x00000008
  1208. /****************************************************************************
  1209. *
  1210. * Send API flags
  1211. *
  1212. ****************************************************************************/
  1213. /*
  1214. * Send the message using a guaranteed send method.
  1215. * Default is non-guaranteed.
  1216. */
  1217. #define DPSEND_GUARANTEED 0x00000001
  1218. /*
  1219. * This flag is obsolete. It is ignored by DirectPlay
  1220. */
  1221. #define DPSEND_HIGHPRIORITY 0x00000002
  1222. /*
  1223. * This flag is obsolete. It is ignored by DirectPlay
  1224. */
  1225. #define DPSEND_OPENSTREAM 0x00000008
  1226. /*
  1227. * This flag is obsolete. It is ignored by DirectPlay
  1228. */
  1229. #define DPSEND_CLOSESTREAM 0x00000010
  1230. /*
  1231. * Send the message digitally signed to ensure authenticity.
  1232. */
  1233. #define DPSEND_SIGNED 0x00000020
  1234. /*
  1235. * Send the message with encryption to ensure privacy.
  1236. */
  1237. #define DPSEND_ENCRYPTED 0x00000040
  1238. /*
  1239. * The message is a lobby system message
  1240. */
  1241. #define DPSEND_LOBBYSYSTEMMESSAGE 0x00000080
  1242. /*
  1243. * Send message asynchronously, must check caps
  1244. * before using this flag. It is always provided
  1245. * if the protocol flag is set.
  1246. */
  1247. #define DPSEND_ASYNC 0x00000200
  1248. /*
  1249. * When an message is completed, don't tell me.
  1250. * by default the application is notified with a system message.
  1251. */
  1252. #define DPSEND_NOSENDCOMPLETEMSG 0x00000400
  1253. /*
  1254. * Maximum priority for sends available to applications
  1255. */
  1256. #define DPSEND_MAX_PRI 0x0000FFFF
  1257. #define DPSEND_MAX_PRIORITY DPSEND_MAX_PRI
  1258. /****************************************************************************
  1259. *
  1260. * SetGroupData, SetGroupName, SetPlayerData, SetPlayerName,
  1261. * SetSessionDesc API flags.
  1262. * Default is DPSET_REMOTE.
  1263. *
  1264. ****************************************************************************/
  1265. /*
  1266. * Propagate the data to all players in the session
  1267. */
  1268. #define DPSET_REMOTE 0x00000000
  1269. /*
  1270. * Do not propagate the data to other players
  1271. */
  1272. #define DPSET_LOCAL 0x00000001
  1273. /*
  1274. * Used with DPSET_REMOTE, use guaranteed message send to
  1275. * propagate the data
  1276. */
  1277. #define DPSET_GUARANTEED 0x00000002
  1278. /****************************************************************************
  1279. *
  1280. * GetMessageQueue API flags.
  1281. * Default is DPMESSAGEQUEUE_SEND
  1282. *
  1283. ****************************************************************************/
  1284. /*
  1285. * Get Send Queue - requires Service Provider Support
  1286. */
  1287. #define DPMESSAGEQUEUE_SEND 0x00000001
  1288. /*
  1289. * Get Receive Queue
  1290. */
  1291. #define DPMESSAGEQUEUE_RECEIVE 0x00000002
  1292. /****************************************************************************
  1293. *
  1294. * Connect API flags
  1295. *
  1296. ****************************************************************************/
  1297. /*
  1298. * Start an asynchronous connect which returns status codes
  1299. */
  1300. #define DPCONNECT_RETURNSTATUS (DPENUMSESSIONS_RETURNSTATUS)
  1301. /****************************************************************************
  1302. *
  1303. * DirectPlay system messages and message data structures
  1304. *
  1305. * All system message come 'From' player DPID_SYSMSG. To determine what type
  1306. * of message it is, cast the lpData from Receive to DPMSG_GENERIC and check
  1307. * the dwType member against one of the following DPSYS_xxx constants. Once
  1308. * a match is found, cast the lpData to the corresponding of the DPMSG_xxx
  1309. * structures to access the data of the message.
  1310. *
  1311. ****************************************************************************/
  1312. /*
  1313. * A new player or group has been created in the session
  1314. * Use DPMSG_CREATEPLAYERORGROUP. Check dwPlayerType to see if it
  1315. * is a player or a group.
  1316. */
  1317. #define DPSYS_CREATEPLAYERORGROUP 0x0003
  1318. /*
  1319. * A player has been deleted from the session
  1320. * Use DPMSG_DESTROYPLAYERORGROUP
  1321. */
  1322. #define DPSYS_DESTROYPLAYERORGROUP 0x0005
  1323. /*
  1324. * A player has been added to a group
  1325. * Use DPMSG_ADDPLAYERTOGROUP
  1326. */
  1327. #define DPSYS_ADDPLAYERTOGROUP 0x0007
  1328. /*
  1329. * A player has been removed from a group
  1330. * Use DPMSG_DELETEPLAYERFROMGROUP
  1331. */
  1332. #define DPSYS_DELETEPLAYERFROMGROUP 0x0021
  1333. /*
  1334. * This DirectPlay object lost its connection with all the
  1335. * other players in the session.
  1336. * Use DPMSG_SESSIONLOST.
  1337. */
  1338. #define DPSYS_SESSIONLOST 0x0031
  1339. /*
  1340. * The current host has left the session.
  1341. * This DirectPlay object is now the host.
  1342. * Use DPMSG_HOST.
  1343. */
  1344. #define DPSYS_HOST 0x0101
  1345. /*
  1346. * The remote data associated with a player or
  1347. * group has changed. Check dwPlayerType to see
  1348. * if it is a player or a group
  1349. * Use DPMSG_SETPLAYERORGROUPDATA
  1350. */
  1351. #define DPSYS_SETPLAYERORGROUPDATA 0x0102
  1352. /*
  1353. * The name of a player or group has changed.
  1354. * Check dwPlayerType to see if it is a player
  1355. * or a group.
  1356. * Use DPMSG_SETPLAYERORGROUPNAME
  1357. */
  1358. #define DPSYS_SETPLAYERORGROUPNAME 0x0103
  1359. /*
  1360. * The session description has changed.
  1361. * Use DPMSG_SETSESSIONDESC
  1362. */
  1363. #define DPSYS_SETSESSIONDESC 0x0104
  1364. /*
  1365. * A group has been added to a group
  1366. * Use DPMSG_ADDGROUPTOGROUP
  1367. */
  1368. #define DPSYS_ADDGROUPTOGROUP 0x0105
  1369. /*
  1370. * A group has been removed from a group
  1371. * Use DPMSG_DELETEGROUPFROMGROUP
  1372. */
  1373. #define DPSYS_DELETEGROUPFROMGROUP 0x0106
  1374. /*
  1375. * A secure player-player message has arrived.
  1376. * Use DPMSG_SECUREMESSAGE
  1377. */
  1378. #define DPSYS_SECUREMESSAGE 0x0107
  1379. /*
  1380. * Start a new session.
  1381. * Use DPMSG_STARTSESSION
  1382. */
  1383. #define DPSYS_STARTSESSION 0x0108
  1384. /*
  1385. * A chat message has arrived
  1386. * Use DPMSG_CHAT
  1387. */
  1388. #define DPSYS_CHAT 0x0109
  1389. /*
  1390. * The owner of a group has changed
  1391. * Use DPMSG_SETGROUPOWNER
  1392. */
  1393. #define DPSYS_SETGROUPOWNER 0x010A
  1394. /*
  1395. * An async send has finished, failed or been cancelled
  1396. * Use DPMSG_SENDCOMPLETE
  1397. */
  1398. #define DPSYS_SENDCOMPLETE 0x010d
  1399. /*
  1400. * Used in the dwPlayerType field to indicate if it applies to a group
  1401. * or a player
  1402. */
  1403. #define DPPLAYERTYPE_GROUP 0x00000000
  1404. #define DPPLAYERTYPE_PLAYER 0x00000001
  1405. /*
  1406. * DPMSG_GENERIC
  1407. * Generic message structure used to identify the message type.
  1408. */
  1409. typedef struct
  1410. {
  1411. DWORD dwType; // Message type
  1412. } DPMSG_GENERIC, FAR *LPDPMSG_GENERIC;
  1413. /*
  1414. * DPMSG_CREATEPLAYERORGROUP
  1415. * System message generated when a new player or group
  1416. * created in the session with information about it.
  1417. */
  1418. typedef struct
  1419. {
  1420. DWORD dwType; // Message type
  1421. DWORD dwPlayerType; // Is it a player or group
  1422. DPID dpId; // ID of the player or group
  1423. DWORD dwCurrentPlayers; // current # players & groups in session
  1424. LPVOID lpData; // pointer to remote data
  1425. DWORD dwDataSize; // size of remote data
  1426. DPNAME dpnName; // structure with name info
  1427. // the following fields are only available when using
  1428. // the IDirectPlay3 interface or greater
  1429. DPID dpIdParent; // id of parent group
  1430. DWORD dwFlags; // player or group flags
  1431. } DPMSG_CREATEPLAYERORGROUP, FAR *LPDPMSG_CREATEPLAYERORGROUP;
  1432. /*
  1433. * DPMSG_DESTROYPLAYERORGROUP
  1434. * System message generated when a player or group is being
  1435. * destroyed in the session with information about it.
  1436. */
  1437. typedef struct
  1438. {
  1439. DWORD dwType; // Message type
  1440. DWORD dwPlayerType; // Is it a player or group
  1441. DPID dpId; // player ID being deleted
  1442. LPVOID lpLocalData; // copy of players local data
  1443. DWORD dwLocalDataSize; // sizeof local data
  1444. LPVOID lpRemoteData; // copy of players remote data
  1445. DWORD dwRemoteDataSize; // sizeof remote data
  1446. // the following fields are only available when using
  1447. // the IDirectPlay3 interface or greater
  1448. DPNAME dpnName; // structure with name info
  1449. DPID dpIdParent; // id of parent group
  1450. DWORD dwFlags; // player or group flags
  1451. } DPMSG_DESTROYPLAYERORGROUP, FAR *LPDPMSG_DESTROYPLAYERORGROUP;
  1452. /*
  1453. * DPMSG_ADDPLAYERTOGROUP
  1454. * System message generated when a player is being added
  1455. * to a group.
  1456. */
  1457. typedef struct
  1458. {
  1459. DWORD dwType; // Message type
  1460. DPID dpIdGroup; // group ID being added to
  1461. DPID dpIdPlayer; // player ID being added
  1462. } DPMSG_ADDPLAYERTOGROUP, FAR *LPDPMSG_ADDPLAYERTOGROUP;
  1463. /*
  1464. * DPMSG_DELETEPLAYERFROMGROUP
  1465. * System message generated when a player is being
  1466. * removed from a group
  1467. */
  1468. typedef DPMSG_ADDPLAYERTOGROUP DPMSG_DELETEPLAYERFROMGROUP;
  1469. typedef DPMSG_DELETEPLAYERFROMGROUP FAR *LPDPMSG_DELETEPLAYERFROMGROUP;
  1470. /*
  1471. * DPMSG_ADDGROUPTOGROUP
  1472. * System message generated when a group is being added
  1473. * to a group.
  1474. */
  1475. typedef struct
  1476. {
  1477. DWORD dwType; // Message type
  1478. DPID dpIdParentGroup; // group ID being added to
  1479. DPID dpIdGroup; // group ID being added
  1480. } DPMSG_ADDGROUPTOGROUP, FAR *LPDPMSG_ADDGROUPTOGROUP;
  1481. /*
  1482. * DPMSG_DELETEGROUPFROMGROUP
  1483. * System message generated when a GROUP is being
  1484. * removed from a group
  1485. */
  1486. typedef DPMSG_ADDGROUPTOGROUP DPMSG_DELETEGROUPFROMGROUP;
  1487. typedef DPMSG_DELETEGROUPFROMGROUP FAR *LPDPMSG_DELETEGROUPFROMGROUP;
  1488. /*
  1489. * DPMSG_SETPLAYERORGROUPDATA
  1490. * System message generated when remote data for a player or
  1491. * group has changed.
  1492. */
  1493. typedef struct
  1494. {
  1495. DWORD dwType; // Message type
  1496. DWORD dwPlayerType; // Is it a player or group
  1497. DPID dpId; // ID of player or group
  1498. LPVOID lpData; // pointer to remote data
  1499. DWORD dwDataSize; // size of remote data
  1500. } DPMSG_SETPLAYERORGROUPDATA, FAR *LPDPMSG_SETPLAYERORGROUPDATA;
  1501. /*
  1502. * DPMSG_SETPLAYERORGROUPNAME
  1503. * System message generated when the name of a player or
  1504. * group has changed.
  1505. */
  1506. typedef struct
  1507. {
  1508. DWORD dwType; // Message type
  1509. DWORD dwPlayerType; // Is it a player or group
  1510. DPID dpId; // ID of player or group
  1511. DPNAME dpnName; // structure with new name info
  1512. } DPMSG_SETPLAYERORGROUPNAME, FAR *LPDPMSG_SETPLAYERORGROUPNAME;
  1513. /*
  1514. * DPMSG_SETSESSIONDESC
  1515. * System message generated when session desc has changed
  1516. */
  1517. typedef struct
  1518. {
  1519. DWORD dwType; // Message type
  1520. DPSESSIONDESC2 dpDesc; // Session desc
  1521. } DPMSG_SETSESSIONDESC, FAR *LPDPMSG_SETSESSIONDESC;
  1522. /*
  1523. * DPMSG_HOST
  1524. * System message generated when the host has migrated to this
  1525. * DirectPlay object.
  1526. *
  1527. */
  1528. typedef DPMSG_GENERIC DPMSG_HOST;
  1529. typedef DPMSG_HOST FAR *LPDPMSG_HOST;
  1530. /*
  1531. * DPMSG_SESSIONLOST
  1532. * System message generated when the connection to the session is lost.
  1533. *
  1534. */
  1535. typedef DPMSG_GENERIC DPMSG_SESSIONLOST;
  1536. typedef DPMSG_SESSIONLOST FAR *LPDPMSG_SESSIONLOST;
  1537. /*
  1538. * DPMSG_SECUREMESSAGE
  1539. * System message generated when a player requests a secure send
  1540. */
  1541. typedef struct
  1542. {
  1543. DWORD dwType; // Message Type
  1544. DWORD dwFlags; // Signed/Encrypted
  1545. DPID dpIdFrom; // ID of Sending Player
  1546. LPVOID lpData; // Player message
  1547. DWORD dwDataSize; // Size of player message
  1548. } DPMSG_SECUREMESSAGE, FAR *LPDPMSG_SECUREMESSAGE;
  1549. /*
  1550. * DPMSG_STARTSESSION
  1551. * System message containing all information required to
  1552. * start a new session
  1553. */
  1554. typedef struct
  1555. {
  1556. DWORD dwType; // Message type
  1557. LPDPLCONNECTION lpConn; // DPLCONNECTION structure
  1558. } DPMSG_STARTSESSION, FAR *LPDPMSG_STARTSESSION;
  1559. /*
  1560. * DPMSG_CHAT
  1561. * System message containing a chat message
  1562. */
  1563. typedef struct
  1564. {
  1565. DWORD dwType; // Message type
  1566. DWORD dwFlags; // Message flags
  1567. DPID idFromPlayer; // ID of the Sending Player
  1568. DPID idToPlayer; // ID of the To Player
  1569. DPID idToGroup; // ID of the To Group
  1570. LPDPCHAT lpChat; // Pointer to a structure containing the chat message
  1571. } DPMSG_CHAT, FAR *LPDPMSG_CHAT;
  1572. /*
  1573. * DPMSG_SETGROUPOWNER
  1574. * System message generated when the owner of a group has changed
  1575. */
  1576. typedef struct
  1577. {
  1578. DWORD dwType; // Message type
  1579. DPID idGroup; // ID of the group
  1580. DPID idNewOwner; // ID of the player that is the new owner
  1581. DPID idOldOwner; // ID of the player that used to be the owner
  1582. } DPMSG_SETGROUPOWNER, FAR *LPDPMSG_SETGROUPOWNER;
  1583. /*
  1584. * DPMSG_SENDCOMPLETE
  1585. * System message generated when finished with an Async Send message
  1586. *
  1587. * NOTE SENDPARMS has an overlay for DPMSG_SENDCOMPLETE, don't
  1588. * change this message w/o changing SENDPARMS.
  1589. */
  1590. typedef struct
  1591. {
  1592. DWORD dwType;
  1593. DPID idFrom;
  1594. DPID idTo;
  1595. DWORD dwFlags;
  1596. DWORD dwPriority;
  1597. DWORD dwTimeout;
  1598. LPVOID lpvContext;
  1599. DWORD dwMsgID;
  1600. HRESULT hr;
  1601. DWORD dwSendTime;
  1602. } DPMSG_SENDCOMPLETE, *LPDPMSG_SENDCOMPLETE;
  1603. /****************************************************************************
  1604. *
  1605. * DIRECTPLAY ERRORS
  1606. *
  1607. * Errors are represented by negative values and cannot be combined.
  1608. *
  1609. ****************************************************************************/
  1610. #define DP_OK S_OK
  1611. #define DPERR_ALREADYINITIALIZED MAKE_DPHRESULT( 5 )
  1612. #define DPERR_ACCESSDENIED MAKE_DPHRESULT( 10 )
  1613. #define DPERR_ACTIVEPLAYERS MAKE_DPHRESULT( 20 )
  1614. #define DPERR_BUFFERTOOSMALL MAKE_DPHRESULT( 30 )
  1615. #define DPERR_CANTADDPLAYER MAKE_DPHRESULT( 40 )
  1616. #define DPERR_CANTCREATEGROUP MAKE_DPHRESULT( 50 )
  1617. #define DPERR_CANTCREATEPLAYER MAKE_DPHRESULT( 60 )
  1618. #define DPERR_CANTCREATESESSION MAKE_DPHRESULT( 70 )
  1619. #define DPERR_CAPSNOTAVAILABLEYET MAKE_DPHRESULT( 80 )
  1620. #define DPERR_EXCEPTION MAKE_DPHRESULT( 90 )
  1621. #define DPERR_GENERIC E_FAIL
  1622. #define DPERR_INVALIDFLAGS MAKE_DPHRESULT( 120 )
  1623. #define DPERR_INVALIDOBJECT MAKE_DPHRESULT( 130 )
  1624. #define DPERR_INVALIDPARAM E_INVALIDARG
  1625. #define DPERR_INVALIDPARAMS DPERR_INVALIDPARAM
  1626. #define DPERR_INVALIDPLAYER MAKE_DPHRESULT( 150 )
  1627. #define DPERR_INVALIDGROUP MAKE_DPHRESULT( 155 )
  1628. #define DPERR_NOCAPS MAKE_DPHRESULT( 160 )
  1629. #define DPERR_NOCONNECTION MAKE_DPHRESULT( 170 )
  1630. #define DPERR_NOMEMORY E_OUTOFMEMORY
  1631. #define DPERR_OUTOFMEMORY DPERR_NOMEMORY
  1632. #define DPERR_NOMESSAGES MAKE_DPHRESULT( 190 )
  1633. #define DPERR_NONAMESERVERFOUND MAKE_DPHRESULT( 200 )
  1634. #define DPERR_NOPLAYERS MAKE_DPHRESULT( 210 )
  1635. #define DPERR_NOSESSIONS MAKE_DPHRESULT( 220 )
  1636. #define DPERR_PENDING E_PENDING
  1637. #define DPERR_SENDTOOBIG MAKE_DPHRESULT( 230 )
  1638. #define DPERR_TIMEOUT MAKE_DPHRESULT( 240 )
  1639. #define DPERR_UNAVAILABLE MAKE_DPHRESULT( 250 )
  1640. #define DPERR_UNSUPPORTED E_NOTIMPL
  1641. #define DPERR_BUSY MAKE_DPHRESULT( 270 )
  1642. #define DPERR_USERCANCEL MAKE_DPHRESULT( 280 )
  1643. #define DPERR_NOINTERFACE E_NOINTERFACE
  1644. #define DPERR_CANNOTCREATESERVER MAKE_DPHRESULT( 290 )
  1645. #define DPERR_PLAYERLOST MAKE_DPHRESULT( 300 )
  1646. #define DPERR_SESSIONLOST MAKE_DPHRESULT( 310 )
  1647. #define DPERR_UNINITIALIZED MAKE_DPHRESULT( 320 )
  1648. #define DPERR_NONEWPLAYERS MAKE_DPHRESULT( 330 )
  1649. #define DPERR_INVALIDPASSWORD MAKE_DPHRESULT( 340 )
  1650. #define DPERR_CONNECTING MAKE_DPHRESULT( 350 )
  1651. #define DPERR_CONNECTIONLOST MAKE_DPHRESULT( 360 )
  1652. #define DPERR_UNKNOWNMESSAGE MAKE_DPHRESULT( 370 )
  1653. #define DPERR_CANCELFAILED MAKE_DPHRESULT( 380 )
  1654. #define DPERR_INVALIDPRIORITY MAKE_DPHRESULT( 390 )
  1655. #define DPERR_NOTHANDLED MAKE_DPHRESULT( 400 )
  1656. #define DPERR_CANCELLED MAKE_DPHRESULT( 410 )
  1657. #define DPERR_ABORTED MAKE_DPHRESULT( 420 )
  1658. #define DPERR_BUFFERTOOLARGE MAKE_DPHRESULT( 1000 )
  1659. #define DPERR_CANTCREATEPROCESS MAKE_DPHRESULT( 1010 )
  1660. #define DPERR_APPNOTSTARTED MAKE_DPHRESULT( 1020 )
  1661. #define DPERR_INVALIDINTERFACE MAKE_DPHRESULT( 1030 )
  1662. #define DPERR_NOSERVICEPROVIDER MAKE_DPHRESULT( 1040 )
  1663. #define DPERR_UNKNOWNAPPLICATION MAKE_DPHRESULT( 1050 )
  1664. #define DPERR_NOTLOBBIED MAKE_DPHRESULT( 1070 )
  1665. #define DPERR_SERVICEPROVIDERLOADED MAKE_DPHRESULT( 1080 )
  1666. #define DPERR_ALREADYREGISTERED MAKE_DPHRESULT( 1090 )
  1667. #define DPERR_NOTREGISTERED MAKE_DPHRESULT( 1100 )
  1668. //
  1669. // Security related errors
  1670. //
  1671. #define DPERR_AUTHENTICATIONFAILED MAKE_DPHRESULT( 2000 )
  1672. #define DPERR_CANTLOADSSPI MAKE_DPHRESULT( 2010 )
  1673. #define DPERR_ENCRYPTIONFAILED MAKE_DPHRESULT( 2020 )
  1674. #define DPERR_SIGNFAILED MAKE_DPHRESULT( 2030 )
  1675. #define DPERR_CANTLOADSECURITYPACKAGE MAKE_DPHRESULT( 2040 )
  1676. #define DPERR_ENCRYPTIONNOTSUPPORTED MAKE_DPHRESULT( 2050 )
  1677. #define DPERR_CANTLOADCAPI MAKE_DPHRESULT( 2060 )
  1678. #define DPERR_NOTLOGGEDIN MAKE_DPHRESULT( 2070 )
  1679. #define DPERR_LOGONDENIED MAKE_DPHRESULT( 2080 )
  1680. /****************************************************************************
  1681. *
  1682. * dplay 1.0 obsolete structures + interfaces
  1683. * Included for compatibility only. New apps should
  1684. * use IDirectPlay2
  1685. *
  1686. ****************************************************************************/
  1687. // define this to ignore obsolete interfaces and constants
  1688. #ifndef IDIRECTPLAY2_OR_GREATER
  1689. #define DPOPEN_OPENSESSION DPOPEN_JOIN
  1690. #define DPOPEN_CREATESESSION DPOPEN_CREATE
  1691. #define DPENUMSESSIONS_PREVIOUS 0x00000004
  1692. #define DPENUMPLAYERS_PREVIOUS 0x00000004
  1693. #define DPSEND_GUARANTEE DPSEND_GUARANTEED
  1694. #define DPSEND_TRYONCE 0x00000004
  1695. #define DPCAPS_NAMESERVICE 0x00000001
  1696. #define DPCAPS_NAMESERVER DPCAPS_ISHOST
  1697. #define DPCAPS_GUARANTEED 0x00000004
  1698. #define DPLONGNAMELEN 52
  1699. #define DPSHORTNAMELEN 20
  1700. #define DPSESSIONNAMELEN 32
  1701. #define DPPASSWORDLEN 16
  1702. #define DPUSERRESERVED 16
  1703. #define DPSYS_ADDPLAYER 0x0003
  1704. #define DPSYS_DELETEPLAYER 0x0005
  1705. #define DPSYS_DELETEGROUP 0x0020
  1706. #define DPSYS_DELETEPLAYERFROMGRP 0x0021
  1707. #define DPSYS_CONNECT 0x484b
  1708. typedef struct
  1709. {
  1710. DWORD dwType;
  1711. DWORD dwPlayerType;
  1712. DPID dpId;
  1713. char szLongName[DPLONGNAMELEN];
  1714. char szShortName[DPSHORTNAMELEN];
  1715. DWORD dwCurrentPlayers;
  1716. } DPMSG_ADDPLAYER;
  1717. typedef DPMSG_ADDPLAYER DPMSG_ADDGROUP;
  1718. typedef struct
  1719. {
  1720. DWORD dwType;
  1721. DPID dpIdGroup;
  1722. DPID dpIdPlayer;
  1723. } DPMSG_GROUPADD;
  1724. typedef DPMSG_GROUPADD DPMSG_GROUPDELETE;
  1725. typedef struct
  1726. {
  1727. DWORD dwType;
  1728. DPID dpId;
  1729. } DPMSG_DELETEPLAYER;
  1730. typedef BOOL (PASCAL *LPDPENUMPLAYERSCALLBACK)(
  1731. DPID dpId,
  1732. LPSTR lpFriendlyName,
  1733. LPSTR lpFormalName,
  1734. DWORD dwFlags,
  1735. LPVOID lpContext );
  1736. typedef struct
  1737. {
  1738. DWORD dwSize;
  1739. GUID guidSession;
  1740. DWORD_PTR dwSession;
  1741. DWORD dwMaxPlayers;
  1742. DWORD dwCurrentPlayers;
  1743. DWORD dwFlags;
  1744. char szSessionName[DPSESSIONNAMELEN];
  1745. char szUserField[DPUSERRESERVED];
  1746. DWORD_PTR dwReserved1;
  1747. char szPassword[DPPASSWORDLEN];
  1748. DWORD_PTR dwReserved2;
  1749. DWORD_PTR dwUser1;
  1750. DWORD_PTR dwUser2;
  1751. DWORD_PTR dwUser3;
  1752. DWORD_PTR dwUser4;
  1753. } DPSESSIONDESC,*LPDPSESSIONDESC;
  1754. typedef BOOL (PASCAL * LPDPENUMSESSIONSCALLBACK)(
  1755. LPDPSESSIONDESC lpDPSessionDesc,
  1756. LPVOID lpContext,
  1757. LPDWORD lpdwTimeOut,
  1758. DWORD dwFlags);
  1759. /*
  1760. * IDirectPlay
  1761. */
  1762. #undef INTERFACE
  1763. #define INTERFACE IDirectPlay
  1764. DECLARE_INTERFACE_( IDirectPlay, IUnknown )
  1765. {
  1766. /*** IUnknown methods ***/
  1767. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1768. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1769. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1770. /*** IDirectPlay methods ***/
  1771. STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE;
  1772. STDMETHOD(Close) (THIS) PURE;
  1773. STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPSTR,LPSTR,LPHANDLE) PURE;
  1774. STDMETHOD(CreateGroup) (THIS_ LPDPID,LPSTR,LPSTR) PURE;
  1775. STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE;
  1776. STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE;
  1777. STDMETHOD(DestroyGroup) (THIS_ DPID) PURE;
  1778. STDMETHOD(EnableNewPlayers) (THIS_ BOOL) PURE;
  1779. STDMETHOD(EnumGroupPlayers) (THIS_ DPID, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE;
  1780. STDMETHOD(EnumGroups) (THIS_ DWORD_PTR, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE;
  1781. STDMETHOD(EnumPlayers) (THIS_ DWORD_PTR, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE;
  1782. STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC,DWORD,LPDPENUMSESSIONSCALLBACK,LPVOID,DWORD) PURE;
  1783. STDMETHOD(GetCaps) (THIS_ LPDPCAPS) PURE;
  1784. STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE;
  1785. STDMETHOD(GetPlayerCaps) (THIS_ DPID, LPDPCAPS) PURE;
  1786. STDMETHOD(GetPlayerName) (THIS_ DPID,LPSTR,LPDWORD,LPSTR,LPDWORD) PURE;
  1787. STDMETHOD(Initialize) (THIS_ LPGUID) PURE;
  1788. STDMETHOD(Open) (THIS_ LPDPSESSIONDESC) PURE;
  1789. STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE;
  1790. STDMETHOD(SaveSession) (THIS_ LPSTR) PURE;
  1791. STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE;
  1792. STDMETHOD(SetPlayerName) (THIS_ DPID,LPSTR,LPSTR) PURE;
  1793. };
  1794. /****************************************************************************
  1795. *
  1796. * IDirectPlay interface macros
  1797. *
  1798. ****************************************************************************/
  1799. #if !defined(__cplusplus) || defined(CINTERFACE)
  1800. #define IDirectPlay_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b)
  1801. #define IDirectPlay_Close(p) (p)->lpVtbl->Close(p)
  1802. #define IDirectPlay_CreateGroup(p,a,b,c) (p)->lpVtbl->CreateGroup(p,a,b,c)
  1803. #define IDirectPlay_CreatePlayer(p,a,b,c,d) (p)->lpVtbl->CreatePlayer(p,a,b,c,d)
  1804. #define IDirectPlay_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b)
  1805. #define IDirectPlay_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a)
  1806. #define IDirectPlay_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a)
  1807. #define IDirectPlay_EnableNewPlayers(p,a) (p)->lpVtbl->EnableNewPlayers(p,a)
  1808. #define IDirectPlay_EnumGroupPlayers(p,a,b,c,d) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d)
  1809. #define IDirectPlay_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d)
  1810. #define IDirectPlay_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d)
  1811. #define IDirectPlay_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e)
  1812. #define IDirectPlay_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
  1813. #define IDirectPlay_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b)
  1814. #define IDirectPlay_GetPlayerCaps(p,a,b) (p)->lpVtbl->GetPlayerCaps(p,a,b)
  1815. #define IDirectPlay_GetPlayerName(p,a,b,c,d,e) (p)->lpVtbl->GetPlayerName(p,a,b,c,d,e)
  1816. #define IDirectPlay_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
  1817. #define IDirectPlay_Open(p,a) (p)->lpVtbl->Open(p,a)
  1818. #define IDirectPlay_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e)
  1819. #define IDirectPlay_SaveSession(p,a) (p)->lpVtbl->SaveSession(p,a)
  1820. #define IDirectPlay_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e)
  1821. #define IDirectPlay_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c)
  1822. #else /* C++ */
  1823. #define IDirectPlay_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b)
  1824. #define IDirectPlay_Close(p) (p)->Close()
  1825. #define IDirectPlay_CreateGroup(p,a,b,c) (p)->CreateGroup(a,b,c)
  1826. #define IDirectPlay_CreatePlayer(p,a,b,c,d) (p)->CreatePlayer(a,b,c,d)
  1827. #define IDirectPlay_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b)
  1828. #define IDirectPlay_DestroyGroup(p,a) (p)->DestroyGroup(a)
  1829. #define IDirectPlay_DestroyPlayer(p,a) (p)->DestroyPlayer(a)
  1830. #define IDirectPlay_EnableNewPlayers(p,a) (p)->EnableNewPlayers(a)
  1831. #define IDirectPlay_EnumGroupPlayers(p,a,b,c,d) (p)->EnumGroupPlayers(a,b,c,d)
  1832. #define IDirectPlay_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d)
  1833. #define IDirectPlay_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d)
  1834. #define IDirectPlay_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e)
  1835. #define IDirectPlay_GetCaps(p,a) (p)->GetCaps(a)
  1836. #define IDirectPlay_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b)
  1837. #define IDirectPlay_GetPlayerCaps(p,a,b) (p)->GetPlayerCaps(a,b)
  1838. #define IDirectPlay_GetPlayerName(p,a,b,c,d,e) (p)->GetPlayerName(a,b,c,d,e)
  1839. #define IDirectPlay_Initialize(p,a) (p)->Initialize(a)
  1840. #define IDirectPlay_Open(p,a) (p)->Open(a)
  1841. #define IDirectPlay_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e)
  1842. #define IDirectPlay_SaveSession(p,a) (p)->SaveSession(a)
  1843. #define IDirectPlay_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e)
  1844. #define IDirectPlay_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c)
  1845. #endif
  1846. DEFINE_GUID(IID_IDirectPlay, 0x5454e9a0, 0xdb65, 0x11ce, 0x92, 0x1c, 0x00, 0xaa, 0x00, 0x6c, 0x49, 0x72);
  1847. #endif // IDIRECTPLAY2_OR_GREATER
  1848. /****************************************************************************
  1849. *
  1850. * IDirectPlay macros (included regardless of IDIRECTPLAY2_OR_GREATER flag)
  1851. *
  1852. ****************************************************************************/
  1853. #if !defined(__cplusplus) || defined(CINTERFACE)
  1854. #define IDirectPlay_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  1855. #define IDirectPlay_AddRef(p) (p)->lpVtbl->AddRef(p)
  1856. #define IDirectPlay_Release(p) (p)->lpVtbl->Release(p)
  1857. #else
  1858. #define IDirectPlay_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  1859. #define IDirectPlay_AddRef(p) (p)->AddRef()
  1860. #define IDirectPlay_Release(p) (p)->Release()
  1861. #endif // IDirectPlay interface macros
  1862. #ifdef __cplusplus
  1863. };
  1864. #endif
  1865. /* restore warning settings */
  1866. #if _MSC_VER >= 1200
  1867. #pragma warning(pop)
  1868. #else
  1869. #pragma warning(default:4201)
  1870. #endif
  1871. #endif