// H to Pas Converter Ver.0.7.0.8
//     Date : 97/12/14
//   Source : dplay.h

//DirectX5 include file
//
//   Translated by kuroda Dycoon
//
//   1998/4/22

unit dplay;

//{$X+}//{$Z2}

interface

uses Windows, Ole2;

{==========================================================================;
 *
 *  Copyright (C) 1994-1997 Microsoft Corporation.  All Rights Reserved.
 *
 *  File:       dplay.h
 *  Content:    DirectPlay include file
 *
 **************************************************************************}

//{$IFNDEF __DPLAY_INCLUDED__}
//{$DEFINE __DPLAY_INCLUDED__}

// Error :  #include < ole2.h > // for DECLARE_INTERFACE and HRESULT

const
  _FACDP	= $877;
// Error :  #define MAKE_DPHRESULT ( code ) MAKE_HRESULT ( 1 , _FACDP , code )

//{$IFDEF __cplusplus}
// Error : extern "C" {
//{$ENDIF}

{
 * GUIDS used by DirectPlay objects
 }
  IID_IDirectPlay: TGUID = (
    D1:$5454e9a0;D2:$db65;D3:$11ce;D4:($92,$1c,$00,$aa,$00,$6c,$49,$72));

  IID_IDirectPlay2: TGUID = (
    D1:$2b74f7c0;D2:$9154;D3:$11cf;D4:($a9,$cd,$0,$aa,$0,$68,$86,$e3));
  IID_IDirectPlay2A: TGUID = (
    D1:$9d460580;D2:$a822;D3:$11cf;D4:($96,$c,$0,$80,$c7,$53,$4e,$82));

  IID_IDirectPlay3: TGUID = (
    D1:$133efe40;D2:$32dc;D3:$11d0;D4:($9c,$fb,$0,$a0,$c9,$a,$43,$cb));
  IID_IDirectPlay3A: TGUID = (
    D1:$133efe41;D2:$32dc;D3:$11d0;D4:($9c,$fb,$0,$a0,$c9,$a,$43,$cb));

// {D1EB6D20-8923-11d0-9D97-00A0C90A43CB}
  CLSID_DirectPlay: TGUID = (
    D1:$d1eb6d20;D2:$8923;D3:$11d0;D4:($9d,$97,$0,$a0,$c9,$a,$43,$cb));

{
 * GUIDS used by Service Providers shipped with DirectPlay
 * Use these to identify Service Provider returned by EnumConnections
 }

// GUID for IPX service provider
// {685BC400-9D2C-11cf-A9CD-00AA006886E3}
  DPSPGUID_IPX: TGUID = (
    D1:$685bc400;D2:$9d2c;D3:$11cf;D4:($a9,$cd,$0,$aa,$0,$68,$86,$e3));

// GUID for TCP/IP service provider
// 36E95EE0-8577-11cf-960C-0080C7534E82
  DPSPGUID_TCPIP: TGUID = (
    D1:$36E95EE0;D2:$8577;D3:$11cf;D4:($96,$c,$0,$80,$c7,$53,$4e,$82));

// GUID for Serial service provider
// {0F1D6860-88D9-11cf-9C4E-00A0C905425E}
  DPSPGUID_SERIAL: TGUID = (
    D1:$f1d6860;D2:$88d9;D3:$11cf;D4:($9c,$4e,$0,$a0,$c9,$5,$42,$5e));

// GUID for Modem service provider
// {44EAA760-CB68-11cf-9C4E-00A0C905425E}
  DPSPGUID_MODEM: TGUID = (
    D1:$44eaa760;D2:$cb68;D3:$11cf;D4:($9c,$4e,$0,$a0,$c9,$5,$42,$5e));

{***************************************************************************
 *
 * DirectPlay Structures
 *
 * Various structures used to invoke DirectPlay.
 *
 ***************************************************************************}

  

  DPENUMSESSIONS_PREVIOUS	= $00000004;

  DPENUMPLAYERS_PREVIOUS	= $00000004;


  DPSEND_TRYONCE	= $00000004;

  DPCAPS_NAMESERVICE	= $00000001;

  DPCAPS_GUARANTEED	= $00000004;

  DPLONGNAMELEN	= 52;
  DPSHORTNAMELEN	= 20;
  DPSESSIONNAMELEN	= 32;
  DPPASSWORDLEN	= 16;
  DPUSERRESERVED	= 16;

  DPSYS_ADDPLAYER	= $0003;
  DPSYS_DELETEPLAYER	= $0005;

  DPSYS_DELETEGROUP	= $0020;
  DPSYS_DELETEPLAYERFROMGRP	= $0021;
  DPSYS_CONNECT	= $484b;
//{$IFNDEF IDIRECTPLAY2_OR_GREATER}
type
     LPDPNAME	= ^DPNAME;
  DPNAME = record
	dwSize	: DWORD;	// Size of structure
	dwFlags	: DWORD;	// Not used. Must be zero.

	case Integer of
	0: (
	  lpszShortName	: LPWSTR;
	  lpszLongName	: LPWSTR;
	);
	1: (
	  lpszShortNameA	: LPSTR;
	  lpszLongNameA	: LPSTR;
	);
  end;

 // LPDPNAME = DPNAME;

  LPDPENUMPLAYERSCALLBACK2 =   function (dpId: DWord; dwPlayerType: DWORD; lpName: LPDPNAME;
	 dwFlags: DWORD; lpContext: Pointer): BOOL; stdcall;


{
 * Unicode callback for DirectPlayEnumerate
 * This callback prototype will be used if compiling
 * for Unicode strings
 }
  LPDPENUMDPCALLBACK =   function (lpguidSP: PGUID; lpSPName: LPWSTR; dwMajorVersion: DWORD;
	 dwMinorVersion: DWORD; lpContext: Pointer): BOOL; stdcall;

{
 * ANSI callback for DirectPlayEnumerate
 * This callback prototype will be used if compiling
 * for ANSI strings
 }
  LPDPENUMDPCALLBACKA =   function (lpguidSP: PGUID; lpSPName: LPSTR; dwMajorVersion: DWORD;
	 dwMinorVersion: DWORD; lpContext: Pointer): BOOL; stdcall;

{
 * Call fck for IDirectPlay3(A)::EnumConnections
 }
  LPDPENUMCONNECTIONSCALLBACK =   function (lpguidSP: LPDPNAME; lpConnection: Pointer;
	 dwConnectionSize: DWORD; lpName: LPDPNAME; dwFlags: DWORD; lpContext: Pointer): BOOL; stdcall;


  IDirectPlay = class;
  IDirectPlay2 = class;
  IDirectPlay3 = class;




  LPDIRECTPLAY	= IDirectPlay;
//{$ELSE}
  //LPDIRECTPLAY	= ^IUnknown;
//{$ENDIF}

  //LPDIRECTPLAY2	= IDirectPlay2;
  //LPDIRECTPLAY2A	= IDirectPlay2;
  //IDirectPlay2A	= IDirectPlay2;

  //LPDIRECTPLAY3	= IDirectPlay3;
  //LPDIRECTPLAY3A	= IDirectPlay3;
  //IDirectPlay3A	= IDirectPlay3;

{
 * DPID
 * DirectPlay player and group ID
 }
  DPID	= DWORD;
  LPDPID	= ^DWORD;

{
 * DPID that system messages come from
 }
   LPDPCAPS	= ^DPCAPS;
  DPCAPS = record
	dwSize	: DWORD;	// Size of structure, in bytes
	dwFlags	: DWORD;	// DPCAPS_xxx flags
	dwMaxBufferSize	: DWORD;	// Maximum message size, in bytes,  for this service provider
	dwMaxQueueSize	: DWORD;	// Obsolete.
	dwMaxPlayers	: DWORD;	// Maximum players/groups (local + remote)
	dwHundredBaud	: DWORD;	// Bandwidth in 100 bits per second units;
// i.e. 24 is 2400, 96 is 9600, etc.
	dwLatency	: DWORD;	// Estimated latency; 0 = unknown
	dwMaxLocalPlayers	: DWORD;	// Maximum # of locally created players allowed
	dwHeaderLength	: DWORD;	// Maximum header length, in bytes, on messages
// added by the service provider
	dwTimeout	: DWORD;	// Service provider's suggested timeout value
// This is how long DirectPlay will wait for
// responses to system messages
  end;

    LPDPSESSIONDESC2	= ^DPSESSIONDESC2;
  DPSESSIONDESC2 = record
	dwSize	: DWORD;	// Size of structure
	dwFlags	: DWORD;	// DPSESSION_xxx flags
	guidInstance	: TGUID;	// ID for the session instance
	guidApplication	: TGUID;	// GUID of the DirectPlay application.
// GUID_NULL for all applications.
	dwMaxPlayers	: DWORD;	// Maximum # players allowed in session
	dwCurrentPlayers	: DWORD;	// Current # players in session (read only)
	case Integer of
	0: (
	  lpszSessionName	: LPWSTR;
	  lpszPassword	: LPWSTR;
	  dwReserved1	: DWORD;
	  dwReserved2	: DWORD;
	  dwUser1	: DWORD;
	  dwUser2	: DWORD;
	  dwUser3	: DWORD;
	  dwUser4	: DWORD;
	);
	1: (
	  lpszSessionNameA	: LPSTR;
	  lpszPasswordA	: LPSTR;
	);
  end;
  LPCDPSESSIONDESC2	= ^DPSESSIONDESC2;


{
 * LPCDPNAME
 * A constant pointer to DPNAME
 }
  LPCDPNAME	= ^DPNAME;

{
 * DPCREDENTIALS
 * Used to hold the user name and password of a DirectPlay user
 }
  LPDPCREDENTIALS	= ^DPCREDENTIALS;
  DPCREDENTIALS = record
	dwSize	: DWORD;	// Size of structure
	dwFlags	: DWORD;	// Not used. Must be zero.
	case Integer of
	0: (
	  lpszUsername	: LPWSTR;
	  lpszPassword	: LPWSTR;
	  lpszDomain	: LPWSTR;
	);
	1: (
	  lpszUsernameA	: LPSTR;
	  lpszPasswordA	: LPSTR;
	  lpszDomainA	: LPSTR;
	);
  end;

  LPCDPCREDENTIALS	= ^DPCREDENTIALS;

{
 * DPSECURITYDESC
 * Used to describe the security properties of a DirectPlay
 * session instance
 }
  LPDPSECURITYDESC	= ^DPSECURITYDESC;
  DPSECURITYDESC = record
	dwSize	: DWORD;	// Size of structure
	dwFlags	: DWORD;	// Not used. Must be zero.
	case Integer of
	0: (
	  lpszSSPIProvider	: LPWSTR;
	  lpszCAPIProvider	: LPWSTR;
	  dwCAPIProviderType	: DWORD;
	  dwEncryptionAlgorithm	: DWORD;
	);
	1: (
	  lpszSSPIProviderA	: LPSTR;
	  lpszCAPIProviderA	: LPSTR;
	);
  end;

  LPCDPSECURITYDESC	= ^DPSECURITYDESC;

{
 * DPACCOUNTDESC
 * Used to describe a user membership account
 }
  LPDPACCOUNTDESC	= ^DPACCOUNTDESC;
  DPACCOUNTDESC = record
	dwSize	: DWORD;	// Size of structure
	dwFlags	: DWORD;	// Not used. Must be zero.
	case Integer of
	0: (
	  lpszAccountID	: LPWSTR;
	);
	1: (
	  lpszAccountIDA	: LPSTR;
	);
  end;

  LPCDPACCOUNTDESC	= ^DPACCOUNTDESC;

