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.

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