dplay.h
上传用户:royluo
上传日期:2007-01-05
资源大小:1584k
文件大小:65k
源码类别:

游戏

开发平台:

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