{
 * LPCGUID
 * A constant pointer to a guid
 }
  LPCGUID	= ^TGUID;

{
 * DPLCONNECTION
 * Used to hold all in the informaion needed to connect
 * an application to a session or create a session
 }
  LPDPLCONNECTION	= ^DPLCONNECTION;
  DPLCONNECTION = record
	dwSize	: DWORD;	// Size of this structure
	dwFlags	: DWORD;	// Flags specific to this structure
	lpSessionDesc	: LPDPSESSIONDESC2;	// Pointer to session desc to use on connect
	lpPlayerName	: LPDPNAME;	// Pointer to Player name structure
	guidSP	: TGUID;	// GUID of the DPlay SP to use
	lpAddress	: Pointer;	// Address for service provider
	dwAddressSize	: DWORD;	// Size of address data
  end;

{
 * LPCDPLCONNECTION
 * A constant pointer to DPLCONNECTION
 }
  LPCDPLCONNECTION	= ^DPLCONNECTION;

{
 * DPCHAT
 * Used to hold the a DirectPlay chat message
 }
  LPDPCHAT	= ^DPCHAT;
  DPCHAT = record
	dwSize	: DWORD;
	dwFlags	: DWORD;
	case Integer of
	0: (
	  lpszMessage	: LPWSTR;
	);
	1: (
	  lpszMessageA	: LPSTR;
	);
  end;

{***************************************************************************
 *
 * Prototypes for DirectPlay callback functions
 *
 ***************************************************************************}

{
 * Callback for IDirectPlay2::EnumSessions
 }
  LPDPENUMSESSIONSCALLBACK2 =   function (lpThisSD: LPCDPSESSIONDESC2; lpdwTimeOut: LPDWORD;
	 dwFlags: DWORD; lpContext: Pointer): BOOL; stdcall;

{
 * This flag is set on the EnumSessions callback dwFlags parameter when
 * the time out has occurred. There will be no session data for this
 * callback. If *lpdwTimeOut is set to a non-zero value and the
 * EnumSessionsCallback function returns TRUE then EnumSessions will
 * continue waiting until the next timeout occurs. Timeouts are in
 * milliseconds.
 }
   LPDPMSG_GENERIC	= ^DPMSG_GENERIC;
  DPMSG_GENERIC = record
	dwType	: DWORD;	// Message type
  end;

{
 * DPMSG_CREATEPLAYERORGROUP
 * System message generated when a new player or group
 * created in the session with information about it.
 }
  LPDPMSG_CREATEPLAYERORGROUP	= ^DPMSG_CREATEPLAYERORGROUP;
  DPMSG_CREATEPLAYERORGROUP = record
	dwType	: DWORD;	// Message type
	dwPlayerType	: DWORD;	// Is it a player or group
	dpId	: DPID;	// ID of the player or group
	dwCurrentPlayers	: DWORD;	// current # players & groups in session
	lpData	: Pointer;	// pointer to remote data
	dwDataSize	: DWORD;	// size of remote data
	dpnName	: DPNAME;	// structure with name info
// the following fields are only available when using
// the IDirectPlay3 interface or greater
	dpIdParent	: DPID;	// id of parent group
	dwFlags	: DWORD;	// player or group flags
  end;

{
 * DPMSG_DESTROYPLAYERORGROUP
 * System message generated when a player or group is being
 * destroyed in the session with information about it.
 }
  LPDPMSG_DESTROYPLAYERORGROUP	= ^DPMSG_DESTROYPLAYERORGROUP;
  DPMSG_DESTROYPLAYERORGROUP = record
	dwType	: DWORD;	// Message type
	dwPlayerType	: DWORD;	// Is it a player or group
	dpId	: DPID;	// player ID being deleted
	lpLocalData	: Pointer;	// copy of players local data
	dwLocalDataSize	: DWORD;	// sizeof local data
	lpRemoteData	: Pointer;	// copy of players remote data
	dwRemoteDataSize	: DWORD;	// sizeof remote data
// the following fields are only available when using
// the IDirectPlay3 interface or greater
	dpnName	: DPNAME;	// structure with name info
	dpIdParent	: DPID;	// id of parent group	
	dwFlags	: DWORD;	// player or group flags
  end;

{
 * DPMSG_ADDPLAYERTOGROUP
 * System message generated when a player is being added
 * to a group.
 }
  LPDPMSG_ADDPLAYERTOGROUP	= ^DPMSG_ADDPLAYERTOGROUP;
  DPMSG_ADDPLAYERTOGROUP = record
	dwType	: DWORD;	// Message type
	dpIdGroup	: DPID;	// group ID being added to
	dpIdPlayer	: DPID;	// player ID being added
  end;

{
 * DPMSG_DELETEPLAYERFROMGROUP
 * System message generated when a player is being
 * removed from a group
 }
  DPMSG_DELETEPLAYERFROMGROUP	= DPMSG_ADDPLAYERTOGROUP;
  LPDPMSG_DELETEPLAYERFROMGROUP	= ^DPMSG_DELETEPLAYERFROMGROUP;

{
 * DPMSG_ADDGROUPTOGROUP
 * System message generated when a group is being added
 * to a group.
 }
  LPDPMSG_ADDGROUPTOGROUP	= ^DPMSG_ADDGROUPTOGROUP;
  DPMSG_ADDGROUPTOGROUP = record
	dwType	: DWORD;	// Message type
	dpIdParentGroup	: DPID;	// group ID being added to
	dpIdGroup	: DPID;	// group ID being added
  end;

{
 * DPMSG_DELETEGROUPFROMGROUP
 * System message generated when a GROUP is being
 * removed from a group
 }
  DPMSG_DELETEGROUPFROMGROUP	= DPMSG_ADDGROUPTOGROUP;
  LPDPMSG_DELETEGROUPFROMGROUP	= ^DPMSG_DELETEGROUPFROMGROUP;

{
 * DPMSG_SETPLAYERORGROUPDATA
 * System message generated when remote data for a player or
 * group has changed.
 }
  LPDPMSG_SETPLAYERORGROUPDATA	= ^DPMSG_SETPLAYERORGROUPDATA;
  DPMSG_SETPLAYERORGROUPDATA = record
	dwType	: DWORD;	// Message type
	dwPlayerType	: DWORD;	// Is it a player or group
	dpId	: DPID;	// ID of player or group
	lpData	: Pointer;	// pointer to remote data
	dwDataSize	: DWORD;	// size of remote data
  end;

{
 * DPMSG_SETPLAYERORGROUPNAME
 * System message generated when the name of a player or
 * group has changed.
 }
  LPDPMSG_SETPLAYERORGROUPNAME	= ^DPMSG_SETPLAYERORGROUPNAME;
  DPMSG_SETPLAYERORGROUPNAME = record
	dwType	: DWORD;	// Message type
	dwPlayerType	: DWORD;	// Is it a player or group
	dpId	: DPID;	// ID of player or group
	dpnName	: DPNAME;	// structure with new name info
  end;

{
 * DPMSG_SETSESSIONDESC
 * System message generated when session desc has changed
 }
  LPDPMSG_SETSESSIONDESC	= ^DPMSG_SETSESSIONDESC;
  DPMSG_SETSESSIONDESC = record
	dwType	: DWORD;	// Message type
	dpDesc	: DPSESSIONDESC2;	// Session desc
  end;

{
 * DPMSG_HOST
 * System message generated when the host has migrated to this
 * DirectPlay object.
 *
 }
  DPMSG_HOST	= DPMSG_GENERIC;
  LPDPMSG_HOST	= ^DPMSG_HOST;

{
 * DPMSG_SESSIONLOST
 * System message generated when the connection to the session is lost.
 *
 }
  DPMSG_SESSIONLOST	= DPMSG_GENERIC;
  LPDPMSG_SESSIONLOST	= ^DPMSG_SESSIONLOST;

{
 * DPMSG_SECUREMESSAGE
 * System message generated when a player requests a secure send
 }
  LPDPMSG_SECUREMESSAGE	= ^DPMSG_SECUREMESSAGE;
  DPMSG_SECUREMESSAGE = record
	dwType	: DWORD;	// Message Type
	dwFlags	: DWORD;	// Signed/Encrypted
	dpIdFrom	: DPID;	// ID of Sending Player
	lpData	: Pointer;	// Player message
	dwDataSize	: DWORD;	// Size of player message
  end;

{
 * DPMSG_STARTSESSION
 * System message containing all information required to 
 * start a new session
 }
  LPDPMSG_STARTSESSION	= ^DPMSG_STARTSESSION;
  DPMSG_STARTSESSION = record
	dwType	: DWORD;	// Message type
	lpConn	: LPDPLCONNECTION;	// DPLCONNECTION structure
  end;

{
 * DPMSG_CHAT
 * System message containing a chat message
 }
  LPDPMSG_CHAT	= ^DPMSG_CHAT;
  DPMSG_CHAT = record
	dwType	: DWORD;	// Message type
	dwFlags	: DWORD;	// Message flags
	idFromPlayer	: DPID;	// ID of the Sending Player
	idToPlayer	: DPID;	// ID of the To Player
	idToGroup	: DPID;	// ID of the To Group
	lpChat	: LPDPCHAT;	// Pointer to a structure containing the chat message
  end;


    DPMSG_ADDPLAYER = record
	dwType	: DWORD;
	dwPlayerType	: DWORD;
	dpId	: DPID;
	szLongName	: array[0..DPLONGNAMELEN-1] of char;
	szShortName	: array[0..DPSHORTNAMELEN-1] of char;
	dwCurrentPlayers	: DWORD;
  end;

  DPMSG_ADDGROUP	= DPMSG_ADDPLAYER;

  DPMSG_GROUPADD = record
	dwType	: DWORD;
	dpIdGroup	: DPID;
	dpIdPlayer	: DPID;
  end;

  DPMSG_GROUPDELETE	= DPMSG_GROUPADD;
  DPMSG_DELETEPLAYER = record
	dwType	: DWORD;
	dpId	: DPID;
  end;

  LPDPENUMPLAYERSCALLBACK =   function (dpId: DPID; lpFriendlyName: LPSTR; lpFormalName: LPSTR;
	 dwFlags: DWORD; lpContext: Pointer): PBOOL; pascal;

  LPDPSESSIONDESC	= ^DPSESSIONDESC;
  DPSESSIONDESC = record
	dwSize	: DWORD;
	guidSession	: TGUID;
	dwSession	: DWORD;
	dwMaxPlayers	: DWORD;
	dwCurrentPlayers	: DWORD;
	dwFlags	: DWORD;
	szSessionName	: array[0..DPSESSIONNAMELEN-1] of char;
	szUserField	: array[0..DPUSERRESERVED-1] of char;
	dwReserved1	: DWORD;
	szPassword	: array[0..DPPASSWORDLEN-1] of char;
	dwReserved2	: DWORD;
	dwUser1	: DWORD;
	dwUser2	: DWORD;
	dwUser3	: DWORD;
	dwUser4	: DWORD;
  end;

  LPDPENUMSESSIONSCALLBACK =   function (lpDPSessionDesc: LPDPSESSIONDESC; lpContext: Pointer;
	 lpdwTimeOut: LPDWORD; dwFlags: DWORD): PBOOL; pascal;

{
 * IDirectPlay
 }
