home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / DPLAY.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  65.5 KB  |  1,719 lines

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