dplay.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:85k
源码类别:

模拟服务器

开发平台:

C/C++

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