//{$UNDEF INTERFACE}
// Error :  #define INTERFACE IDirectPlay
  IDirectPlay = class ( IUnknown )
{** IUnknown methods **}
//    function _QueryInterface(riid: TIID; var ppvObj: Pointer): HRESULT; virtual; stdcall; abstract;
//    function _AddRef: ULONG; virtual; stdcall; abstract;
//    function _Release: ULONG; virtual; stdcall; abstract;
{** IDirectPlay methods **}
    function AddPlayerToGroup(Para0: DPID; Para1: DPID): HRESULT; virtual; stdcall; abstract;
    function Close: HRESULT; virtual; stdcall; abstract;
    function CreatePlayer(Para0: LPDPID; Para1: LPSTR; Para2: LPSTR; Para3: PHANDLE): HRESULT; virtual; stdcall; abstract;
    function CreateGroup(Para0: LPDPID; Para1: LPSTR; Para2: LPSTR): HRESULT; virtual; stdcall; abstract;
    function DeletePlayerFromGroup(Para0: DPID; Para1: DPID): HRESULT; virtual; stdcall; abstract;
    function DestroyPlayer(Para0: DPID): HRESULT; virtual; stdcall; abstract;
    function DestroyGroup(Para0: DPID): HRESULT; virtual; stdcall; abstract;
    function EnableNewPlayers(Para0: BOOL): HRESULT; virtual; stdcall; abstract;
    function EnumGroupPlayers(Para0: DPID; Para1: LPDPENUMPLAYERSCALLBACK; Para2: Pointer;
	 Para3: DWORD): HRESULT; virtual; stdcall; abstract;
    function EnumGroups(Para0: DWORD; Para1: LPDPENUMPLAYERSCALLBACK; Para2: Pointer; 
	 Para3: DWORD): HRESULT; virtual; stdcall; abstract;
    function EnumPlayers(Para0: DWORD; Para1: LPDPENUMPLAYERSCALLBACK; Para2: Pointer;
	 Para3: DWORD): HRESULT; virtual; stdcall; abstract;
    function EnumSessions(Para0: LPDPSESSIONDESC; Para1: DWORD; Para2: LPDPENUMSESSIONSCALLBACK;
	 Para3: Pointer; Para4: DWORD): HRESULT; virtual; stdcall; abstract;
    function GetCaps(Para0: LPDPCAPS): HRESULT; virtual; stdcall; abstract;
    function GetMessageCount(Para0: DPID; Para1: LPDWORD): HRESULT; virtual; stdcall; abstract;
    function GetPlayerCaps(Para0: DPID; Para1: LPDPCAPS): HRESULT; virtual; stdcall; abstract;
    function GetPlayerName(Para0: DPID; Para1: LPSTR; Para2: LPDWORD; Para3: LPSTR;
	 Para4: LPDWORD): HRESULT; virtual; stdcall; abstract;
    function Initialize(Para0: PGUID): HRESULT; virtual; stdcall; abstract;
    function Open(Para0: LPDPSESSIONDESC): HRESULT; virtual; stdcall; abstract;
    function Receive(Para0: LPDPID; Para1: LPDPID; Para2: DWORD; Para3: Pointer;
	 Para4: LPDWORD): HRESULT; virtual; stdcall; abstract;
    function SaveSession(Para0: LPSTR): HRESULT; virtual; stdcall; abstract;
    function Send(Para0: DPID; Para1: DPID; Para2: DWORD; Para3: Pointer; Para4: DWORD): HRESULT; virtual; stdcall; abstract;
    function SetPlayerName(Para0: DPID; Para1: LPSTR; Para2: LPSTR): HRESULT; virtual; stdcall; abstract;
  end;

{***************************************************************************
 *
 * DIRECTPLAY ERRORS
 *
 * Errors are represented by negative values and cannot be combined.
 *
 ***************************************************************************}

{
 * LPCDPSESSIONDESC2
 * A constant pointer to DPSESSIONDESC2
 }




  IDirectPlay2 = class ( IUnknown )
{** IUnknown methods **}
//    function STDMETHOD(Para1: QueryInterface): TD;
//    function _AddRef: ULONG; virtual; stdcall; abstract;
//    function _Release: ULONG; virtual; stdcall; abstract;
{** IDirectPlay2 methods **}
    function AddPlayerToGroup(Para0: DPID; Para1: DPID): HRESULT; virtual; stdcall; abstract;
    function Close: HRESULT; virtual; stdcall; abstract;
    function CreateGroup(Para0: LPDPID; Para1: LPDPNAME; Para2: Pointer; Para3: DWORD;
	 Para4: DWORD): HRESULT; virtual; stdcall; abstract;
    function CreatePlayer(Para0: LPDPID; Para1: LPDPNAME; Para2: THANDLE; Para3: Pointer;
	 Para4: DWORD; Para5: DWORD): HRESULT; virtual; stdcall; abstract;
    function DeletePlayerFromGroup(Para0: DPID; Para1: DPID): HRESULT; virtual; stdcall; abstract;
    function DestroyGroup(Para0: DPID): HRESULT; virtual; stdcall; abstract;
    function DestroyPlayer(Para0: DPID): HRESULT; virtual; stdcall; abstract;
    function EnumGroupPlayers(Para0: DPID; Para1: PGUID; Para2: LPDPENUMPLAYERSCALLBACK2;
	 Para3: Pointer; Para4: DWORD): HRESULT; virtual; stdcall; abstract;
    function EnumGroups(Para0: PGUID; Para1: LPDPENUMPLAYERSCALLBACK2; Para2: Pointer; 
	 Para3: DWORD): HRESULT; virtual; stdcall; abstract;
    function EnumPlayers(Para0: PGUID; Para1: LPDPENUMPLAYERSCALLBACK2; Para2: Pointer; 
	 Para3: DWORD): HRESULT; virtual; stdcall; abstract;
    function EnumSessions(Para0: LPDPSESSIONDESC2; Para1: DWORD; Para2: LPDPENUMSESSIONSCALLBACK2;
	 Para3: Pointer; Para4: DWORD): HRESULT; virtual; stdcall; abstract;
    function GetCaps(Para0: LPDPCAPS; Para1: DWORD): HRESULT; virtual; stdcall; abstract;
    function GetGroupData(Para0: DPID; Para1: Pointer; Para2: LPDWORD; Para3: DWORD): HRESULT; virtual; stdcall; abstract;
    function GetGroupName(Para0: DPID; Para1: Pointer; Para2: LPDWORD): HRESULT; virtual; stdcall; abstract;
    function GetMessageCount(Para0: DPID; Para1: LPDWORD): HRESULT; virtual; stdcall; abstract;
    function GetPlayerAddress(Para0: DPID; Para1: Pointer; Para2: LPDWORD): HRESULT; virtual; stdcall; abstract;
    function GetPlayerCaps(Para0: DPID; Para1: LPDPCAPS; Para2: DWORD): HRESULT; virtual; stdcall; abstract;
    function GetPlayerData(Para0: DPID; Para1: Pointer; Para2: LPDWORD; Para3: DWORD): HRESULT; virtual; stdcall; abstract;
    function GetPlayerName(Para0: DPID; Para1: Pointer; Para2: LPDWORD): HRESULT; virtual; stdcall; abstract;
    function GetSessionDesc(Para0: Pointer; Para1: LPDWORD): HRESULT; virtual; stdcall; abstract;
    function Initialize(Para0: PGUID): HRESULT; virtual; stdcall; abstract;
    function Open(Para0: LPDPSESSIONDESC2; Para1: DWORD): HRESULT; virtual; stdcall; abstract;
    function Receive(Para0: LPDPID; Para1: LPDPID; Para2: DWORD; Para3: Pointer; 
	 Para4: LPDWORD): HRESULT; virtual; stdcall; abstract;
    function Send(Para0: DPID; Para1: DPID; Para2: DWORD; Para3: Pointer; Para4: DWORD): HRESULT; virtual; stdcall; abstract;
    function SetGroupData(Para0: DPID; Para1: Pointer; Para2: DWORD; Para3: DWORD): HRESULT; virtual; stdcall; abstract;
    function SetGroupName(Para0: DPID; Para1: LPDPNAME; Para2: DWORD): HRESULT; virtual; stdcall; abstract;
    function SetPlayerData(Para0: DPID; Para1: Pointer; Para2: DWORD; Para3: DWORD): HRESULT; virtual; stdcall; abstract;
    function SetPlayerName(Para0: DPID; Para1: LPDPNAME; Para2: DWORD): HRESULT; virtual; stdcall; abstract;
    function SetSessionDesc(Para0: LPDPSESSIONDESC2; Para1: DWORD): HRESULT; virtual; stdcall; abstract;
  end;

    IDirectPlay3 = class ( IDirectPlay2 )
{** IUnknown methods **}
//    function _QueryInterface(riid: TIID; var ppvObj: Pointer): HRESULT; virtual; stdcall; abstract;
//    function _AddRef: ULONG; virtual; stdcall; abstract;
//    function _Release: ULONG; virtual; stdcall; abstract;
{** IDirectPlay2 methods **}
    //function AddPlayerToGroup(Para0: DPID; Para1: DPID): HRESULT; virtual; stdcall; abstract;
    //function Close: HRESULT; virtual; stdcall; abstract;
    //function CreateGroup(Para0: LPDPID; Para1: LPDPNAME; Para2: Pointer; Para3: DWORD;
    //	 Para4: DWORD): HRESULT; virtual; stdcall; abstract;
    //function CreatePlayer(Para0: LPDPID; Para1: LPDPNAME; Para2: THANDLE; Para3: Pointer;
    //	 Para4: DWORD; Para5: DWORD): HRESULT; virtual; stdcall; abstract;
    //function DeletePlayerFromGroup(Para0: DPID; Para1: DPID): HRESULT; virtual; stdcall; abstract;
    //function DestroyGroup(Para0: DPID): HRESULT; virtual; stdcall; abstract;
    //function DestroyPlayer(Para0: DPID): HRESULT; virtual; stdcall; abstract;
    //function EnumGroupPlayers(Para0: DPID; Para1: PGUID; Para2: LPDPENUMPLAYERSCALLBACK2;
    //	 Para3: Pointer; Para4: DWORD): HRESULT; virtual; stdcall; abstract;
    //function EnumGroups(Para0: PGUID; Para1: LPDPENUMPLAYERSCALLBACK2; Para2: Pointer;
    //	 Para3: DWORD): HRESULT; virtual; stdcall; abstract;
    //function EnumPlayers(Para0: PGUID; Para1: LPDPENUMPLAYERSCALLBACK2; Para2: Pointer;
    //	 Para3: DWORD): HRESULT; virtual; stdcall; abstract;
    //function EnumSessions(Para0: LPDPSESSIONDESC2; Para1: DWORD; Para2: LPDPENUMSESSIONSCALLBACK2;
    //	 Para3: Pointer; Para4: DWORD): HRESULT; virtual; stdcall; abstract;
    //function GetCaps(Para0: LPDPCAPS; Para1: DWORD): HRESULT; virtual; stdcall; abstract;
    //function GetGroupData(Para0: DPID; Para1: Pointer; Para2: LPDWORD; Para3: DWORD): HRESULT; virtual; stdcall; abstract;
    //function GetGroupName(Para0: DPID; Para1: Pointer; Para2: LPDWORD): HRESULT; virtual; stdcall; abstract;
    //function GetMessageCount(Para0: DPID; Para1: LPDWORD): HRESULT; virtual; stdcall; abstract;
    //function GetPlayerAddress(Para0: DPID; Para1: Pointer; Para2: LPDWORD): HRESULT; virtual; stdcall; abstract;
    //function GetPlayerCaps(Para0: DPID; Para1: LPDPCAPS; Para2: DWORD): HRESULT; virtual; stdcall; abstract;
    //function GetPlayerData(Para0: DPID; Para1: Pointer; Para2: LPDWORD; Para3: DWORD): HRESULT; virtual; stdcall; abstract;
    //function GetPlayerName(Para0: DPID; Para1: Pointer; Para2: LPDWORD): HRESULT; virtual; stdcall; abstract;
    //function GetSessionDesc(Para0: Pointer; Para1: LPDWORD): HRESULT; virtual; stdcall; abstract;
    //function Initialize(Para0: PGUID): HRESULT; virtual; stdcall; abstract;
    //function Open(Para0: LPDPSESSIONDESC2; Para1: DWORD): HRESULT; virtual; stdcall; abstract;
    //function Receive(Para0: LPDPID; Para1: LPDPID; Para2: DWORD; Para3: Pointer;
    //	 Para4: LPDWORD): HRESULT; virtual; stdcall; abstract;
    //function Send(Para0: DPID; Para1: DPID; Para2: DWORD; Para3: Pointer; Para4: DWORD): HRESULT; virtual; stdcall; abstract;
    //function SetGroupData(Para0: DPID; Para1: Pointer; Para2: DWORD; Para3: DWORD): HRESULT; virtual; stdcall; abstract;
    //function SetGroupName(Para0: DPID; Para1: LPDPNAME; Para2: DWORD): HRESULT; virtual; stdcall; abstract;
    //function SetPlayerData(Para0: DPID; Para1: Pointer; Para2: DWORD; Para3: DWORD): HRESULT; virtual; stdcall; abstract;
    //function SetPlayerName(Para0: DPID; Para1: LPDPNAME; Para2: DWORD): HRESULT; virtual; stdcall; abstract;
    //function SetSessionDesc(Para0: LPDPSESSIONDESC2; Para1: DWORD): HRESULT; virtual; stdcall; abstract;
{** IDirectPlay3 methods **}
    function AddGroupToGroup(Para0: DPID; Para1: DPID): HRESULT; virtual; stdcall; abstract;
    function CreateGroupInGroup(Para0: DPID; Para1: LPDPID; Para2: LPDPNAME; Para3: Pointer; 
	 Para4: DWORD; Para5: DWORD): HRESULT; virtual; stdcall; abstract;
    function DeleteGroupFromGroup(Para0: DPID; Para1: DPID): HRESULT; virtual; stdcall; abstract;
    function EnumConnections(Para0: LPCGUID; Para1: LPDPENUMCONNECTIONSCALLBACK; 
	 Para2: Pointer; Para3: DWORD): HRESULT; virtual; stdcall; abstract;
    function EnumGroupsInGroup(Para0: DPID; Para1: PGUID; Para2: LPDPENUMPLAYERSCALLBACK2;
	 Para3: Pointer; Para4: DWORD): HRESULT; virtual; stdcall; abstract;
    function GetGroupConnectionSettings(Para0: DWORD; Para1: DPID; Para2: Pointer; 
	 Para3: LPDWORD): HRESULT; virtual; stdcall; abstract;
    function InitializeConnection(Para0: Pointer; Para1: DWORD): HRESULT; virtual; stdcall; abstract;
    function SecureOpen(Para0: LPCDPSESSIONDESC2; Para1: DWORD; Para2: LPCDPSECURITYDESC; 
	 Para3: LPCDPCREDENTIALS): HRESULT; virtual; stdcall; abstract;
    function SendChatMessage(Para0: DPID; Para1: DPID; Para2: DWORD; Para3: LPDPCHAT): HRESULT; virtual; stdcall; abstract;
    function SetGroupConnectionSettings(Para0: DWORD; Para1: DPID; Para2: LPDPLCONNECTION): HRESULT; virtual; stdcall; abstract;
    function StartSession(Para0: DWORD; Para1: DPID): HRESULT; virtual; stdcall; abstract;
    function GetGroupFlags(Para0: DPID; Para1: LPDWORD): HRESULT; virtual; stdcall; abstract;
    function GetGroupParent(Para0: DPID; Para1: LPDPID): HRESULT; virtual; stdcall; abstract;
    function GetPlayerAccount(Para0: DPID; Para1: DWORD; Para2: Pointer; Para3: LPDWORD): HRESULT; virtual; stdcall; abstract;
    function GetPlayerFlags(Para0: DPID; Para1: LPDWORD): HRESULT; virtual; stdcall; abstract;
  end;

