Source code of Windows XP (NT5)
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.

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