const
  DPID_SYSMSG	= 0;

{
 * DPID representing all players in the session
 }
  DPID_ALLPLAYERS	= 0;

{
 * DPID representing the server player
 }
  DPID_SERVERPLAYER	= 1;

{
 * The player ID is unknown (used with e.g. DPSESSION_NOMESSAGEID)
 }
  DPID_UNKNOWN	= $FFFFFFFF;

{
 * DPCAPS
 * Used to obtain the capabilities of a DirectPlay object
 }

{
 * This DirectPlay object is the session host.  If the host exits the
 * session, another application will become the host and receive a
 * DPSYS_HOST system message.
 }

  DPCAPS_ISHOST	= $00000002;

{
 * The service provider bound to this DirectPlay object can optimize
 * group messaging.
 }
  DPCAPS_GROUPOPTIMIZED	= $00000008;

{
 * The service provider bound to this DirectPlay object can optimize
 * keep alives (see DPSESSION_KEEPALIVE)
 }
  DPCAPS_KEEPALIVEOPTIMIZED	= $00000010;

{
 * The service provider bound to this DirectPlay object can optimize
 * guaranteed message delivery.
 }
  DPCAPS_GUARANTEEDOPTIMIZED	= $00000020;

{
 * This DirectPlay object supports guaranteed message delivery.
 }
  DPCAPS_GUARANTEEDSUPPORTED	= $00000040;

{
 * This DirectPlay object supports digital signing of messages.
 }
  DPCAPS_SIGNINGSUPPORTED	= $00000080;

{
 * This DirectPlay object supports encryption of messages.
 }
  DPCAPS_ENCRYPTIONSUPPORTED	= $00000100;


{
 * DPSESSIONDESC2
 * Used to describe the properties of a DirectPlay
 * session instance
 }



{
 * Applications cannot create new players in this session.
 }
  DPSESSION_NEWPLAYERSDISABLED	= $00000001;

{
 * If the DirectPlay object that created the session, the host,
 * quits, then the host will attempt to migrate to another
 * DirectPlay object so that new players can continue to be created
 * and new applications can join the session.
 }
  DPSESSION_MIGRATEHOST	= $00000004;

{
 * This flag tells DirectPlay not to set the idPlayerTo and idPlayerFrom 
 * fields in player messages.  This cuts two DWORD's off the message 
 * overhead.
 }
  DPSESSION_NOMESSAGEID	= $00000008;


{
 * This flag tells DirectPlay to not allow any new applications to
 * join the session.  Applications already in the session can still
 * create new players.
 }
  DPSESSION_JOINDISABLED	= $00000020;

{
 * This flag tells DirectPlay to detect when remote players 
 * exit abnormally (e.g. their computer or modem gets unplugged)
 }
  DPSESSION_KEEPALIVE	= $00000040;

{
 * This flag tells DirectPlay not to send a message to all players
 * when a players remote data changes
 }
  DPSESSION_NODATAMESSAGES	= $00000080;

{
 * This flag indicates that the session belongs to a secure server
 * and needs user authentication
 }
  DPSESSION_SECURESERVER	= $00000100;

{
 * This flag indicates that the session is private and requirs a password
 * for EnumSessions as well as Open.
 }
  DPSESSION_PRIVATE	= $00000200;

{
 * This flag indicates that the session requires a password for joining.
 }
  DPSESSION_PASSWORDREQUIRED	= $00000400;

{
 * This flag tells DirectPlay to route all messages through the server
 }
  DPSESSION_MULTICASTSERVER	= $00000800;

{
 * This flag tells DirectPlay to only download information about the
 * DPPLAYER_SERVERPLAYER.  
 }
  DPSESSION_CLIENTSERVER	= $00001000;

{
 * DPNAME
 * Used to hold the name of a DirectPlay entity
 * like a player or a group
 }

  DPESC_TIMEDOUT	= $00000001;


{
 * Callback for IDirectPlay2::EnumPlayers
 *              IDirectPlay2::EnumGroups
 *              IDirectPlay2::EnumGroupPlayers
 }



{
 * API's
 }

//{$IFDEF UNICODE}
//const
//  DirectPlayEnumerate	= DirectPlayEnumerateW;
//{$ELSE}
//  DirectPlayEnumerate	= DirectPlayEnumerateA;
//{$ENDIF}// UNICODE



{***************************************************************************
 *
 * IDirectPlay2 (and IDirectPlay2A) Interface
 *
 ***************************************************************************}

//{$UNDEF INTERFACE}
// Error :  #define INTERFACE IDirectPlay2


{***************************************************************************
 *
 * IDirectPlay2 interface macros
 *
 ***************************************************************************}

// Error : //{$IFNDEF __cplusplus} || defined ( CINTERFACE )


// Error :  #define IDirectPlay2_QueryInterface ( p , a , b ) ( p ) - > lpVtbl - > QueryInterface ( p , a , b )
// Error :  #define IDirectPlay2_AddRef ( p ) ( p ) - > lpVtbl - > AddRef ( p )
// Error :  #define IDirectPlay2_Release ( p ) ( p ) - > lpVtbl - > Release ( p )
// Error :  #define IDirectPlay2_AddPlayerToGroup ( p , a , b ) ( p ) - > lpVtbl - > AddPlayerToGroup ( p , a , b )
// Error :  #define IDirectPlay2_Close ( p ) ( p ) - > lpVtbl - > Close ( p )
// Error :  #define IDirectPlay2_CreateGroup ( p , a , b , c , d , e ) ( p ) - > lpVtbl - > CreateGroup ( p , a , b , c , d , e )
// Error :  #define IDirectPlay2_CreatePlayer ( p , a , b , c , d , e , f ) ( p ) - > lpVtbl - > CreatePlayer ( p , a , b , c , d , e , f )
// Error :  #define IDirectPlay2_DeletePlayerFromGroup ( p , a , b ) ( p ) - > lpVtbl - > DeletePlayerFromGroup ( p , a , b )
// Error :  #define IDirectPlay2_DestroyGroup ( p , a ) ( p ) - > lpVtbl - > DestroyGroup ( p , a )
// Error :  #define IDirectPlay2_DestroyPlayer ( p , a ) ( p ) - > lpVtbl - > DestroyPlayer ( p , a )
// Error :  #define IDirectPlay2_EnumGroupPlayers ( p , a , b , c , d , e ) ( p ) - > lpVtbl - > EnumGroupPlayers ( p , a , b , c , d , e )
// Error :  #define IDirectPlay2_EnumGroups ( p , a , b , c , d ) ( p ) - > lpVtbl - > EnumGroups ( p , a , b , c , d )
// Error :  #define IDirectPlay2_EnumPlayers ( p , a , b , c , d ) ( p ) - > lpVtbl - > EnumPlayers ( p , a , b , c , d )
// Error :  #define IDirectPlay2_EnumSessions ( p , a , b , c , d , e ) ( p ) - > lpVtbl - > EnumSessions ( p , a , b , c , d , e )
// Error :  #define IDirectPlay2_GetCaps ( p , a , b ) ( p ) - > lpVtbl - > GetCaps ( p , a , b )
// Error :  #define IDirectPlay2_GetMessageCount ( p , a , b ) ( p ) - > lpVtbl - > GetMessageCount ( p , a , b )
// Error :  #define IDirectPlay2_GetGroupData ( p , a , b , c , d ) ( p ) - > lpVtbl - > GetGroupData ( p , a , b , c , d )
// Error :  #define IDirectPlay2_GetGroupName ( p , a , b , c ) ( p ) - > lpVtbl - > GetGroupName ( p , a , b , c )
// Error :  #define IDirectPlay2_GetPlayerAddress ( p , a , b , c ) ( p ) - > lpVtbl - > GetPlayerAddress ( p , a , b , c )
// Error :  #define IDirectPlay2_GetPlayerCaps ( p , a , b , c ) ( p ) - > lpVtbl - > GetPlayerCaps ( p , a , b , c )
// Error :  #define IDirectPlay2_GetPlayerData ( p , a , b , c , d ) ( p ) - > lpVtbl - > GetPlayerData ( p , a , b , c , d )
// Error :  #define IDirectPlay2_GetPlayerName ( p , a , b , c ) ( p ) - > lpVtbl - > GetPlayerName ( p , a , b , c )
// Error :  #define IDirectPlay2_GetSessionDesc ( p , a , b ) ( p ) - > lpVtbl - > GetSessionDesc ( p , a , b )
// Error :  #define IDirectPlay2_Initialize ( p , a ) ( p ) - > lpVtbl - > Initialize ( p , a )
// Error :  #define IDirectPlay2_Open ( p , a , b ) ( p ) - > lpVtbl - > Open ( p , a , b )
// Error :  #define IDirectPlay2_Receive ( p , a , b , c , d , e ) ( p ) - > lpVtbl - > Receive ( p , a , b , c , d , e )
// Error :  #define IDirectPlay2_Send ( p , a , b , c , d , e ) ( p ) - > lpVtbl - > Send ( p , a , b , c , d , e )
// Error :  #define IDirectPlay2_SetGroupData ( p , a , b , c , d ) ( p ) - > lpVtbl - > SetGroupData ( p , a , b , c , d )
// Error :  #define IDirectPlay2_SetGroupName ( p , a , b , c ) ( p ) - > lpVtbl - > SetGroupName ( p , a , b , c )
// Error :  #define IDirectPlay2_SetPlayerData ( p , a , b , c , d ) ( p ) - > lpVtbl - > SetPlayerData ( p , a , b , c , d )
// Error :  #define IDirectPlay2_SetPlayerName ( p , a , b , c ) ( p ) - > lpVtbl - > SetPlayerName ( p , a , b , c )
// Error :  #define IDirectPlay2_SetSessionDesc ( p , a , b ) ( p ) - > lpVtbl - > SetSessionDesc ( p , a , b )

//{$ELSE}{ C++ }

// Error :  #define IDirectPlay2_QueryInterface ( p , a , b ) ( p ) - > QueryInterface ( a , b )
// Error :  #define IDirectPlay2_AddRef ( p ) ( p ) - > AddRef ( )
// Error :  #define IDirectPlay2_Release ( p ) ( p ) - > Release ( )
// Error :  #define IDirectPlay2_AddPlayerToGroup ( p , a , b ) ( p ) - > AddPlayerToGroup ( a , b )
// Error :  #define IDirectPlay2_Close ( p ) ( p ) - > Close ( )
// Error :  #define IDirectPlay2_CreateGroup ( p , a , b , c , d , e ) ( p ) - > CreateGroup ( a , b , c , d , e )
// Error :  #define IDirectPlay2_CreatePlayer ( p , a , b , c , d , e , f ) ( p ) - > CreatePlayer ( a , b , c , d , e , f )
// Error :  #define IDirectPlay2_DeletePlayerFromGroup ( p , a , b ) ( p ) - > DeletePlayerFromGroup ( a , b )
// Error :  #define IDirectPlay2_DestroyGroup ( p , a ) ( p ) - > DestroyGroup ( a )
// Error :  #define IDirectPlay2_DestroyPlayer ( p , a ) ( p ) - > DestroyPlayer ( a )
// Error :  #define IDirectPlay2_EnumGroupPlayers ( p , a , b , c , d , e ) ( p ) - > EnumGroupPlayers ( a , b , c , d , e )
// Error :  #define IDirectPlay2_EnumGroups ( p , a , b , c , d ) ( p ) - > EnumGroups ( a , b , c , d )
// Error :  #define IDirectPlay2_EnumPlayers ( p , a , b , c , d ) ( p ) - > EnumPlayers ( a , b , c , d )
// Error :  #define IDirectPlay2_EnumSessions ( p , a , b , c , d , e ) ( p ) - > EnumSessions ( a , b , c , d , e )
// Error :  #define IDirectPlay2_GetCaps ( p , a , b ) ( p ) - > GetCaps ( a , b )
// Error :  #define IDirectPlay2_GetMessageCount ( p , a , b ) ( p ) - > GetMessageCount ( a , b )
// Error :  #define IDirectPlay2_GetGroupData ( p , a , b , c , d ) ( p ) - > GetGroupData ( a , b , c , d )
// Error :  #define IDirectPlay2_GetGroupName ( p , a , b , c ) ( p ) - > GetGroupName ( a , b , c )
// Error :  #define IDirectPlay2_GetPlayerAddress ( p , a , b , c ) ( p ) - > GetPlayerAddress ( a , b , c )
// Error :  #define IDirectPlay2_GetPlayerCaps ( p , a , b , c ) ( p ) - > GetPlayerCaps ( a , b , c )
// Error :  #define IDirectPlay2_GetPlayerData ( p , a , b , c , d ) ( p ) - > GetPlayerData ( a , b , c , d )
// Error :  #define IDirectPlay2_GetPlayerName ( p , a , b , c ) ( p ) - > GetPlayerName ( a , b , c )
// Error :  #define IDirectPlay2_GetSessionDesc ( p , a , b ) ( p ) - > GetSessionDesc ( a , b )
// Error :  #define IDirectPlay2_Initialize ( p , a ) ( p ) - > Initialize ( a )
// Error :  #define IDirectPlay2_Open ( p , a , b ) ( p ) - > Open ( a , b )
// Error :  #define IDirectPlay2_Receive ( p , a , b , c , d , e ) ( p ) - > Receive ( a , b , c , d , e )
// Error :  #define IDirectPlay2_Send ( p , a , b , c , d , e ) ( p ) - > Send ( a , b , c , d , e )
// Error :  #define IDirectPlay2_SetGroupData ( p , a , b , c , d ) ( p ) - > SetGroupData ( a , b , c , d )
// Error :  #define IDirectPlay2_SetGroupName ( p , a , b , c ) ( p ) - > SetGroupName ( a , b , c )
// Error :  #define IDirectPlay2_SetPlayerData ( p , a , b , c , d ) ( p ) - > SetPlayerData ( a , b , c , d )
// Error :  #define IDirectPlay2_SetPlayerName ( p , a , b , c ) ( p ) - > SetPlayerName ( a , b , c )
// Error :  #define IDirectPlay2_SetSessionDesc ( p , a , b ) ( p ) - > SetSessionDesc ( a , b )

//{$ENDIF}

{***************************************************************************
 *
 * IDirectPlay3 (and IDirectPlay3A) Interface
 *
 ***************************************************************************}

//{$UNDEF INTERFACE}
// Error :  #define INTERFACE IDirectPlay3


{***************************************************************************
 *
 * IDirectPlay3 interface macros
 *
 ***************************************************************************}

// Error : //{$IFNDEF __cplusplus} || defined ( CINTERFACE )


// Error :  #define IDirectPlay3_QueryInterface ( p , a , b ) ( p ) - > lpVtbl - > QueryInterface ( p , a , b )
// Error :  #define IDirectPlay3_AddRef ( p ) ( p ) - > lpVtbl - > AddRef ( p )
// Error :  #define IDirectPlay3_Release ( p ) ( p ) - > lpVtbl - > Release ( p )
// Error :  #define IDirectPlay3_AddPlayerToGroup ( p , a , b ) ( p ) - > lpVtbl - > AddPlayerToGroup ( p , a , b )
// Error :  #define IDirectPlay3_Close ( p ) ( p ) - > lpVtbl - > Close ( p )
// Error :  #define IDirectPlay3_CreateGroup ( p , a , b , c , d , e ) ( p ) - > lpVtbl - > CreateGroup ( p , a , b , c , d , e )
// Error :  #define IDirectPlay3_CreatePlayer ( p , a , b , c , d , e , f ) ( p ) - > lpVtbl - > CreatePlayer ( p , a , b , c , d , e , f )
// Error :  #define IDirectPlay3_DeletePlayerFromGroup ( p , a , b ) ( p ) - > lpVtbl - > DeletePlayerFromGroup ( p , a , b )
// Error :  #define IDirectPlay3_DestroyGroup ( p , a ) ( p ) - > lpVtbl - > DestroyGroup ( p , a )
// Error :  #define IDirectPlay3_DestroyPlayer ( p , a ) ( p ) - > lpVtbl - > DestroyPlayer ( p , a )
// Error :  #define IDirectPlay3_EnumGroupPlayers ( p , a , b , c , d , e ) ( p ) - > lpVtbl - > EnumGroupPlayers ( p , a , b , c , d , e )
// Error :  #define IDirectPlay3_EnumGroups ( p , a , b , c , d ) ( p ) - > lpVtbl - > EnumGroups ( p , a , b , c , d )
// Error :  #define IDirectPlay3_EnumPlayers ( p , a , b , c , d ) ( p ) - > lpVtbl - > EnumPlayers ( p , a , b , c , d )
// Error :  #define IDirectPlay3_EnumSessions ( p , a , b , c , d , e ) ( p ) - > lpVtbl - > EnumSessions ( p , a , b , c , d , e )
// Error :  #define IDirectPlay3_GetCaps ( p , a , b ) ( p ) - > lpVtbl - > GetCaps ( p , a , b )
// Error :  #define IDirectPlay3_GetMessageCount ( p , a , b ) ( p ) - > lpVtbl - > GetMessageCount ( p , a , b )
// Error :  #define IDirectPlay3_GetGroupData ( p , a , b , c , d ) ( p ) - > lpVtbl - > GetGroupData ( p , a , b , c , d )
// Error :  #define IDirectPlay3_GetGroupName ( p , a , b , c ) ( p ) - > lpVtbl - > GetGroupName ( p , a , b , c )
// Error :  #define IDirectPlay3_GetPlayerAddress ( p , a , b , c ) ( p ) - > lpVtbl - > GetPlayerAddress ( p , a , b , c )
// Error :  #define IDirectPlay3_GetPlayerCaps ( p , a , b , c ) ( p ) - > lpVtbl - > GetPlayerCaps ( p , a , b , c )
// Error :  #define IDirectPlay3_GetPlayerData ( p , a , b , c , d ) ( p ) - > lpVtbl - > GetPlayerData ( p , a , b , c , d )
// Error :  #define IDirectPlay3_GetPlayerName ( p , a , b , c ) ( p ) - > lpVtbl - > GetPlayerName ( p , a , b , c )
// Error :  #define IDirectPlay3_GetSessionDesc ( p , a , b ) ( p ) - > lpVtbl - > GetSessionDesc ( p , a , b )
// Error :  #define IDirectPlay3_Initialize ( p , a ) ( p ) - > lpVtbl - > Initialize ( p , a )
// Error :  #define IDirectPlay3_Open ( p , a , b ) ( p ) - > lpVtbl - > Open ( p , a , b )
// Error :  #define IDirectPlay3_Receive ( p , a , b , c , d , e ) ( p ) - > lpVtbl - > Receive ( p , a , b , c , d , e )
// Error :  #define IDirectPlay3_Send ( p , a , b , c , d , e ) ( p ) - > lpVtbl - > Send ( p , a , b , c , d , e )
// Error :  #define IDirectPlay3_SetGroupData ( p , a , b , c , d ) ( p ) - > lpVtbl - > SetGroupData ( p , a , b , c , d )
// Error :  #define IDirectPlay3_SetGroupName ( p , a , b , c ) ( p ) - > lpVtbl - > SetGroupName ( p , a , b , c )
// Error :  #define IDirectPlay3_SetPlayerData ( p , a , b , c , d ) ( p ) - > lpVtbl - > SetPlayerData ( p , a , b , c , d )
// Error :  #define IDirectPlay3_SetPlayerName ( p , a , b , c ) ( p ) - > lpVtbl - > SetPlayerName ( p , a , b , c )
// Error :  #define IDirectPlay3_SetSessionDesc ( p , a , b ) ( p ) - > lpVtbl - > SetSessionDesc ( p , a , b )
// Error :  #define IDirectPlay3_AddGroupToGroup ( p , a , b ) ( p ) - > lpVtbl - > AddGroupToGroup ( p , a , b )
// Error :  #define IDirectPlay3_CreateGroupInGroup ( p , a , b , c , d , e , f ) ( p ) - > lpVtbl - > CreateGroupInGroup ( p , a , b , c , d , e , f )
// Error :  #define IDirectPlay3_DeleteGroupFromGroup ( p , a , b ) ( p ) - > lpVtbl - > DeleteGroupFromGroup ( p , a , b )
// Error :  #define IDirectPlay3_EnumConnections ( p , a , b , c , d ) ( p ) - > lpVtbl - > EnumConnections ( p , a , b , c , d )
// Error :  #define IDirectPlay3_EnumGroupsInGroup ( p , a , b , c , d , e ) ( p ) - > lpVtbl - > EnumGroupsInGroup ( p , a , b , c , d , e )
// Error :  #define IDirectPlay3_GetGroupConnectionSettings ( p , a , b , c , d ) ( p ) - > lpVtbl - > GetGroupConnectionSettings ( p , a , b , c , d )
// Error :  #define IDirectPlay3_InitializeConnection ( p , a , b ) ( p ) - > lpVtbl - > InitializeConnection ( p , a , b )
// Error :  #define IDirectPlay3_SecureOpen ( p , a , b , c , d ) ( p ) - > lpVtbl - > SecureOpen ( p , a , b , c , d )
// Error :  #define IDirectPlay3_SendChatMessage ( p , a , b , c , d ) ( p ) - > lpVtbl - > SendChatMessage ( p , a , b , c , d )
// Error :  #define IDirectPlay3_SetGroupConnectionSettings ( p , a , b , c ) ( p ) - > lpVtbl - > SetGroupConnectionSettings ( p , a , b , c )
// Error :  #define IDirectPlay3_StartSession ( p , a , b ) ( p ) - > lpVtbl - > StartSession ( p , a , b )
// Error :  #define IDirectPlay3_GetGroupFlags ( p , a , b ) ( p ) - > lpVtbl - > GetGroupFlags ( p , a , b )
// Error :  #define IDirectPlay3_GetGroupParent ( p , a , b ) ( p ) - > lpVtbl - > GetGroupParent ( p , a , b )
// Error :  #define IDirectPlay3_GetPlayerAccount ( p , a , b , c , d ) ( p ) - > lpVtbl - > GetPlayerAccount ( p , a , b , c , d )
// Error :  #define IDirectPlay3_GetPlayerFlags ( p , a , b ) ( p ) - > lpVtbl - > GetPlayerFlags ( p , a , b )

//{$ELSE}{ C++ }

// Error :  #define IDirectPlay3_QueryInterface ( p , a , b ) ( p ) - > QueryInterface ( a , b )
// Error :  #define IDirectPlay3_AddRef ( p ) ( p ) - > AddRef ( )
// Error :  #define IDirectPlay3_Release ( p ) ( p ) - > Release ( )
// Error :  #define IDirectPlay3_AddPlayerToGroup ( p , a , b ) ( p ) - > AddPlayerToGroup ( a , b )
// Error :  #define IDirectPlay3_Close ( p ) ( p ) - > Close ( )
// Error :  #define IDirectPlay3_CreateGroup ( p , a , b , c , d , e ) ( p ) - > CreateGroup ( a , b , c , d , e )
// Error :  #define IDirectPlay3_CreatePlayer ( p , a , b , c , d , e , f ) ( p ) - > CreatePlayer ( a , b , c , d , e , f )
// Error :  #define IDirectPlay3_DeletePlayerFromGroup ( p , a , b ) ( p ) - > DeletePlayerFromGroup ( a , b )
// Error :  #define IDirectPlay3_DestroyGroup ( p , a ) ( p ) - > DestroyGroup ( a )
// Error :  #define IDirectPlay3_DestroyPlayer ( p , a ) ( p ) - > DestroyPlayer ( a )
// Error :  #define IDirectPlay3_EnumGroupPlayers ( p , a , b , c , d , e ) ( p ) - > EnumGroupPlayers ( a , b , c , d , e )
// Error :  #define IDirectPlay3_EnumGroups ( p , a , b , c , d ) ( p ) - > EnumGroups ( a , b , c , d )
// Error :  #define IDirectPlay3_EnumPlayers ( p , a , b , c , d ) ( p ) - > EnumPlayers ( a , b , c , d )
// Error :  #define IDirectPlay3_EnumSessions ( p , a , b , c , d , e ) ( p ) - > EnumSessions ( a , b , c , d , e )
// Error :  #define IDirectPlay3_GetCaps ( p , a , b ) ( p ) - > GetCaps ( a , b )
// Error :  #define IDirectPlay3_GetMessageCount ( p , a , b ) ( p ) - > GetMessageCount ( a , b )
// Error :  #define IDirectPlay3_GetGroupData ( p , a , b , c , d ) ( p ) - > GetGroupData ( a , b , c , d )
// Error :  #define IDirectPlay3_GetGroupName ( p , a , b , c ) ( p ) - > GetGroupName ( a , b , c )
// Error :  #define IDirectPlay3_GetPlayerAddress ( p , a , b , c ) ( p ) - > GetPlayerAddress ( a , b , c )
// Error :  #define IDirectPlay3_GetPlayerCaps ( p , a , b , c ) ( p ) - > GetPlayerCaps ( a , b , c )
// Error :  #define IDirectPlay3_GetPlayerData ( p , a , b , c , d ) ( p ) - > GetPlayerData ( a , b , c , d )
// Error :  #define IDirectPlay3_GetPlayerName ( p , a , b , c ) ( p ) - > GetPlayerName ( a , b , c )
// Error :  #define IDirectPlay3_GetSessionDesc ( p , a , b ) ( p ) - > GetSessionDesc ( a , b )
// Error :  #define IDirectPlay3_Initialize ( p , a ) ( p ) - > Initialize ( a )
// Error :  #define IDirectPlay3_Open ( p , a , b ) ( p ) - > Open ( a , b )
// Error :  #define IDirectPlay3_Receive ( p , a , b , c , d , e ) ( p ) - > Receive ( a , b , c , d , e )
// Error :  #define IDirectPlay3_Send ( p , a , b , c , d , e ) ( p ) - > Send ( a , b , c , d , e )
// Error :  #define IDirectPlay3_SetGroupData ( p , a , b , c , d ) ( p ) - > SetGroupData ( a , b , c , d )
// Error :  #define IDirectPlay3_SetGroupName ( p , a , b , c ) ( p ) - > SetGroupName ( a , b , c )
// Error :  #define IDirectPlay3_SetPlayerData ( p , a , b , c , d ) ( p ) - > SetPlayerData ( a , b , c , d )
// Error :  #define IDirectPlay3_SetPlayerName ( p , a , b , c ) ( p ) - > SetPlayerName ( a , b , c )
// Error :  #define IDirectPlay3_SetSessionDesc ( p , a , b ) ( p ) - > SetSessionDesc ( a , b )
// Error :  #define IDirectPlay3_AddGroupToGroup ( p , a , b ) ( p ) - > AddGroupToGroup ( a , b )
// Error :  #define IDirectPlay3_CreateGroupInGroup ( p , a , b , c , d , e , f ) ( p ) - > CreateGroupInGroup ( a , b , c , d , e , f )
// Error :  #define IDirectPlay3_DeleteGroupFromGroup ( p , a , b ) ( p ) - > DeleteGroupFromGroup ( a , b )
// Error :  #define IDirectPlay3_EnumConnections ( p , a , b , c , d ) ( p ) - > EnumConnections ( a , b , c , d )
// Error :  #define IDirectPlay3_EnumGroupsInGroup ( p , a , b , c , d , e ) ( p ) - > EnumGroupsInGroup ( a , b , c , d , e )
// Error :  #define IDirectPlay3_GetGroupConnectionSettings ( p , a , b , c , d ) ( p ) - > GetGroupConnectionSettings ( a , b , c , d )
// Error :  #define IDirectPlay3_InitializeConnection ( p , a , b ) ( p ) - > InitializeConnection ( a , b )
// Error :  #define IDirectPlay3_SecureOpen ( p , a , b , c , d ) ( p ) - > SecureOpen ( a , b , c , d )
// Error :  #define IDirectPlay3_SendChatMessage ( p , a , b , c , d ) ( p ) - > SendChatMessage ( a , b , c , d )
// Error :  #define IDirectPlay3_SetGroupConnectionSettings ( p , a , b , c ) ( p ) - > SetGroupConnectionSettings ( a , b , c )
// Error :  #define IDirectPlay3_StartSession ( p , a , b ) ( p ) - > StartSession ( a , b )
// Error :  #define IDirectPlay3_GetGroupFlags ( p , a , b ) ( p ) - > GetGroupFlags ( a , b )
// Error :  #define IDirectPlay3_GetGroupParent ( p , a , b ) ( p ) - > GetGroupParent ( a , b )
// Error :  #define IDirectPlay3_GetPlayerAccount ( p , a , b , c , d ) ( p ) - > GetPlayerAccount ( a , b , c , d )
// Error :  #define IDirectPlay3_GetPlayerFlags ( p , a , b ) ( p ) - > GetPlayerFlags ( a , b )

//{$ENDIF}

{***************************************************************************
 *
 * EnumConnections API flags
 *
 ***************************************************************************}

{
 * Enumerate Service Providers
 }
  DPCONNECTION_DIRECTPLAY	= $00000001;

{
 * Enumerate Lobby Providers
 }
  DPCONNECTION_DIRECTPLAYLOBBY	= $00000002;


{***************************************************************************
 *
 * EnumPlayers API flags
 *
 ***************************************************************************}

{
 * Enumerate all players in the current session
 }
  DPENUMPLAYERS_ALL	= $00000000;
  DPENUMGROUPS_ALL	= DPENUMPLAYERS_ALL;


{
 * Enumerate only local (created by this application) players
 * or groups
 }
  DPENUMPLAYERS_LOCAL	= $00000008;
  DPENUMGROUPS_LOCAL	= DPENUMPLAYERS_LOCAL;

{
 * Enumerate only remote (non-local) players
 * or groups
 }
  DPENUMPLAYERS_REMOTE	= $00000010;
  DPENUMGROUPS_REMOTE	= DPENUMPLAYERS_REMOTE;

{
 * Enumerate groups along with the players
 }
  DPENUMPLAYERS_GROUP	= $00000020;

{
 * Enumerate players or groups in another session 
 * (must supply lpguidInstance)
 }
  DPENUMPLAYERS_SESSION	= $00000080;
  DPENUMGROUPS_SESSION	= DPENUMPLAYERS_SESSION;

{
 * Enumerate server players
 }
  DPENUMPLAYERS_SERVERPLAYER	= $00000100;

{
 * Enumerate spectator players
 }
  DPENUMPLAYERS_SPECTATOR	= $00000200;

{
 * Enumerate shortcut groups
 }
  DPENUMGROUPS_SHORTCUT	= $00000400;

{
 * Enumerate staging area groups
 }
  DPENUMGROUPS_STAGINGAREA	= $00000800;

{***************************************************************************
 *
 * CreatePlayer API flags
 *
 ***************************************************************************}

{
 * This flag indicates that this player should be designated
 * the server player. The app should specify this at CreatePlayer.
 }
  DPPLAYER_SERVERPLAYER	= DPENUMPLAYERS_SERVERPLAYER;

{
 * This flag indicates that this player should be designated
 * a spectator. The app should specify this at CreatePlayer.
 }
  DPPLAYER_SPECTATOR	= DPENUMPLAYERS_SPECTATOR;

{
 * This flag indicates that this player was created locally.
 * (returned from GetPlayerFlags)
 }
  DPPLAYER_LOCAL	= DPENUMPLAYERS_LOCAL;

{***************************************************************************
 *
 * CreateGroup API flags
 *
 ***************************************************************************}


{
 * This flag indicates that the StartSession can be called on the group.
 * The app should specify this at CreateGroup, or CreateGroupInGroup.
 }
  DPGROUP_STAGINGAREA	= DPENUMGROUPS_STAGINGAREA;

{
 * This flag indicates that this group was created locally.
 * (returned from GetGroupFlags)
 }
  DPGROUP_LOCAL	= DPENUMGROUPS_LOCAL;

{***************************************************************************
 *
 * EnumSessions API flags
 *
 ***************************************************************************}

{
 * Enumerate sessions which can be joined
 }
  DPENUMSESSIONS_AVAILABLE	= $00000001;

{
 * Enumerate all sessions even if they can't be joined.
 }
  DPENUMSESSIONS_ALL	= $00000002;




{
 * Start an asynchronous enum sessions
 }
  DPENUMSESSIONS_ASYNC	= $00000010;

{
 * Stop an asynchronous enum sessions
 }
  DPENUMSESSIONS_STOPASYNC	= $00000020;

{
 * Enumerate sessions even if they require a password
 }
  DPENUMSESSIONS_PASSWORDREQUIRED	= $00000040;

{
 * Return status about progress of enumeration instead of
 * showing any status dialogs.
 }
  DPENUMSESSIONS_RETURNSTATUS	= $00000080;

{***************************************************************************
 *
 * GetCaps and GetPlayerCaps API flags
 *
 ***************************************************************************}

{
 * The latency returned should be for guaranteed message sending.
 * Default is non-guaranteed messaging.
 }
  DPGETCAPS_GUARANTEED	= $00000001;


{***************************************************************************
 *
 * GetGroupData, GetPlayerData API flags
 * Remote and local Group/Player data is maintained separately. 
 * Default is DPGET_REMOTE.
 *
 ***************************************************************************}

{
 * Get the remote data (set by any DirectPlay object in
 * the session using DPSET_REMOTE)
 }
  DPGET_REMOTE	= $00000000;

{
 * Get the local data (set by this DirectPlay object 
 * using DPSET_LOCAL)
 }
  DPGET_LOCAL	= $00000001;


{***************************************************************************
 *
 * Open API flags
 *
 ***************************************************************************}

{
 * Join the session that is described by the DPSESSIONDESC2 structure
 }
  DPOPEN_JOIN	= $00000001;

{
 * Create a new session as described by the DPSESSIONDESC2 structure
 }
  DPOPEN_CREATE	= $00000002;

{
 * Return status about progress of open instead of showing
 * any status dialogs.
 }
  DPOPEN_RETURNSTATUS	= DPENUMSESSIONS_RETURNSTATUS;

{***************************************************************************
 *
 * DPLCONNECTION flags
 *
 ***************************************************************************}

{
 * This application should create a new session as
 * described by the DPSESIONDESC structure
 }
  DPLCONNECTION_CREATESESSION	= DPOPEN_CREATE;

{
 * This application should join the session described by 
 * the DPSESIONDESC structure with the lpAddress data
 }
  DPLCONNECTION_JOINSESSION	= DPOPEN_JOIN;

{***************************************************************************
 *
 * Receive API flags
 * Default is DPRECEIVE_ALL
 *
 ***************************************************************************}

{
 * Get the first message in the queue
 }
  DPRECEIVE_ALL	= $00000001;

{
 * Get the first message in the queue directed to a specific player 
 }
  DPRECEIVE_TOPLAYER	= $00000002;

{
 * Get the first message in the queue from a specific player
 }
  DPRECEIVE_FROMPLAYER	= $00000004;

{
 * Get the message but don't remove it from the queue
 }
  DPRECEIVE_PEEK	= $00000008;


{***************************************************************************
 *
 * Send API flags
 *
 ***************************************************************************}

{
 * Send the message using a guaranteed send method.
 * Default is non-guaranteed.
 }
  DPSEND_GUARANTEED	= $00000001;


{
 * This flag is obsolete. It is ignored by DirectPlay
 }
  DPSEND_HIGHPRIORITY	= $00000002;

{
 * This flag is obsolete. It is ignored by DirectPlay
 }
  DPSEND_OPENSTREAM	= $00000008;

{
 * This flag is obsolete. It is ignored by DirectPlay
 }
  DPSEND_CLOSESTREAM	= $00000010;

{
 * Send the message digitally signed to ensure authenticity.
 }
  DPSEND_SIGNED	= $00000020;

{
 * Send the message with encryption to ensure privacy.
 }
  DPSEND_ENCRYPTED	= $00000040;


{***************************************************************************
 *
 * SetGroupData, SetGroupName, SetPlayerData, SetPlayerName,
 * SetSessionDesc API flags.
 * Default is DPSET_REMOTE.
 *
 ***************************************************************************}

{ 
 * Propagate the data to all players in the session
 }
  DPSET_REMOTE	= $00000000;

{
 * Do not propagate the data to other players
 }
  DPSET_LOCAL	= $00000001;

{
 * Used with DPSET_REMOTE, use guaranteed message send to
 * propagate the data
 }
  DPSET_GUARANTEED	= $00000002;


{***************************************************************************
 *
 * DirectPlay system messages and message data structures
 *
 * All system message come 'From' player DPID_SYSMSG.  To determine what type 
 * of message it is, cast the lpData from Receive to DPMSG_GENERIC and check
 * the dwType member against one of the following DPSYS_xxx constants. Once
 * a match is found, cast the lpData to the corresponding of the DPMSG_xxx
 * structures to access the data of the message.
 *
 ***************************************************************************}

{
 * A new player or group has been created in the session
 * Use DPMSG_CREATEPLAYERORGROUP.  Check dwPlayerType to see if it
 * is a player or a group.
 }
  DPSYS_CREATEPLAYERORGROUP	= $0003;

{
 * A player has been deleted from the session
 * Use DPMSG_DESTROYPLAYERORGROUP
 }
  DPSYS_DESTROYPLAYERORGROUP	= $0005;

{
 * A player has been added to a group
 * Use DPMSG_ADDPLAYERTOGROUP
 }
  DPSYS_ADDPLAYERTOGROUP	= $0007;

{
 * A player has been removed from a group
 * Use DPMSG_DELETEPLAYERFROMGROUP
 }
  DPSYS_DELETEPLAYERFROMGROUP	= $0021;

{
 * This DirectPlay object lost its connection with all the
 * other players in the session.
 * Use DPMSG_SESSIONLOST.
 }
  DPSYS_SESSIONLOST	= $0031;

{
 * The current host has left the session.
 * This DirectPlay object is now the host.
 * Use DPMSG_HOST.
 }
  DPSYS_HOST	= $0101;

{
 * The remote data associated with a player or
 * group has changed. Check dwPlayerType to see
 * if it is a player or a group
 * Use DPMSG_SETPLAYERORGROUPDATA
 }
  DPSYS_SETPLAYERORGROUPDATA	= $0102;

{
 * The name of a player or group has changed.
 * Check dwPlayerType to see if it is a player
 * or a group.
 * Use DPMSG_SETPLAYERORGROUPNAME
 }
  DPSYS_SETPLAYERORGROUPNAME	= $0103;

{
 * The session description has changed.
 * Use DPMSG_SETSESSIONDESC
 }
  DPSYS_SETSESSIONDESC	= $0104;

{
 * A group has been added to a group
 * Use DPMSG_ADDGROUPTOGROUP
 }
  DPSYS_ADDGROUPTOGROUP	= $0105;

{
 * A group has been removed from a group
 * Use DPMSG_DELETEGROUPFROMGROUP
 }
  DPSYS_DELETEGROUPFROMGROUP	= $0106;

{
 * A secure player-player message has arrived.
 * Use DPMSG_SECUREMESSAGE
 }
  DPSYS_SECUREMESSAGE	= $0107;

{
 * Start a new session.
 * Use DPMSG_STARTSESSION
 }
  DPSYS_STARTSESSION	= $0108;

{
 * A chat message has arrived
 * Use DPMSG_CHAT
 }
  DPSYS_CHAT	= $0109;

{
 * Used in the dwPlayerType field to indicate if it applies to a group
 * or a player
 }
  DPPLAYERTYPE_GROUP	= $00000000;
  DPPLAYERTYPE_PLAYER	= $00000001;


{
 * DPMSG_GENERIC
 * Generic message structure used to identify the message type.
 }

  DP_OK	= S_OK;
  DPERR_ALREADYINITIALIZED	= $88770005;
  DPERR_ACCESSDENIED	= $8877000A;
  DPERR_ACTIVEPLAYERS	= $88770014;
  DPERR_BUFFERTOOSMALL	= $8877001E;
  DPERR_CANTADDPLAYER	= $88770028;
  DPERR_CANTCREATEGROUP	= $88770032;
  DPERR_CANTCREATEPLAYER	= $8877003C;
  DPERR_CANTCREATESESSION	= $88770046;
  DPERR_CAPSNOTAVAILABLEYET	= $88770050;
  DPERR_EXCEPTION	= $8877005A;
  DPERR_GENERIC	= E_FAIL;
  DPERR_INVALIDFLAGS	= $88770078;
  DPERR_INVALIDOBJECT	= $88770082;
  DPERR_INVALIDPARAM	= E_INVALIDARG;
  DPERR_INVALIDPARAMS	= DPERR_INVALIDPARAM;
  DPERR_INVALIDPLAYER	= $88770096;
  DPERR_INVALIDGROUP	= $8877009B;
  DPERR_NOCAPS	= $887700A0;
  DPERR_NOCONNECTION	= $887700AA;
  DPERR_NOMEMORY	= E_OUTOFMEMORY;
  DPERR_OUTOFMEMORY	= DPERR_NOMEMORY;
  DPERR_NOMESSAGES	= $887700BE;
  DPERR_NONAMESERVERFOUND	= $887700C8;
  DPERR_NOPLAYERS	= $887700D2;
  DPERR_NOSESSIONS	= $887700DC;

  DPERR_PENDING	= $8000000A;  //for Delphi2 (modified by SANDMAN)
  //DPERR_PENDING	= E_PENDING;

  DPERR_SENDTOOBIG	= $887700E6;
  DPERR_TIMEOUT	= $887700F0;
  DPERR_UNAVAILABLE	= $887700FA;
  DPERR_UNSUPPORTED	= E_NOTIMPL;
  DPERR_BUSY	= $8877010E;
  DPERR_USERCANCEL	= $88770118;
  DPERR_NOINTERFACE	= E_NOINTERFACE;
  DPERR_CANNOTCREATESERVER	= $88770122;
  DPERR_PLAYERLOST	= $8877012C;
  DPERR_SESSIONLOST	= $88770136;
  DPERR_UNINITIALIZED	= $88770140;
  DPERR_NONEWPLAYERS	= $8877014A;
  DPERR_INVALIDPASSWORD	= $88770154;
  DPERR_CONNECTING	= $8877015E;


  DPERR_BUFFERTOOLARGE	= $887703E8;
  DPERR_CANTCREATEPROCESS	= $887703F2;
  DPERR_APPNOTSTARTED	= $887703FC;
  DPERR_INVALIDINTERFACE	= $88770406;
  DPERR_NOSERVICEPROVIDER	= $88770410;
  DPERR_UNKNOWNAPPLICATION	= $8877041A;
  DPERR_NOTLOBBIED	= $8877042E;
  DPERR_SERVICEPROVIDERLOADED	= $88770438;
  DPERR_ALREADYREGISTERED	= $88770442;
  DPERR_NOTREGISTERED	= $8877044C;

//
// Security related errors
//
  DPERR_AUTHENTICATIONFAILED	= $887707D0;
  DPERR_CANTLOADSSPI	= $887707DA;
  DPERR_ENCRYPTIONFAILED	= $887707E4;
  DPERR_SIGNFAILED	= $887707EE;
  DPERR_CANTLOADSECURITYPACKAGE	= $887707F8;
  DPERR_ENCRYPTIONNOTSUPPORTED	= $88770802;
  DPERR_CANTLOADCAPI	= $8877080C;
  DPERR_NOTLOGGEDIN	= $88770816;
  DPERR_LOGONDENIED	= $88770820;


  DPOPEN_OPENSESSION	= DPOPEN_JOIN;
  DPOPEN_CREATESESSION	= DPOPEN_CREATE;
  DPSEND_GUARANTEE	= DPSEND_GUARANTEED;
  DPCAPS_NAMESERVER	= DPCAPS_ISHOST;

{***************************************************************************
 *
 * 	dplay 1.0 obsolete structures + interfaces
 *	Included for compatibility only. New apps should
 *	use IDirectPlay2
 *
 ***************************************************************************}

// define this to ignore obsolete interfaces and constants
//{$IFNDEF IDIRECTPLAY2_OR_GREATER}





{***************************************************************************
 *
 * IDirectPlay interface macros
 *
 ***************************************************************************}

// Error : //{$IFNDEF __cplusplus} || defined ( CINTERFACE )


// Error :  #define IDirectPlay_AddPlayerToGroup ( p , a , b ) ( p ) - > lpVtbl - > AddPlayerToGroup ( p , a , b )
// Error :  #define IDirectPlay_Close ( p ) ( p ) - > lpVtbl - > Close ( p )
// Error :  #define IDirectPlay_CreateGroup ( p , a , b , c ) ( p ) - > lpVtbl - > CreateGroup ( p , a , b , c )
// Error :  #define IDirectPlay_CreatePlayer ( p , a , b , c , d ) ( p ) - > lpVtbl - > CreatePlayer ( p , a , b , c , d )
// Error :  #define IDirectPlay_DeletePlayerFromGroup ( p , a , b ) ( p ) - > lpVtbl - > DeletePlayerFromGroup ( p , a , b )
// Error :  #define IDirectPlay_DestroyGroup ( p , a ) ( p ) - > lpVtbl - > DestroyGroup ( p , a )
// Error :  #define IDirectPlay_DestroyPlayer ( p , a ) ( p ) - > lpVtbl - > DestroyPlayer ( p , a )
// Error :  #define IDirectPlay_EnableNewPlayers ( p , a ) ( p ) - > lpVtbl - > EnableNewPlayers ( p , a )
// Error :  #define IDirectPlay_EnumGroupPlayers ( p , a , b , c , d ) ( p ) - > lpVtbl - > EnumGroupPlayers ( p , a , b , c , d )
// Error :  #define IDirectPlay_EnumGroups ( p , a , b , c , d ) ( p ) - > lpVtbl - > EnumGroups ( p , a , b , c , d )
// Error :  #define IDirectPlay_EnumPlayers ( p , a , b , c , d ) ( p ) - > lpVtbl - > EnumPlayers ( p , a , b , c , d )
// Error :  #define IDirectPlay_EnumSessions ( p , a , b , c , d , e ) ( p ) - > lpVtbl - > EnumSessions ( p , a , b , c , d , e )
// Error :  #define IDirectPlay_GetCaps ( p , a ) ( p ) - > lpVtbl - > GetCaps ( p , a )
// Error :  #define IDirectPlay_GetMessageCount ( p , a , b ) ( p ) - > lpVtbl - > GetMessageCount ( p , a , b )
// Error :  #define IDirectPlay_GetPlayerCaps ( p , a , b ) ( p ) - > lpVtbl - > GetPlayerCaps ( p , a , b )
// Error :  #define IDirectPlay_GetPlayerName ( p , a , b , c , d , e ) ( p ) - > lpVtbl - > GetPlayerName ( p , a , b , c , d , e )
// Error :  #define IDirectPlay_Initialize ( p , a ) ( p ) - > lpVtbl - > Initialize ( p , a )
// Error :  #define IDirectPlay_Open ( p , a ) ( p ) - > lpVtbl - > Open ( p , a )
// Error :  #define IDirectPlay_Receive ( p , a , b , c , d , e ) ( p ) - > lpVtbl - > Receive ( p , a , b , c , d , e )
// Error :  #define IDirectPlay_SaveSession ( p , a ) ( p ) - > lpVtbl - > SaveSession ( p , a )
// Error :  #define IDirectPlay_Send ( p , a , b , c , d , e ) ( p ) - > lpVtbl - > Send ( p , a , b , c , d , e )
// Error :  #define IDirectPlay_SetPlayerName ( p , a , b , c ) ( p ) - > lpVtbl - > SetPlayerName ( p , a , b , c )

//{$ELSE}{ C++ }

// Error :  #define IDirectPlay_AddPlayerToGroup ( p , a , b ) ( p ) - > AddPlayerToGroup ( a , b )
// Error :  #define IDirectPlay_Close ( p ) ( p ) - > Close ( )
// Error :  #define IDirectPlay_CreateGroup ( p , a , b , c ) ( p ) - > CreateGroup ( a , b , c )
// Error :  #define IDirectPlay_CreatePlayer ( p , a , b , c , d ) ( p ) - > CreatePlayer ( a , b , c , d )
// Error :  #define IDirectPlay_DeletePlayerFromGroup ( p , a , b ) ( p ) - > DeletePlayerFromGroup ( a , b )
// Error :  #define IDirectPlay_DestroyGroup ( p , a ) ( p ) - > DestroyGroup ( a )
// Error :  #define IDirectPlay_DestroyPlayer ( p , a ) ( p ) - > DestroyPlayer ( a )
// Error :  #define IDirectPlay_EnableNewPlayers ( p , a ) ( p ) - > EnableNewPlayers ( a )
// Error :  #define IDirectPlay_EnumGroupPlayers ( p , a , b , c , d ) ( p ) - > EnumGroupPlayers ( a , b , c , d )
// Error :  #define IDirectPlay_EnumGroups ( p , a , b , c , d ) ( p ) - > EnumGroups ( a , b , c , d )
// Error :  #define IDirectPlay_EnumPlayers ( p , a , b , c , d ) ( p ) - > EnumPlayers ( a , b , c , d )
// Error :  #define IDirectPlay_EnumSessions ( p , a , b , c , d , e ) ( p ) - > EnumSessions ( a , b , c , d , e )
// Error :  #define IDirectPlay_GetCaps ( p , a ) ( p ) - > GetCaps ( a )
// Error :  #define IDirectPlay_GetMessageCount ( p , a , b ) ( p ) - > GetMessageCount ( a , b )
// Error :  #define IDirectPlay_GetPlayerCaps ( p , a , b ) ( p ) - > GetPlayerCaps ( a , b )
// Error :  #define IDirectPlay_GetPlayerName ( p , a , b , c , d , e ) ( p ) - > GetPlayerName ( a , b , c , d , e )
// Error :  #define IDirectPlay_Initialize ( p , a ) ( p ) - > Initialize ( a )
// Error :  #define IDirectPlay_Open ( p , a ) ( p ) - > Open ( a )
// Error :  #define IDirectPlay_Receive ( p , a , b , c , d , e ) ( p ) - > Receive ( a , b , c , d , e )
// Error :  #define IDirectPlay_SaveSession ( p , a ) ( p ) - > SaveSession ( a )
// Error :  #define IDirectPlay_Send ( p , a , b , c , d , e ) ( p ) - > Send ( a , b , c , d , e )
// Error :  #define IDirectPlay_SetPlayerName ( p , a , b , c ) ( p ) - > SetPlayerName ( a , b , c )

//{$ENDIF}



//{$ENDIF}// IDIRECTPLAY2_OR_GREATER

{***************************************************************************
 *
 * IDirectPlay macros (included regardless of IDIRECTPLAY2_OR_GREATER flag)
 *
 ***************************************************************************}

// Error : //{$IFNDEF __cplusplus} || defined ( CINTERFACE )

// Error :  #define IDirectPlay_QueryInterface ( p , a , b ) ( p ) - > lpVtbl - > QueryInterface ( p , a , b )
// Error :  #define IDirectPlay_AddRef ( p ) ( p ) - > lpVtbl - > AddRef ( p )
// Error :  #define IDirectPlay_Release ( p ) ( p ) - > lpVtbl - > Release ( p )

//{$ELSE}

// Error :  #define IDirectPlay_QueryInterface ( p , a , b ) ( p ) - > QueryInterface ( a , b )
// Error :  #define IDirectPlay_AddRef ( p ) ( p ) - > AddRef ( )
// Error :  #define IDirectPlay_Release ( p ) ( p ) - > Release ( )

//{$ENDIF}// IDirectPlay interface macros 

//{$IFDEF __cplusplus}
// };
//{$ENDIF}

//{$ENDIF}

  function DirectPlayEnumerateA(Para1: LPDPENUMDPCALLBACKA; Para2: Pointer): HRESULT; stdcall;
  function DirectPlayEnumerateW(Para1: LPDPENUMDPCALLBACK; Para2: Pointer): HRESULT; stdcall;
  function DirectPlayCreate(PGUID: PGUID; var lplpDP: IDIRECTPLAY; var pUnk: IUnknown): HRESULT; stdcall;

implementation

const
  dplayDLL = 'dplay.dll';

  function DirectPlayEnumerateA; external dplayDLL name 'DirectPlayEnumerateA';
  function DirectPlayEnumerateW; external dplayDLL name 'DirectPlayEnumerateW';
  function DirectPlayCreate; external dplayDLL name 'DirectPlayCreate';

end.
