DirectPlay8.pas
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:143k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1.   //
  2.   // COM definition for DirectPlay8 Thread Pool interface
  3.   //
  4.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8ThreadPool);'}
  5.   {$EXTERNALSYM IDirectPlay8ThreadPool}
  6.   IDirectPlay8ThreadPool = interface(IUnknown)
  7.     ['{0d22ee73-4a46-4a0d-89b2-045b4d666425}']
  8.     (*** IDirectPlay8ThreadPool methods ***)
  9.     function Initialize(pvUserContext: Pointer; pfn: TFNDPNMessageHandler; dwFlags: DWORD): HResult; stdcall;
  10.     function Close(dwFlags: DWORD): HResult; stdcall;
  11.     function GetThreadCount(dwProcessorNum: DWORD; out pdwNumThreads: DWORD; dwFlags: DWORD): HResult; stdcall;
  12.     function SetThreadCount(dwProcessorNum: DWORD; dwNumThreads: DWORD; dwFlags: DWORD): HResult; stdcall;
  13.     function DoWork(dwAllowedTimeSlice: DWORD; dwFlags: DWORD): HResult; stdcall;
  14.   end;
  15.   //
  16.   // COM definition for DirectPlay8 NAT Resolver interface
  17.   //
  18.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8NATResolver);'}
  19.   {$EXTERNALSYM IDirectPlay8NATResolver}
  20.   IDirectPlay8NATResolver = interface(IUnknown)
  21.     ['{a9e213f2-9a60-486f-bf3b-53408b6d1cbb}']
  22.     (*** IDirectPlay8NATResolver methods ***)
  23.     function Initialize(pvUserContext: Pointer; pfn: TFNDPNMessageHandler; dwFlags: DWORD): HResult; stdcall;
  24.     function Start(ppDevices: PIDirectPlay8Address; dwNumDevices: DWORD; dwFlags: DWORD): HResult; stdcall;
  25.     function Close(dwFlags: DWORD): HResult; stdcall;
  26.     function EnumDevices(pSPInfoBuffer: PDPNServiceProviderInfo; var pdwBufferSize: DWORD; out pdwNumDevices: DWORD; dwFlags: DWORD): HResult; stdcall;
  27.     function GetAddresses(ppAddresses: PIDirectPlay8Address; out pdwNumAddresses: DWORD; dwFlags: DWORD): HResult; stdcall;
  28.   end;
  29. (****************************************************************************
  30.  *
  31.  * DirectPlay8 Interface IIDs
  32.  *
  33.  ****************************************************************************)
  34.   // {5102DACD-241B-11d3-AEA7-006097B01411}
  35.   IID_IDirectPlay8Client = IDirectPlay8Client;
  36.   {$EXTERNALSYM IID_IDirectPlay8Client}
  37.   // {5102DACE-241B-11d3-AEA7-006097B01411}
  38.   IID_IDirectPlay8Server = IDirectPlay8Server;
  39.   {$EXTERNALSYM IID_IDirectPlay8Server}
  40.   // {5102DACF-241B-11d3-AEA7-006097B01411}
  41.   IID_IDirectPlay8Peer = IDirectPlay8Peer;
  42.   {$EXTERNALSYM IID_IDirectPlay8Peer}
  43.   // IIDs added for DirectX 9
  44.   // {0D22EE73-4A46-4a0d-89B2-045B4D666425}
  45.   IID_IDirectPlay8ThreadPool = IDirectPlay8ThreadPool;
  46.   {$EXTERNALSYM IID_IDirectPlay8ThreadPool}
  47.   // {A9E213F2-9A60-486f-BF3B-53408B6D1CBB}
  48.   IID_IDirectPlay8NATResolver = IDirectPlay8NATResolver;
  49.   {$EXTERNALSYM IID_IDirectPlay8NATResolver}
  50. (*==========================================================================
  51.  *
  52.  *  Copyright (C) 2000 Microsoft Corporation.  All Rights Reserved.
  53.  *
  54.  *  File:       DPLobby.h
  55.  *  Content:    DirectPlay8 Lobby Include File
  56.  *
  57.  ***************************************************************************)
  58. (****************************************************************************
  59.  *
  60.  * DirectPlay8Lobby Structures (Non-Message)
  61.  *
  62.  ****************************************************************************)
  63.   //
  64.   // Information on a registered game
  65.   //
  66.   PDPLApplicationInfo = ^TDPLApplicationInfo;
  67.   _DPL_APPLICATION_INFO = packed record
  68.     guidApplication: TGUID;            // GUID of the application
  69.     pwszApplicationName: PWideChar;    // Name of the application
  70.     dwNumRunning: DWORD;               // # of instances of this application running
  71.     dwNumWaiting: DWORD;               // # of instances of this application waiting
  72.     dwFlags: DWORD;                    // Flags
  73.   end;
  74.   {$EXTERNALSYM _DPL_APPLICATION_INFO}
  75.   DPL_APPLICATION_INFO = _DPL_APPLICATION_INFO;
  76.   {$EXTERNALSYM DPL_APPLICATION_INFO}
  77.   TDPLApplicationInfo = _DPL_APPLICATION_INFO;
  78.   //
  79.   // Settings to be used for connecting / hosting a game session
  80.   //
  81.   PDPLConnectionSettings = ^TDPLConnectionSettings;
  82.   _DPL_CONNECTION_SETTINGS = packed record
  83.     dwSize: DWORD;                    // Size of this structure
  84.     dwFlags: DWORD;                // Connection settings flags (DPLCONNECTSETTINGS_...)
  85.     dpnAppDesc: TDPNApplicationDesc;             // Application desc for the associated DirectPlay session
  86.     pdp8HostAddress: IDirectPlay8Address;       // Address of host to connect to
  87.     ppdp8DeviceAddresses: IDirectPlay8Address; // Address of device to connect from / host on
  88.     cNumDeviceAddresses: DWORD;    // # of addresses specified in ppdp8DeviceAddresses
  89.     pwszPlayerName: PWideChar;         // Name to give the player
  90.   end;
  91.   {$EXTERNALSYM _DPL_CONNECTION_SETTINGS}
  92.   DPL_CONNECTION_SETTINGS = _DPL_CONNECTION_SETTINGS;
  93.   {$EXTERNALSYM DPL_CONNECTION_SETTINGS}
  94.   TDPLConnectionSettings = _DPL_CONNECTION_SETTINGS;
  95.   //
  96.   // Information for performing a lobby connect
  97.   // (ConnectApplication)
  98.   //
  99.   PDPLConnectInfo = ^TDPLConnectInfo;
  100.   _DPL_CONNECT_INFO = packed record
  101.     dwSize: DWORD;                                  // Size of this structure
  102.     dwFlags: DWORD;                                 // Flags (DPLCONNECT_...)
  103.     guidApplication: TGUID;                         // GUID of application to launch
  104.     pdplConnectionSettings: PDPLConnectionSettings; // Settings application should use
  105.     pvLobbyConnectData: Pointer;                    // User defined data block
  106.     dwLobbyConnectDataSize: DWORD;                  // Size of user defined data block
  107.   end;
  108.   {$EXTERNALSYM _DPL_CONNECT_INFO}
  109.   DPL_CONNECT_INFO = _DPL_CONNECT_INFO;
  110.   {$EXTERNALSYM DPL_CONNECT_INFO}
  111.   TDPLConnectInfo = _DPL_CONNECT_INFO;
  112.   //
  113.   // Information for registering an application
  114.   // (RegisterApplication)
  115.   //
  116.   PDPLProgramDesc = ^TDPLProgramDesc;
  117.   _DPL_PROGRAM_DESC = packed record
  118.     dwSize: DWORD;
  119.     dwFlags: DWORD;
  120.     guidApplication: TGUID;               // Application GUID
  121.     pwszApplicationName: PWideChar;       // Unicode application name
  122.     pwszCommandLine: PWideChar;           // Unicode command line arguments
  123.     pwszCurrentDirectory: PWideChar;      // Unicode current directory
  124.     pwszDescription: PWideChar;           // Unicode application description
  125.     pwszExecutableFilename: PWideChar;    // Unicode filename of application executable
  126.     pwszExecutablePath: PWideChar;        // Unicode path of application executable
  127.     pwszLauncherFilename: PWideChar;      // Unicode filename of launcher executable
  128.     pwszLauncherPath: PWideChar;          // Unicode path of launcher executable
  129.   end;
  130.   {$EXTERNALSYM _DPL_PROGRAM_DESC}
  131.   DPL_PROGRAM_DESC = _DPL_PROGRAM_DESC;
  132.   {$EXTERNALSYM DPL_PROGRAM_DESC}
  133.   TDPLProgramDesc = _DPL_PROGRAM_DESC;
  134. (****************************************************************************
  135.  *
  136.  * DirectPlay8 Lobby Message Structures
  137.  *
  138.  ****************************************************************************)
  139.   //
  140.   // A connection was established
  141.   // (DPL_MSGID_CONNECT)
  142.   //
  143.   PDPLMessageConnect = ^TDPLMessageConnect;
  144.   _DPL_MESSAGE_CONNECT = packed record
  145.     dwSize: DWORD;                 // Size of this structure
  146.     hConnectId: TDPNHandle;        // Handle of new connection
  147.     pdplConnectionSettings: PDPLConnectionSettings; // Connection settings for this connection
  148.     pvLobbyConnectData: Pointer;   // User defined lobby data block
  149.     dwLobbyConnectDataSize: DWORD; // Size of user defined lobby data block
  150.     pvConnectionContext: Pointer;  // Context value for this connection (user set)
  151.   end;
  152.   {$EXTERNALSYM _DPL_MESSAGE_CONNECT}
  153.   DPL_MESSAGE_CONNECT = _DPL_MESSAGE_CONNECT;
  154.   {$EXTERNALSYM DPL_MESSAGE_CONNECT}
  155.   TDPLMessageConnect = _DPL_MESSAGE_CONNECT;
  156.   //
  157.   // Connection settings have been updated
  158.   // (DPL_MSGID_CONNECTION_SETTINGS)
  159.   //
  160.   PDPLMessageConnectionSettings = ^TDPLMessageConnectionSettings;
  161.   _DPL_MESSAGE_CONNECTION_SETTINGS = packed record
  162.     dwSize: DWORD;                // Size of this structure
  163.     hSender: TDPNHandle;          // Handle of the connection for these settings
  164.     pdplConnectionSettings: PDPLConnectionSettings;     // Connection settings
  165.     pvConnectionContext: Pointer; // Context value for this connection
  166.   end;
  167.   {$EXTERNALSYM _DPL_MESSAGE_CONNECTION_SETTINGS}
  168.   DPL_MESSAGE_CONNECTION_SETTINGS = _DPL_MESSAGE_CONNECTION_SETTINGS;
  169.   {$EXTERNALSYM DPL_MESSAGE_CONNECTION_SETTINGS}
  170.   TDPLMessageConnectionSettings = _DPL_MESSAGE_CONNECTION_SETTINGS;
  171.   //
  172.   // A connection has been disconnected
  173.   // (DPL_MSGID_DISCONNECT)
  174.   //
  175.   PDPLMessageDisconnect = ^TDPLMessageDisconnect;
  176.   _DPL_MESSAGE_DISCONNECT = packed record
  177.     dwSize: DWORD;                // Size of this structure
  178.     hDisconnectId: TDPNHandle;    // Handle of the connection that was terminated
  179.     hrReason: HRESULT;            // Reason the connection was broken
  180.     pvConnectionContext: Pointer; // Context value for this connection
  181.   end;
  182.   {$EXTERNALSYM _DPL_MESSAGE_DISCONNECT}
  183.   DPL_MESSAGE_DISCONNECT = _DPL_MESSAGE_DISCONNECT;
  184.   {$EXTERNALSYM DPL_MESSAGE_DISCONNECT}
  185.   TDPLMessageDisconnect = _DPL_MESSAGE_DISCONNECT;
  186.   //
  187.   // Data was received through a connection
  188.   // (DPL_MSGID_RECEIVE)
  189.   //
  190.   PDPLMessageReceive = ^TDPLMessageReceive;
  191.   _DPL_MESSAGE_RECEIVE = packed record
  192.     dwSize: DWORD;                  // Size of this structure
  193.     hSender: TDPNHandle;            // Handle of the connection that is from
  194.     pBuffer: PByte;                 // Contents of the message
  195.     dwBufferSize: DWORD;            // Size of the message context
  196.     pvConnectionContext: Pointer;   // Context value for this connection
  197.   end;
  198.   {$EXTERNALSYM _DPL_MESSAGE_RECEIVE}
  199.   DPL_MESSAGE_RECEIVE = _DPL_MESSAGE_RECEIVE;
  200.   {$EXTERNALSYM DPL_MESSAGE_RECEIVE}
  201.   TDPLMessageReceive = _DPL_MESSAGE_RECEIVE;
  202.   //
  203.   // Current status of the associated connection
  204.   // (DPL_MSGID_SESSION_STATUS)
  205.   //
  206.   PDPLMessageSessionStatus = ^TDPLMessageSessionStatus;
  207.   _DPL_MESSAGE_SESSION_STATUS = packed record
  208.     dwSize: DWORD;                // Size of this structure
  209.     hSender: TDPNHandle;          // Handle of the connection that this is from
  210.     dwStatus: DWORD;              // Status (DPLSESSION_...)
  211.     pvConnectionContext: Pointer; // Context value for this connection
  212.   end;
  213.   {$EXTERNALSYM _DPL_MESSAGE_SESSION_STATUS}
  214.   DPL_MESSAGE_SESSION_STATUS = _DPL_MESSAGE_SESSION_STATUS;
  215.   {$EXTERNALSYM DPL_MESSAGE_SESSION_STATUS}
  216.   TDPLMessageSessionStatus = _DPL_MESSAGE_SESSION_STATUS;
  217. (****************************************************************************
  218.  *
  219.  * DirectPlay8Lobby Create
  220.  *
  221.  ****************************************************************************)
  222.  
  223. (*
  224.  * This function is no longer supported.  It is recommended that CoCreateInstance be used to create
  225.  * DirectPlay8 lobby objects.
  226.  *
  227.  * extern HRESULT WINAPI DirectPlay8LobbyCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown);
  228.  *
  229.  *)
  230. (****************************************************************************
  231.  *
  232.  * DirectPlay8 Functions
  233.  *
  234.  ****************************************************************************)
  235.   //
  236.   // COM definition for DirectPlayLobbyClient
  237.   //
  238.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8LobbyClient);'}
  239.   {$EXTERNALSYM IDirectPlay8LobbyClient}
  240.   IDirectPlay8LobbyClient = interface(IUnknown)
  241.     ['{819074a2-016c-11d3-ae14-006097b01411}']
  242.     // IDirectPlayLobbyClient methods
  243.     function Initialize(pvUserContext: Pointer; pfn: TFNDPNMessageHandler; dwFlags: DWORD): HResult; stdcall;
  244.     function EnumLocalPrograms(pGuidApplication: PGUID; pEnumData: PByte; var pdwEnumData: DWORD; out pdwItems: DWORD; dwFlags: DWORD): HResult; stdcall;
  245.     function ConnectApplication(const pdplConnectionInfo: PDPLConnectInfo;
  246.       pvConnectionContext: Pointer; hApplication: PDPNHandle; dwTimeOut, dwFlags: DWORD): HResult; stdcall;
  247.     function Send(hConnection: TDPNHandle; pBuffer: PByte; pBufferSize, dwFlags: DWORD): HResult; stdcall;
  248.     function ReleaseApplication(hConnection: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
  249.     function Close(dwFlags: DWORD): HResult; stdcall;
  250.     function GetConnectionSettings(hConnection: TDPNHandle; pdplSessionInfo: PDPLConnectionSettings; var pdwInfoSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  251.     function SetConnectionSettings(hConnection: TDPNHandle; const pdplSessionInfo: TDPLConnectionSettings; dwFlags: DWORD): HResult; stdcall;
  252.   end;
  253.   //
  254.   // COM definition for DirectPlayLobbiedApplication
  255.   //
  256.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8LobbiedApplication);'}
  257.   {$EXTERNALSYM IDirectPlay8LobbiedApplication}
  258.   IDirectPlay8LobbiedApplication = interface(IUnknown)
  259.     ['{819074a3-016c-11d3-ae14-006097b01411}']
  260.     // IDirectPlayLobbiedApplication methods
  261.     function Initialize(pvUserContext: Pointer; pfn: TFNDPNMessageHandler; pdpnhConnection: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  262.     function RegisterProgram(const pdplProgramDesc: TDPLProgramDesc; dwFlags: DWORD): HResult; stdcall;
  263.     function UnRegisterProgram(const pguidApplication: TGUID; dwFlags: DWORD): HResult; stdcall;
  264.     function Send(hConnection: TDPNHandle; pBuffer: PByte; pBufferSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  265.     function SetAppAvailable(fAvailable: BOOL;  dwFlags: DWORD): HResult; stdcall;
  266.     function UpdateStatus(hConnection: TDPNHandle; dwStatus, dwFlags: DWORD): HResult; stdcall;
  267.     function Close(dwFlags: DWORD): HResult; stdcall;
  268.     function GetConnectionSettings(hConnection: TDPNHandle; pdplSessionInfo: PDPLConnectionSettings; var pdwInfoSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  269.     function SetConnectionSettings(hConnection: TDPNHandle; const pdplSessionInfo: TDPLConnectionSettings; dwFlags: DWORD): HResult; stdcall;
  270.   end;
  271. const
  272. (****************************************************************************
  273.  *
  274.  * DirectPlay8Lobby CLSIDs
  275.  *
  276.  ****************************************************************************)
  277.   // {667955AD-6B3B-43ca-B949-BC69B5BAFF7F}
  278.   CLSID_DirectPlay8LobbiedApplication: TGUID = '{667955ad-6b3b-43ca-b949-bc69b5baff7f}';
  279.   {$EXTERNALSYM CLSID_DirectPlay8LobbiedApplication}
  280.   // {3B2B6775-70B6-45af-8DEA-A209C69559F3}
  281.   CLSID_DirectPlay8LobbyClient: TGUID = '{3b2b6775-70b6-45af-8dea-a209c69559f3}';
  282.   {$EXTERNALSYM CLSID_DirectPlay8LobbyClient}
  283. (****************************************************************************
  284.  *
  285.  * DirectPlay8Lobby Interface IIDs
  286.  *
  287.  ****************************************************************************)
  288.   // {819074A3-016C-11d3-AE14-006097B01411}
  289.   IID_IDirectPlay8LobbiedApplication = IDirectPlay8LobbiedApplication;
  290.   {$EXTERNALSYM IID_IDirectPlay8LobbiedApplication}
  291.   // {819074A2-016C-11d3-AE14-006097B01411}
  292.   IID_IDirectPlay8LobbyClient = IDirectPlay8LobbyClient;
  293.   {$EXTERNALSYM IID_IDirectPlay8LobbyClient}
  294. (****************************************************************************
  295.  *
  296.  * DirectPlay8 Lobby Message IDs
  297.  *
  298.  ****************************************************************************)
  299.   DPL_MSGID_LOBBY                     = $8000;
  300.   {$EXTERNALSYM DPL_MSGID_LOBBY}
  301.   DPL_MSGID_RECEIVE                   = ($0001 or DPL_MSGID_LOBBY);
  302.   {$EXTERNALSYM DPL_MSGID_RECEIVE}
  303.   DPL_MSGID_CONNECT                   = ($0002 or DPL_MSGID_LOBBY);
  304.   {$EXTERNALSYM DPL_MSGID_CONNECT}
  305.   DPL_MSGID_DISCONNECT                = ($0003 or DPL_MSGID_LOBBY);
  306.   {$EXTERNALSYM DPL_MSGID_DISCONNECT}
  307.   DPL_MSGID_SESSION_STATUS            = ($0004 or DPL_MSGID_LOBBY);
  308.   {$EXTERNALSYM DPL_MSGID_SESSION_STATUS}
  309.   DPL_MSGID_CONNECTION_SETTINGS       = ($0005 or DPL_MSGID_LOBBY);
  310.   {$EXTERNALSYM DPL_MSGID_CONNECTION_SETTINGS}
  311. (****************************************************************************
  312.  *
  313.  * DirectPlay8Lobby Constants
  314.  *
  315.  ****************************************************************************)
  316.   //
  317.   // Specifies that operation should be performed on all open connections
  318.   //
  319.   DPLHANDLE_ALLCONNECTIONS     = $FFFFFFFF;
  320.   {$EXTERNALSYM DPLHANDLE_ALLCONNECTIONS}
  321.   //
  322.   // The associated game session has suceeded in connecting / hosting
  323.   //
  324.   DPLSESSION_CONNECTED         = $0001;
  325.   {$EXTERNALSYM DPLSESSION_CONNECTED}
  326.   // The associated game session failed connecting / hosting
  327.   //
  328.   DPLSESSION_COULDNOTCONNECT   = $0002;
  329.   {$EXTERNALSYM DPLSESSION_COULDNOTCONNECT}
  330.   //
  331.   // The associated game session has disconnected
  332.   //
  333.   DPLSESSION_DISCONNECTED      = $0003;
  334.   {$EXTERNALSYM DPLSESSION_DISCONNECTED}
  335.   //
  336.   // The associated game session has terminated
  337.   //
  338.   DPLSESSION_TERMINATED        = $0004;
  339.   {$EXTERNALSYM DPLSESSION_TERMINATED}
  340.   //
  341.   // The associated game session's host has migrated
  342.   //
  343.   DPLSESSION_HOSTMIGRATED      = $0005;
  344.   {$EXTERNALSYM DPLSESSION_HOSTMIGRATED}
  345.   //
  346.   // The associated game session's host has migrated to the local client
  347.   //
  348.   DPLSESSION_HOSTMIGRATEDHERE  = $0006;
  349.   {$EXTERNALSYM DPLSESSION_HOSTMIGRATEDHERE}
  350. (****************************************************************************
  351.  *
  352.  * DirectPlay8 Lobby Flags
  353.  *
  354.  ****************************************************************************)
  355.   //
  356.   // Do not automatically make the lobby app unavailable when a connection is established
  357.   //
  358.   DPLAVAILABLE_ALLOWMULTIPLECONNECT   = $0001;
  359.   {$EXTERNALSYM DPLAVAILABLE_ALLOWMULTIPLECONNECT}
  360.   //
  361.   // Launch a new instance of the application to connect to
  362.   //
  363.   DPLCONNECT_LAUNCHNEW                = $0001;
  364.   {$EXTERNALSYM DPLCONNECT_LAUNCHNEW}
  365.   //
  366.   // Launch a new instance of the application if one is not waiting
  367.   //
  368.   DPLCONNECT_LAUNCHNOTFOUND           = $0002;
  369.   {$EXTERNALSYM DPLCONNECT_LAUNCHNOTFOUND}
  370.   //
  371.   // When starting the associated game session, start it as a host
  372.   //
  373.   DPLCONNECTSETTINGS_HOST             = $0001;
  374.   {$EXTERNALSYM DPLCONNECTSETTINGS_HOST}
  375.   //
  376.   // Disable parameter validation
  377.   //
  378.   DPLINITIALIZE_DISABLEPARAMVAL       = $0001;
  379.   {$EXTERNALSYM DPLINITIALIZE_DISABLEPARAMVAL}
  380. ///// Part 2 of dplay8.h /////
  381. (*==========================================================================;
  382.  *
  383.  *  Copyright (C) 1998-2000 Microsoft Corporation.  All Rights Reserved.
  384.  *
  385.  *  File: DPlay8.h
  386.  *  Content: DirectPlay8 include file
  387.  *
  388.  ***************************************************************************)
  389. (****************************************************************************
  390.  *
  391.  * DIRECTPLAY8 ERRORS
  392.  *
  393.  * Errors are represented by negative values and cannot be combined.
  394.  *
  395.  ****************************************************************************)
  396. const
  397.   _DPN_FACILITY_CODE = $015;
  398.   {$EXTERNALSYM _DPN_FACILITY_CODE}
  399.   _DPNHRESULT_BASE   = $8000;
  400.   {$EXTERNALSYM _DPNHRESULT_BASE}
  401.   MAKE_DPNHRESULT_R  = (1 shl 31) or (_DPN_FACILITY_CODE shl 16) + _DPNHRESULT_BASE;
  402. // #define MAKE_DPNHRESULT( code )  MAKE_HRESULT( 1, _DPN_FACILITY_CODE, ( code + _DPNHRESULT_BASE ) )
  403. function MAKE_DPNHRESULT(Code: DWORD): DWORD;
  404. {$EXTERNALSYM MAKE_DPNHRESULT}
  405. const
  406.   DPN_OK                    = S_OK;
  407.   {$EXTERNALSYM DPN_OK}
  408.   DPNSUCCESS_EQUAL          = HRESULT((0 shl 31) or (_DPN_FACILITY_CODE shl 16) or ($5 + _DPNHRESULT_BASE)); // MAKE_HRESULT( 0, _DPN_FACILITY_CODE, ( 0x5 + _DPNHRESULT_BASE ) )
  409.   {$EXTERNALSYM DPNSUCCESS_EQUAL}
  410.   DPNSUCCESS_NOPLAYERSINGROUP = HRESULT((0 shl 31) or (_DPN_FACILITY_CODE shl 16) or ($8 + _DPNHRESULT_BASE)); // MAKE_HRESULT( 0, _DPN_FACILITY_CODE, ( 0x8 + _DPNHRESULT_BASE ) ) // added for DirectX 9
  411.   {$EXTERNALSYM DPNSUCCESS_NOPLAYERSINGROUP}
  412.   DPNSUCCESS_NOTEQUAL       = HRESULT((0 shl 31) or (_DPN_FACILITY_CODE shl 16) or ($A + _DPNHRESULT_BASE)); // MAKE_HRESULT( 0, _DPN_FACILITY_CODE, (0x0A + _DPNHRESULT_BASE ) )
  413.   {$EXTERNALSYM DPNSUCCESS_NOTEQUAL}
  414.   DPNSUCCESS_PENDING        = HRESULT((0 shl 31) or (_DPN_FACILITY_CODE shl 16) or ($e + _DPNHRESULT_BASE)); // MAKE_HRESULT( 0, _DPN_FACILITY_CODE, (0x0e + _DPNHRESULT_BASE ) )
  415.   {$EXTERNALSYM DPNSUCCESS_PENDING}
  416.   DPNERR_ABORTED                 = HRESULT(MAKE_DPNHRESULT_R + $30); // MAKE_DPNHRESULT( 0x30 )
  417.   {$EXTERNALSYM DPNERR_ABORTED}
  418.   DPNERR_ADDRESSING              = HRESULT(MAKE_DPNHRESULT_R + $40); // MAKE_DPNHRESULT( 0x40 )
  419.   {$EXTERNALSYM DPNERR_ADDRESSING}
  420.   DPNERR_ALREADYCLOSING          = HRESULT(MAKE_DPNHRESULT_R + $50); // MAKE_DPNHRESULT( 0x50 )
  421.   {$EXTERNALSYM DPNERR_ALREADYCLOSING}
  422.   DPNERR_ALREADYCONNECTED        = HRESULT(MAKE_DPNHRESULT_R + $60); // MAKE_DPNHRESULT( 0x60 )
  423.   {$EXTERNALSYM DPNERR_ALREADYCONNECTED}
  424.   DPNERR_ALREADYDISCONNECTING    = HRESULT(MAKE_DPNHRESULT_R + $70); // MAKE_DPNHRESULT( 0x70 )
  425.   {$EXTERNALSYM DPNERR_ALREADYDISCONNECTING}
  426.   DPNERR_ALREADYINITIALIZED      = HRESULT(MAKE_DPNHRESULT_R + $80); // MAKE_DPNHRESULT(  0x80 )
  427.   {$EXTERNALSYM DPNERR_ALREADYINITIALIZED}
  428.   DPNERR_ALREADYREGISTERED       = HRESULT(MAKE_DPNHRESULT_R + $90); // MAKE_DPNHRESULT(  0x90 )
  429.   {$EXTERNALSYM DPNERR_ALREADYREGISTERED}
  430.   DPNERR_BUFFERTOOSMALL          = HRESULT(MAKE_DPNHRESULT_R + $100); // MAKE_DPNHRESULT( 0x100 )
  431.   {$EXTERNALSYM DPNERR_BUFFERTOOSMALL}
  432.   DPNERR_CANNOTCANCEL            = HRESULT(MAKE_DPNHRESULT_R + $110); // MAKE_DPNHRESULT( 0x110 )
  433.   {$EXTERNALSYM DPNERR_CANNOTCANCEL}
  434.   DPNERR_CANTCREATEGROUP         = HRESULT(MAKE_DPNHRESULT_R + $120); // MAKE_DPNHRESULT( 0x120 )
  435.   {$EXTERNALSYM DPNERR_CANTCREATEGROUP}
  436.   DPNERR_CANTCREATEPLAYER        = HRESULT(MAKE_DPNHRESULT_R + $130); // MAKE_DPNHRESULT( 0x130 )
  437.   {$EXTERNALSYM DPNERR_CANTCREATEPLAYER}
  438.   DPNERR_CANTLAUNCHAPPLICATION   = HRESULT(MAKE_DPNHRESULT_R + $140); // MAKE_DPNHRESULT( 0x140 )
  439.   {$EXTERNALSYM DPNERR_CANTLAUNCHAPPLICATION}
  440.   DPNERR_CONNECTING              = HRESULT(MAKE_DPNHRESULT_R + $150); // MAKE_DPNHRESULT( 0x150 )
  441.   {$EXTERNALSYM DPNERR_CONNECTING}
  442.   DPNERR_CONNECTIONLOST          = HRESULT(MAKE_DPNHRESULT_R + $160); // MAKE_DPNHRESULT( 0x160 )
  443.   {$EXTERNALSYM DPNERR_CONNECTIONLOST}
  444.   DPNERR_CONVERSION              = HRESULT(MAKE_DPNHRESULT_R + $170); // MAKE_DPNHRESULT( 0x170 )
  445.   {$EXTERNALSYM DPNERR_CONVERSION}
  446.   DPNERR_DATATOOLARGE            = HRESULT(MAKE_DPNHRESULT_R + $175); // MAKE_DPNHRESULT( 0x175 )
  447.   {$EXTERNALSYM DPNERR_DATATOOLARGE}
  448.   DPNERR_DOESNOTEXIST            = HRESULT(MAKE_DPNHRESULT_R + $180); // MAKE_DPNHRESULT( 0x180 )
  449.   {$EXTERNALSYM DPNERR_DOESNOTEXIST}
  450.   DPNERR_DPNSVRNOTAVAILABLE      = HRESULT(MAKE_DPNHRESULT_R + $185); // MAKE_DPNHRESULT( 0x185 )
  451.   {$EXTERNALSYM DPNERR_DPNSVRNOTAVAILABLE}
  452.   DPNERR_DUPLICATECOMMAND        = HRESULT(MAKE_DPNHRESULT_R + $190); // MAKE_DPNHRESULT( 0x190 )
  453.   {$EXTERNALSYM DPNERR_DUPLICATECOMMAND}
  454.   DPNERR_ENDPOINTNOTRECEIVING    = HRESULT(MAKE_DPNHRESULT_R + $200); // MAKE_DPNHRESULT( 0x200 )
  455.   {$EXTERNALSYM DPNERR_ENDPOINTNOTRECEIVING}
  456.   DPNERR_ENUMQUERYTOOLARGE       = HRESULT(MAKE_DPNHRESULT_R + $210); // MAKE_DPNHRESULT( 0x210 )
  457.   {$EXTERNALSYM DPNERR_ENUMQUERYTOOLARGE}
  458.   DPNERR_ENUMRESPONSETOOLARGE    = HRESULT(MAKE_DPNHRESULT_R + $220); // MAKE_DPNHRESULT( 0x220 )
  459.   {$EXTERNALSYM DPNERR_ENUMRESPONSETOOLARGE}
  460.   DPNERR_EXCEPTION               = HRESULT(MAKE_DPNHRESULT_R + $230); // MAKE_DPNHRESULT( 0x230 )
  461.   {$EXTERNALSYM DPNERR_EXCEPTION}
  462.   DPNERR_GENERIC                 = E_FAIL;
  463.   {$EXTERNALSYM DPNERR_GENERIC}
  464.   DPNERR_GROUPNOTEMPTY           = HRESULT(MAKE_DPNHRESULT_R + $240); // MAKE_DPNHRESULT( 0x240 )
  465.   {$EXTERNALSYM DPNERR_GROUPNOTEMPTY}
  466.   DPNERR_HOSTING                 = HRESULT(MAKE_DPNHRESULT_R + $250); // MAKE_DPNHRESULT( 0x250 )
  467.   {$EXTERNALSYM DPNERR_HOSTING}
  468.   DPNERR_HOSTREJECTEDCONNECTION  = HRESULT(MAKE_DPNHRESULT_R + $260); // MAKE_DPNHRESULT( 0x260 )
  469.   {$EXTERNALSYM DPNERR_HOSTREJECTEDCONNECTION}
  470.   DPNERR_HOSTTERMINATEDSESSION   = HRESULT(MAKE_DPNHRESULT_R + $270); // MAKE_DPNHRESULT( 0x270 )
  471.   {$EXTERNALSYM DPNERR_HOSTTERMINATEDSESSION}
  472.   DPNERR_INCOMPLETEADDRESS       = HRESULT(MAKE_DPNHRESULT_R + $280); // MAKE_DPNHRESULT( 0x280 )
  473.   {$EXTERNALSYM DPNERR_INCOMPLETEADDRESS}
  474.   DPNERR_INVALIDADDRESSFORMAT    = HRESULT(MAKE_DPNHRESULT_R + $290); // MAKE_DPNHRESULT( 0x290 )
  475.   {$EXTERNALSYM DPNERR_INVALIDADDRESSFORMAT}
  476.   DPNERR_INVALIDAPPLICATION      = HRESULT(MAKE_DPNHRESULT_R + $300); // MAKE_DPNHRESULT( 0x300 )
  477.   {$EXTERNALSYM DPNERR_INVALIDAPPLICATION}
  478.   DPNERR_INVALIDCOMMAND          = HRESULT(MAKE_DPNHRESULT_R + $310); // MAKE_DPNHRESULT( 0x310 )
  479.   {$EXTERNALSYM DPNERR_INVALIDCOMMAND}
  480.   DPNERR_INVALIDDEVICEADDRESS    = HRESULT(MAKE_DPNHRESULT_R + $320); // MAKE_DPNHRESULT( 0x320 )
  481.   {$EXTERNALSYM DPNERR_INVALIDDEVICEADDRESS}
  482.   DPNERR_INVALIDENDPOINT         = HRESULT(MAKE_DPNHRESULT_R + $330); // MAKE_DPNHRESULT( 0x330 )
  483.   {$EXTERNALSYM DPNERR_INVALIDENDPOINT}
  484.   DPNERR_INVALIDFLAGS            = HRESULT(MAKE_DPNHRESULT_R + $340); // MAKE_DPNHRESULT( 0x340 )
  485.   {$EXTERNALSYM DPNERR_INVALIDFLAGS}
  486.   DPNERR_INVALIDGROUP            = HRESULT(MAKE_DPNHRESULT_R + $350); // MAKE_DPNHRESULT( 0x350 )
  487.   {$EXTERNALSYM DPNERR_INVALIDGROUP}
  488.   DPNERR_INVALIDHANDLE           = HRESULT(MAKE_DPNHRESULT_R + $360); // MAKE_DPNHRESULT( 0x360 )
  489.   {$EXTERNALSYM DPNERR_INVALIDHANDLE}
  490.   DPNERR_INVALIDHOSTADDRESS      = HRESULT(MAKE_DPNHRESULT_R + $370); // MAKE_DPNHRESULT( 0x370 )
  491.   {$EXTERNALSYM DPNERR_INVALIDHOSTADDRESS}
  492.   DPNERR_INVALIDINSTANCE         = HRESULT(MAKE_DPNHRESULT_R + $380); // MAKE_DPNHRESULT( 0x380 )
  493.   {$EXTERNALSYM DPNERR_INVALIDINSTANCE}
  494.   DPNERR_INVALIDINTERFACE        = HRESULT(MAKE_DPNHRESULT_R + $390); // MAKE_DPNHRESULT( 0x390 )
  495.   {$EXTERNALSYM DPNERR_INVALIDINTERFACE}
  496.   DPNERR_INVALIDOBJECT           = HRESULT(MAKE_DPNHRESULT_R + $400); // MAKE_DPNHRESULT( 0x400 )
  497.   {$EXTERNALSYM DPNERR_INVALIDOBJECT}
  498.   DPNERR_INVALIDPARAM            = E_INVALIDARG;
  499.   {$EXTERNALSYM DPNERR_INVALIDPARAM}
  500.   DPNERR_INVALIDPASSWORD         = HRESULT(MAKE_DPNHRESULT_R + $410); // MAKE_DPNHRESULT( 0x410 )
  501.   {$EXTERNALSYM DPNERR_INVALIDPASSWORD}
  502.   DPNERR_INVALIDPLAYER           = HRESULT(MAKE_DPNHRESULT_R + $420); // MAKE_DPNHRESULT( 0x420 )
  503.   {$EXTERNALSYM DPNERR_INVALIDPLAYER}
  504.   DPNERR_INVALIDPOINTER          = E_POINTER;
  505.   {$EXTERNALSYM DPNERR_INVALIDPOINTER}
  506.   DPNERR_INVALIDPRIORITY         = HRESULT(MAKE_DPNHRESULT_R + $430); // MAKE_DPNHRESULT( 0x430 )
  507.   {$EXTERNALSYM DPNERR_INVALIDPRIORITY}
  508.   DPNERR_INVALIDSTRING           = HRESULT(MAKE_DPNHRESULT_R + $440); // MAKE_DPNHRESULT( 0x440 )
  509.   {$EXTERNALSYM DPNERR_INVALIDSTRING}
  510.   DPNERR_INVALIDURL              = HRESULT(MAKE_DPNHRESULT_R + $450); // MAKE_DPNHRESULT( 0x450 )
  511.   {$EXTERNALSYM DPNERR_INVALIDURL}
  512.   DPNERR_INVALIDVERSION          = HRESULT(MAKE_DPNHRESULT_R + $460); // MAKE_DPNHRESULT( 0x460 )
  513.   {$EXTERNALSYM DPNERR_INVALIDVERSION}
  514.   DPNERR_NOCAPS                  = HRESULT(MAKE_DPNHRESULT_R + $470); // MAKE_DPNHRESULT( 0x470 )
  515.   {$EXTERNALSYM DPNERR_NOCAPS}
  516.   DPNERR_NOCONNECTION            = HRESULT(MAKE_DPNHRESULT_R + $480); // MAKE_DPNHRESULT( 0x480 )
  517.   {$EXTERNALSYM DPNERR_NOCONNECTION}
  518.   DPNERR_NOHOSTPLAYER            = HRESULT(MAKE_DPNHRESULT_R + $490); // MAKE_DPNHRESULT( 0x490 )
  519.   {$EXTERNALSYM DPNERR_NOHOSTPLAYER}
  520.   DPNERR_NOINTERFACE             = E_NOINTERFACE;
  521.   {$EXTERNALSYM DPNERR_NOINTERFACE}
  522.   DPNERR_NOMOREADDRESSCOMPONENTS = HRESULT(MAKE_DPNHRESULT_R + $500); // MAKE_DPNHRESULT( 0x500 )
  523.   {$EXTERNALSYM DPNERR_NOMOREADDRESSCOMPONENTS}
  524.   DPNERR_NORESPONSE              = HRESULT(MAKE_DPNHRESULT_R + $510); // MAKE_DPNHRESULT( 0x510 )
  525.   {$EXTERNALSYM DPNERR_NORESPONSE}
  526.   DPNERR_NOTALLOWED              = HRESULT(MAKE_DPNHRESULT_R + $520); // MAKE_DPNHRESULT( 0x520 )
  527.   {$EXTERNALSYM DPNERR_NOTALLOWED}
  528.   DPNERR_NOTHOST                 = HRESULT(MAKE_DPNHRESULT_R + $530); // MAKE_DPNHRESULT( 0x530 )
  529.   {$EXTERNALSYM DPNERR_NOTHOST}
  530.   DPNERR_NOTREADY                = HRESULT(MAKE_DPNHRESULT_R + $540); // MAKE_DPNHRESULT( 0x540 )
  531.   {$EXTERNALSYM DPNERR_NOTREADY}
  532.   DPNERR_NOTREGISTERED           = HRESULT(MAKE_DPNHRESULT_R + $550); // MAKE_DPNHRESULT( 0x550 )
  533.   {$EXTERNALSYM DPNERR_NOTREGISTERED}
  534.   DPNERR_OUTOFMEMORY             = E_OUTOFMEMORY;
  535.   {$EXTERNALSYM DPNERR_OUTOFMEMORY}
  536.   DPNERR_PENDING                 = DPNSUCCESS_PENDING;
  537.   {$EXTERNALSYM DPNERR_PENDING}
  538.   DPNERR_PLAYERALREADYINGROUP    = HRESULT(MAKE_DPNHRESULT_R + $560); // MAKE_DPNHRESULT( 0x560 )
  539.   {$EXTERNALSYM DPNERR_PLAYERALREADYINGROUP}
  540.   DPNERR_PLAYERLOST              = HRESULT(MAKE_DPNHRESULT_R + $570); // MAKE_DPNHRESULT( 0x570 )
  541.   {$EXTERNALSYM DPNERR_PLAYERLOST}
  542.   DPNERR_PLAYERNOTINGROUP        = HRESULT(MAKE_DPNHRESULT_R + $580); // MAKE_DPNHRESULT( 0x580 )
  543.   {$EXTERNALSYM DPNERR_PLAYERNOTINGROUP}
  544.   DPNERR_PLAYERNOTREACHABLE      = HRESULT(MAKE_DPNHRESULT_R + $590); // MAKE_DPNHRESULT( 0x590 )
  545.   {$EXTERNALSYM DPNERR_PLAYERNOTREACHABLE}
  546.   DPNERR_SENDTOOLARGE            = HRESULT(MAKE_DPNHRESULT_R + $600); // MAKE_DPNHRESULT( 0x600 )
  547.   {$EXTERNALSYM DPNERR_SENDTOOLARGE}
  548.   DPNERR_SESSIONFULL             = HRESULT(MAKE_DPNHRESULT_R + $610); // MAKE_DPNHRESULT( 0x610 )
  549.   {$EXTERNALSYM DPNERR_SESSIONFULL}
  550.   DPNERR_TABLEFULL               = HRESULT(MAKE_DPNHRESULT_R + $620); // MAKE_DPNHRESULT( 0x620 )
  551.   {$EXTERNALSYM DPNERR_TABLEFULL}
  552.   DPNERR_TIMEDOUT                = HRESULT(MAKE_DPNHRESULT_R + $630); // MAKE_DPNHRESULT( 0x630 )
  553.   {$EXTERNALSYM DPNERR_TIMEDOUT}
  554.   DPNERR_UNINITIALIZED           = HRESULT(MAKE_DPNHRESULT_R + $640); // MAKE_DPNHRESULT( 0x640 )
  555.   {$EXTERNALSYM DPNERR_UNINITIALIZED}
  556.   DPNERR_UNSUPPORTED             = E_NOTIMPL;
  557.   {$EXTERNALSYM DPNERR_UNSUPPORTED}
  558.   DPNERR_USERCANCEL              = HRESULT(MAKE_DPNHRESULT_R + $650); // MAKE_DPNHRESULT( 0x650 )
  559.   {$EXTERNALSYM DPNERR_USERCANCEL}
  560. (*==========================================================================;
  561.  *
  562.  *  Copyright (C) 1999 Microsoft Corporation.  All Rights Reserved.
  563.  *
  564.  *  File:       dpvoice.h
  565.  *  Content:    DirectPlayVoice include file
  566.  ***************************************************************************)
  567. const
  568. (****************************************************************************
  569.  *
  570.  * DirectPlayVoice CLSIDs
  571.  *
  572.  ****************************************************************************)
  573.   // {B9F3EB85-B781-4ac1-8D90-93A05EE37D7D}
  574.   CLSID_DirectPlayVoiceClient: TGUID = '{b9f3eb85-b781-4ac1-8d90-93a05ee37d7d}';
  575.   {$EXTERNALSYM CLSID_DirectPlayVoiceClient}
  576.   // {D3F5B8E6-9B78-4a4c-94EA-CA2397B663D3}
  577.   CLSID_DirectPlayVoiceServer: TGUID = '{d3f5b8e6-9b78-4a4c-94ea-ca2397b663d3}';
  578.   {$EXTERNALSYM CLSID_DirectPlayVoiceServer}
  579.   // {0F0F094B-B01C-4091-A14D-DD0CD807711A}
  580.   CLSID_DirectPlayVoiceTest: TGUID = '{0f0f094b-b01c-4091-a14d-dd0cd807711a}';
  581.   {$EXTERNALSYM CLSID_DirectPlayVoiceTest}
  582. (****************************************************************************
  583.  *
  584.  * DirectPlayVoice Compression Type GUIDs
  585.  *
  586.  ****************************************************************************)
  587.   // MS-ADPCM 32.8 kbit/s
  588.   //
  589.   // {699B52C1-A885-46a8-A308-97172419ADC7}
  590.   DPVCTGUID_ADPCM: TGUID = '{699b52c1-a885-46a8-a308-97172419adc7}';
  591.   {$EXTERNALSYM DPVCTGUID_ADPCM}
  592.   // Microsoft GSM 6.10 13 kbit/s
  593.   //
  594.   // {24768C60-5A0D-11d3-9BE4-525400D985E7}
  595.   DPVCTGUID_GSM: TGUID = '{24768c60-5a0d-11d3-9be4-525400d985e7}';
  596.   {$EXTERNALSYM DPVCTGUID_GSM}
  597.   // MS-PCM 64 kbit/s
  598.   //
  599.   // {8DE12FD4-7CB3-48ce-A7E8-9C47A22E8AC5}
  600.   DPVCTGUID_NONE: TGUID = '{8de12fd4-7cb3-48ce-a7e8-9c47a22e8ac5}';
  601.   {$EXTERNALSYM DPVCTGUID_NONE}
  602.   // Voxware SC03 3.2kbit/s
  603.   //
  604.   // {7D82A29B-2242-4f82-8F39-5D1153DF3E41}
  605.   DPVCTGUID_SC03: TGUID = '{7d82a29b-2242-4f82-8f39-5d1153df3e41}';
  606.   {$EXTERNALSYM DPVCTGUID_SC03}
  607.   // Voxware SC06 6.4kbit/s
  608.   //
  609.   // {53DEF900-7168-4633-B47F-D143916A13C7}
  610.   DPVCTGUID_SC06: TGUID = '{53def900-7168-4633-b47f-d143916a13c7}';
  611.   {$EXTERNALSYM DPVCTGUID_SC06}
  612.   // TrueSpeech(TM) 8.6 kbit/s
  613.   //
  614.   // {D7954361-5A0B-11d3-9BE4-525400D985E7}
  615.   DPVCTGUID_TRUESPEECH: TGUID = '{d7954361-5a0b-11d3-9be4-525400d985e7}';
  616.   {$EXTERNALSYM DPVCTGUID_TRUESPEECH}
  617.   // Voxware VR12 1.4kbit/s
  618.   //
  619.   // {FE44A9FE-8ED4-48bf-9D66-1B1ADFF9FF6D}
  620.   DPVCTGUID_VR12: TGUID = '{fe44a9fe-8ed4-48bf-9d66-1b1adff9ff6d}';
  621.   {$EXTERNALSYM DPVCTGUID_VR12}
  622.   // Define the default compression type
  623.   DPVCTGUID_DEFAULT: TGUID = '{7d82a29b-2242-4f82-8f39-5d1153df3e41}'; // DPVCTGUID_SC03;
  624.   {$EXTERNALSYM DPVCTGUID_DEFAULT}
  625. (****************************************************************************
  626.  *
  627.  * DirectPlayVoice Callback Functions
  628.  *
  629.  ****************************************************************************)
  630. type
  631.   TDVMessageHandler = function(pvUserContext: Pointer; dwMessageType: DWORD; lpMessage: Pointer): HResult; stdcall;
  632.   {$NODEFINE TDVMessageHandler}
  633.   {$HPPEMIT 'typedef PDVMESSAGEHANDLER TDVMessageHandler;'}
  634. (****************************************************************************
  635.  *
  636.  * DirectPlayVoice Datatypes (Non-Structure / Non-Message)
  637.  *
  638.  ****************************************************************************)
  639.   PDVID = ^DVID;
  640.   DVID = DWORD;
  641.   {$EXTERNALSYM DVID}
  642.   TDVID = DVID;
  643. (****************************************************************************
  644.  *
  645.  * DirectPlayVoice Message Types
  646.  *
  647.  ****************************************************************************)
  648. const
  649.   DVMSGID_BASE                        = $0000;
  650.   {$EXTERNALSYM DVMSGID_BASE}
  651.   DVMSGID_CREATEVOICEPLAYER           = (DVMSGID_BASE+$0001);
  652.   {$EXTERNALSYM DVMSGID_CREATEVOICEPLAYER}
  653.   DVMSGID_DELETEVOICEPLAYER           = (DVMSGID_BASE+$0002);
  654.   {$EXTERNALSYM DVMSGID_DELETEVOICEPLAYER}
  655.   DVMSGID_SESSIONLOST                 = (DVMSGID_BASE+$0003);
  656.   {$EXTERNALSYM DVMSGID_SESSIONLOST}
  657.   DVMSGID_PLAYERVOICESTART            = (DVMSGID_BASE+$0004);
  658.   {$EXTERNALSYM DVMSGID_PLAYERVOICESTART}
  659.   DVMSGID_PLAYERVOICESTOP             = (DVMSGID_BASE+$0005);
  660.   {$EXTERNALSYM DVMSGID_PLAYERVOICESTOP}
  661.   DVMSGID_RECORDSTART                 = (DVMSGID_BASE+$0006);
  662.   {$EXTERNALSYM DVMSGID_RECORDSTART}
  663.   DVMSGID_RECORDSTOP                  = (DVMSGID_BASE+$0007);
  664.   {$EXTERNALSYM DVMSGID_RECORDSTOP}
  665.   DVMSGID_CONNECTRESULT               = (DVMSGID_BASE+$0008);
  666.   {$EXTERNALSYM DVMSGID_CONNECTRESULT}
  667.   DVMSGID_DISCONNECTRESULT            = (DVMSGID_BASE+$0009);
  668.   {$EXTERNALSYM DVMSGID_DISCONNECTRESULT}
  669.   DVMSGID_INPUTLEVEL                  = (DVMSGID_BASE+$000A);
  670.   {$EXTERNALSYM DVMSGID_INPUTLEVEL}
  671.   DVMSGID_OUTPUTLEVEL                 = (DVMSGID_BASE+$000B);
  672.   {$EXTERNALSYM DVMSGID_OUTPUTLEVEL}
  673.   DVMSGID_HOSTMIGRATED                = (DVMSGID_BASE+$000C);
  674.   {$EXTERNALSYM DVMSGID_HOSTMIGRATED}
  675.   DVMSGID_SETTARGETS                  = (DVMSGID_BASE+$000D);
  676.   {$EXTERNALSYM DVMSGID_SETTARGETS}
  677.   DVMSGID_PLAYEROUTPUTLEVEL           = (DVMSGID_BASE+$000E);
  678.   {$EXTERNALSYM DVMSGID_PLAYEROUTPUTLEVEL}
  679.   DVMSGID_LOSTFOCUS                   = (DVMSGID_BASE+$0010);
  680.   {$EXTERNALSYM DVMSGID_LOSTFOCUS}
  681.   DVMSGID_GAINFOCUS                   = (DVMSGID_BASE+$0011);
  682.   {$EXTERNALSYM DVMSGID_GAINFOCUS}
  683.   DVMSGID_LOCALHOSTSETUP              = (DVMSGID_BASE+$0012);
  684.   {$EXTERNALSYM DVMSGID_LOCALHOSTSETUP}
  685.   DVMSGID_MAXBASE                     = (DVMSGID_LOCALHOSTSETUP);
  686.   {$EXTERNALSYM DVMSGID_MAXBASE}
  687.   DVMSGID_MINBASE                     = (DVMSGID_CREATEVOICEPLAYER);
  688.   {$EXTERNALSYM DVMSGID_MINBASE}
  689. (****************************************************************************
  690.  *
  691.  * DirectPlayVoice Constants
  692.  *
  693.  ****************************************************************************)
  694.   //
  695.   // Buffer Aggresiveness Value Ranges
  696.   //
  697.   DVBUFFERAGGRESSIVENESS_MIN          = $00000001;
  698.   {$EXTERNALSYM DVBUFFERAGGRESSIVENESS_MIN}
  699.   DVBUFFERAGGRESSIVENESS_MAX          = $00000064;
  700.   {$EXTERNALSYM DVBUFFERAGGRESSIVENESS_MAX}
  701.   DVBUFFERAGGRESSIVENESS_DEFAULT      = $00000000;
  702.   {$EXTERNALSYM DVBUFFERAGGRESSIVENESS_DEFAULT}
  703.   //
  704.   // Buffer Quality Value Ranges
  705.   //
  706.   DVBUFFERQUALITY_MIN                 = $00000001;
  707.   {$EXTERNALSYM DVBUFFERQUALITY_MIN}
  708.   DVBUFFERQUALITY_MAX                 = $00000064;
  709.   {$EXTERNALSYM DVBUFFERQUALITY_MAX}
  710.   DVBUFFERQUALITY_DEFAULT             = $00000000;
  711.   {$EXTERNALSYM DVBUFFERQUALITY_DEFAULT}
  712.   DVID_SYS                = 0;
  713.   {$EXTERNALSYM DVID_SYS}
  714.   //
  715.   // Used to identify the session host in client/server
  716.   //
  717.   DVID_SERVERPLAYER       = 1;
  718.   {$EXTERNALSYM DVID_SERVERPLAYER}
  719.   //
  720.   // Used to target all players
  721.   //
  722.   DVID_ALLPLAYERS         = 0;
  723.   {$EXTERNALSYM DVID_ALLPLAYERS}
  724.   //
  725.   // Used to identify the main buffer
  726.   //
  727.   DVID_REMAINING          = $FFFFFFFF;
  728.   {$EXTERNALSYM DVID_REMAINING}
  729.   //
  730.   // Input level range
  731.   //
  732.   DVINPUTLEVEL_MIN                    = $00000000;
  733.   {$EXTERNALSYM DVINPUTLEVEL_MIN}
  734.   DVINPUTLEVEL_MAX                    = $00000063; // 99 decimal
  735.   {$EXTERNALSYM DVINPUTLEVEL_MAX}
  736.   DVNOTIFYPERIOD_MINPERIOD            = 20;
  737.   {$EXTERNALSYM DVNOTIFYPERIOD_MINPERIOD}
  738.   DVPLAYBACKVOLUME_DEFAULT            = DSBVOLUME_MAX;
  739.   {$EXTERNALSYM DVPLAYBACKVOLUME_DEFAULT}
  740.   DVRECORDVOLUME_LAST                 = $00000001;
  741.   {$EXTERNALSYM DVRECORDVOLUME_LAST}
  742.   //
  743.   // Use the default value
  744.   //
  745.   DVTHRESHOLD_DEFAULT               = $FFFFFFFF;
  746.   {$EXTERNALSYM DVTHRESHOLD_DEFAULT}
  747.   //
  748.   // Threshold Ranges
  749.   //
  750.   DVTHRESHOLD_MIN                   = $00000000;
  751.   {$EXTERNALSYM DVTHRESHOLD_MIN}
  752.   DVTHRESHOLD_MAX                   = $00000063; // 99 decimal
  753.   {$EXTERNALSYM DVTHRESHOLD_MAX}
  754.   //
  755.   // Threshold field is not used
  756.   //
  757.   DVTHRESHOLD_UNUSED                = $FFFFFFFE;
  758.   {$EXTERNALSYM DVTHRESHOLD_UNUSED}
  759.   //
  760.   // Session Types
  761.   //
  762.   DVSESSIONTYPE_PEER                  = $00000001;
  763.   {$EXTERNALSYM DVSESSIONTYPE_PEER}
  764.   DVSESSIONTYPE_MIXING                = $00000002;
  765.   {$EXTERNALSYM DVSESSIONTYPE_MIXING}
  766.   DVSESSIONTYPE_FORWARDING            = $00000003;
  767.   {$EXTERNALSYM DVSESSIONTYPE_FORWARDING}
  768.   DVSESSIONTYPE_ECHO                  = $00000004;
  769.   {$EXTERNALSYM DVSESSIONTYPE_ECHO}
  770. (****************************************************************************
  771.  *
  772.  * DirectPlayVoice Flags
  773.  *
  774.  ****************************************************************************)
  775.   //
  776.   // Enable automatic adjustment of the recording volume
  777.   //
  778.   DVCLIENTCONFIG_AUTORECORDVOLUME     = $00000008;
  779.   {$EXTERNALSYM DVCLIENTCONFIG_AUTORECORDVOLUME}
  780.   //
  781.   // Enable automatic voice activation
  782.   //
  783.   DVCLIENTCONFIG_AUTOVOICEACTIVATED   = $00000020;
  784.   {$EXTERNALSYM DVCLIENTCONFIG_AUTOVOICEACTIVATED}
  785.   //
  786.   // Enable echo suppression
  787.   //
  788.   DVCLIENTCONFIG_ECHOSUPPRESSION      = $08000000;
  789.   {$EXTERNALSYM DVCLIENTCONFIG_ECHOSUPPRESSION}
  790.   //
  791.   // Voice Activation manual mode
  792.   //
  793.   DVCLIENTCONFIG_MANUALVOICEACTIVATED = $00000004;
  794.   {$EXTERNALSYM DVCLIENTCONFIG_MANUALVOICEACTIVATED}
  795.   //
  796.   // Only playback voices that have buffers created for them
  797.   //
  798.   DVCLIENTCONFIG_MUTEGLOBAL           = $00000010;
  799.   {$EXTERNALSYM DVCLIENTCONFIG_MUTEGLOBAL}
  800.   //
  801.   // Mute the playback
  802.   //
  803.   DVCLIENTCONFIG_PLAYBACKMUTE         = $00000002;
  804.   {$EXTERNALSYM DVCLIENTCONFIG_PLAYBACKMUTE}
  805.   //
  806.   // Mute the recording
  807.   //
  808.   DVCLIENTCONFIG_RECORDMUTE           = $00000001;
  809.   {$EXTERNALSYM DVCLIENTCONFIG_RECORDMUTE}
  810.   //
  811.   // Complete the operation before returning
  812.   //
  813.   DVFLAGS_SYNC                        = $00000001;
  814.   {$EXTERNALSYM DVFLAGS_SYNC}
  815.   //
  816.   // Just check to see if wizard has been run, and if so what it's results were
  817.   //
  818.   DVFLAGS_QUERYONLY                   = $00000002;
  819.   {$EXTERNALSYM DVFLAGS_QUERYONLY}
  820.   //
  821.   // Shutdown the voice session without migrating the host
  822.   //
  823.   DVFLAGS_NOHOSTMIGRATE               = $00000008;
  824.   {$EXTERNALSYM DVFLAGS_NOHOSTMIGRATE}
  825.   //
  826.   // Allow the back button to be enabled in the wizard
  827.   //
  828.   DVFLAGS_ALLOWBACK                   = $00000010;
  829.   {$EXTERNALSYM DVFLAGS_ALLOWBACK}
  830.   //
  831.   // Disable host migration in the voice session
  832.   //
  833.   DVSESSION_NOHOSTMIGRATION           = $00000001;
  834.   {$EXTERNALSYM DVSESSION_NOHOSTMIGRATION}
  835.   //
  836.   // Server controlled targetting
  837.   //
  838.   DVSESSION_SERVERCONTROLTARGET       = $00000002;
  839.   {$EXTERNALSYM DVSESSION_SERVERCONTROLTARGET}
  840.   //
  841.   // Use DirectSound Normal Mode instead of priority
  842.   //
  843.   DVSOUNDCONFIG_NORMALMODE            = $00000001;
  844.   {$EXTERNALSYM DVSOUNDCONFIG_NORMALMODE}
  845.   //
  846.   // Automatically select the microphone
  847.   //
  848.   DVSOUNDCONFIG_AUTOSELECT            = $00000002;
  849.   {$EXTERNALSYM DVSOUNDCONFIG_AUTOSELECT}
  850.   //
  851.   // Run in half duplex mode
  852.   //
  853.   DVSOUNDCONFIG_HALFDUPLEX            = $00000004;
  854.   {$EXTERNALSYM DVSOUNDCONFIG_HALFDUPLEX}
  855.   //
  856.   // No volume controls are available for the recording device
  857.   //
  858.   DVSOUNDCONFIG_NORECVOLAVAILABLE     = $00000010;
  859.   {$EXTERNALSYM DVSOUNDCONFIG_NORECVOLAVAILABLE}
  860.   //
  861.   // Disable capture sharing
  862.   //
  863.   DVSOUNDCONFIG_NOFOCUS               = $20000000;
  864.   {$EXTERNALSYM DVSOUNDCONFIG_NOFOCUS}
  865.   //
  866.   // Set system conversion quality to high
  867.   //
  868.   DVSOUNDCONFIG_SETCONVERSIONQUALITY = $00000008;
  869.   {$EXTERNALSYM DVSOUNDCONFIG_SETCONVERSIONQUALITY}
  870.   //
  871.   // Enable strict focus mode
  872.   //
  873.   DVSOUNDCONFIG_STRICTFOCUS           = $40000000;
  874.   {$EXTERNALSYM DVSOUNDCONFIG_STRICTFOCUS}
  875.   //
  876.   // Player is in half duplex mode
  877.   //
  878.   DVPLAYERCAPS_HALFDUPLEX             = $00000001;
  879.   {$EXTERNALSYM DVPLAYERCAPS_HALFDUPLEX}
  880.   //
  881.   // Specifies that player is the local player
  882.   //
  883.   DVPLAYERCAPS_LOCAL                  = $00000002;
  884.   {$EXTERNALSYM DVPLAYERCAPS_LOCAL}
  885. type
  886. (****************************************************************************
  887.  *
  888.  * DirectPlayVoice Interface Pointer definitions
  889.  *
  890.  ****************************************************************************)
  891.   IDirectPlayVoiceServer = interface;
  892. (****************************************************************************
  893.  *
  894.  * DirectPlayVoice Structures (Non-Message)
  895.  *
  896.  ****************************************************************************)
  897.   //
  898.   // DirectPlayVoice Caps
  899.   // (GetCaps / SetCaps)
  900.   //
  901.   PDVCaps = ^TDVCaps;
  902.   DVCAPS = packed record
  903.     dwSize:   DWORD;                 // Size of this structure
  904.     dwFlags:   DWORD;                // Caps flags
  905.   end;
  906.   {$EXTERNALSYM DVCAPS}
  907.   TDVCaps = DVCAPS;
  908.   //
  909.   // DirectPlayVoice Client Configuration
  910.   // (Connect / GetClientConfig)
  911.   //
  912.   PDVClientConfig = ^TDVClientConfig;
  913.   DVCLIENTCONFIG = packed record
  914.     dwSize: DWORD;                 // Size of this structure
  915.     dwFlags: DWORD;                // Flags for client config (DVCLIENTCONFIG_...)
  916.     lRecordVolume: Longint;        // Recording volume
  917.     lPlaybackVolume: Longint;      // Playback volume
  918.     dwThreshold: DWORD;            // Voice Activation Threshold
  919.     dwBufferQuality: DWORD;        // Buffer quality
  920.     dwBufferAggressiveness: DWORD; // Buffer aggressiveness
  921.     dwNotifyPeriod: DWORD;         // Period of notification messages (ms)
  922.   end;
  923.   {$EXTERNALSYM DVCLIENTCONFIG}
  924.   TDVClientConfig = DVCLIENTCONFIG;
  925.   //
  926.   // DirectPlayVoice Compression Type Information
  927.   // (GetCompressionTypes)
  928.   //
  929.   PDVCompressionInfo = ^TDVCompressionInfo;
  930.   DVCOMPRESSIONINFO = packed record
  931.     dwSize: DWORD;                 // Size of this structure
  932.     guidType: TGUID;               // GUID that identifies this compression type
  933.     lpszName: PWideChar;           // String name of this compression type
  934.     lpszDescription: PWideChar;    // Description for this compression type
  935.     dwFlags: DWORD;                // Flags for this compression type
  936.     dwMaxBitsPerSecond: DWORD;     // Maximum # of bit/s this compression type uses
  937.   end;
  938.   {$EXTERNALSYM DVCOMPRESSIONINFO}
  939.   TDVCompressionInfo = DVCOMPRESSIONINFO;
  940.   //
  941.   // DirectPlayVoice Session Description
  942.   // (Host / GetSessionDesc)
  943.   //
  944.   PDVSessionDesc = ^TDVSessionDesc;
  945.   DVSESSIONDESC = packed record
  946.     dwSize: DWORD;                 // Size of this structure
  947.     dwFlags: DWORD;                // Session flags (DVSESSION_...)
  948.     dwSessionType: DWORD;          // Session type (DVSESSIONTYPE_...)
  949.     guidCT: TGUID;                 // Compression Type to use
  950.     dwBufferQuality: DWORD;        // Buffer quality
  951.     dwBufferAggressiveness: DWORD; // Buffer aggresiveness
  952.   end;
  953.   {$EXTERNALSYM DVSESSIONDESC}
  954.   TDVSessionDesc = DVSESSIONDESC;
  955.   //
  956.   // DirectPlayVoice Client Sound Device Configuration
  957.   // (Connect / GetSoundDeviceConfig)
  958.   //
  959.   PDVSoundDeviceConfig = ^TDVSoundDeviceConfig;
  960.   DVSOUNDDEVICECONFIG = packed record
  961.     dwSize: DWORD;                 // Size of this structure
  962.     dwFlags: DWORD;                // Flags for sound config (DVSOUNDCONFIG_...)
  963.     guidPlaybackDevice: TGUID;     // GUID of the playback device to use
  964.     lpdsPlaybackDevice: IDirectSound; // DirectSound Object to use (optional)
  965.     guidCaptureDevice: TGUID;      // GUID of the capture device to use
  966.     lpdsCaptureDevice: IDirectSoundCapture; // DirectSoundCapture Object to use (optional)
  967.     hwndAppWindow: HWND;           // HWND of your application's top-level window
  968.     lpdsMainBuffer: IDirectSoundBuffer; // DirectSoundBuffer to use for playback (optional)
  969.     dwMainBufferFlags: DWORD;      // Flags to pass to Play() on the main buffer
  970.     dwMainBufferPriority: DWORD;   // Priority to set when calling Play() on the main buffer
  971.   end;
  972.   {$EXTERNALSYM DVSOUNDDEVICECONFIG}
  973.   TDVSoundDeviceConfig = DVSOUNDDEVICECONFIG;
  974. (****************************************************************************
  975.  *
  976.  * DirectPlayVoice message handler call back structures
  977.  *
  978.  ****************************************************************************)
  979.   //
  980.   // Result of the Connect() call.  (If it wasn't called Async)
  981.   // (DVMSGID_CONNECTRESULT)
  982.   //
  983.   PDVMsgConnectResult = ^TDVMsgConnectResult;
  984.   DVMSG_CONNECTRESULT = packed record
  985.     dwSize: DWORD;                         // Size of this structure
  986.     hrResult: HRESULT;                     // Result of the Connect() call
  987.   end;
  988.   {$EXTERNALSYM DVMSG_CONNECTRESULT}
  989.   TDVMsgConnectResult = DVMSG_CONNECTRESULT;
  990.   //
  991.   // A new player has entered the voice session
  992.   // (DVMSGID_CREATEVOICEPLAYER)
  993.   //
  994.   PDVMsgCreateVoicePlayer = ^TDVMsgCreateVoicePlayer;
  995.   DVMSG_CREATEVOICEPLAYER = packed record
  996.     dwSize: DWORD;                         // Size of this structure
  997.     dvidPlayer: TDVID;                     // DVID of the player who joined
  998.     dwFlags: DWORD;                        // Player flags (DVPLAYERCAPS_...)
  999.     pvPlayerContext: Pointer;              // Context value for this player (user set)
  1000.   end;
  1001.   {$EXTERNALSYM DVMSG_CREATEVOICEPLAYER}
  1002.   TDVMsgCreateVoicePlayer = DVMSG_CREATEVOICEPLAYER;
  1003.   //
  1004.   // A player has left the voice session
  1005.   // (DVMSGID_DELETEVOICEPLAYER)
  1006.   //
  1007.   PDVMsgDeleteVoicePlayer = ^TDVMsgDeleteVoicePlayer;
  1008.   DVMSG_DELETEVOICEPLAYER = packed record
  1009.     dwSize: DWORD;                         // Size of this structure
  1010.     dvidPlayer: TDVID;                     // DVID of the player who left
  1011.     pvPlayerContext: Pointer;              // Context value for the player
  1012.   end;
  1013.   {$EXTERNALSYM DVMSG_DELETEVOICEPLAYER}
  1014.   TDVMsgDeleteVoicePlayer = DVMSG_DELETEVOICEPLAYER;
  1015.   //
  1016.   // Result of the Disconnect() call.  (If it wasn't called Async)
  1017.   // (DVMSGID_DISCONNECTRESULT)
  1018.   //
  1019.   PDVMsgDisconnectResult = ^TDVMsgDisconnectResult;
  1020.   DVMSG_DISCONNECTRESULT = packed record
  1021.     dwSize: DWORD;                         // Size of this structure
  1022.     hrResult: HRESULT;                     // Result of the Disconnect() call
  1023.   end;
  1024.   {$EXTERNALSYM DVMSG_DISCONNECTRESULT}
  1025.   TDVMsgDisconnectResult = DVMSG_DISCONNECTRESULT;
  1026.   //
  1027.   // The voice session host has migrated.
  1028.   // (DVMSGID_HOSTMIGRATED)
  1029.   //
  1030.   PDVMsgHostMigrated = ^TDVMsgHostMigrated;
  1031.   DVMSG_HOSTMIGRATED = packed record
  1032.     dwSize: DWORD;         // Size of this structure
  1033.     dvidNewHostID: TDVID;  // DVID of the player who is now the host
  1034.     pdvServerInterface: IDirectPlayVoiceServer; // Pointer to the new host object (if local player is now host)
  1035.   end;
  1036.   {$EXTERNALSYM DVMSG_HOSTMIGRATED}
  1037.   TDVMsgHostMigrated = DVMSG_HOSTMIGRATED;
  1038.   //
  1039.   // The current input level / recording volume on the local machine
  1040.   // (DVMSGID_INPUTLEVEL)
  1041.   //
  1042.   PDVMsgInputlevel = ^TDVMsgInputlevel;
  1043.   DVMSG_INPUTLEVEL = packed record
  1044.     dwSize: DWORD;                         // Size of this structure
  1045.     dwPeakLevel: DWORD;                    // Current peak level of the audio
  1046.     lRecordVolume: Longint;                // Current recording volume
  1047.     pvLocalPlayerContext: Pointer;         // Context value for the local player
  1048.   end;
  1049.   {$EXTERNALSYM DVMSG_INPUTLEVEL}
  1050.   TDVMsgInputlevel = DVMSG_INPUTLEVEL;
  1051.   //
  1052.   // The local client is about to become the new host
  1053.   // (DVMSGID_LOCALHOSTSETUP)
  1054.   //
  1055.   PDVMsgLocalHostSetup = ^TDVMsgLocalHostSetup;
  1056.   DVMSG_LOCALHOSTSETUP = packed record
  1057.     dwSize: DWORD;             // Size of this structure
  1058.     pvContext: Pointer;        // Context value to be passed to Initialize() of new host object
  1059.     pMessageHandler: TDVMessageHandler; // Message handler to be used by new host object
  1060.   end;
  1061.   {$EXTERNALSYM DVMSG_LOCALHOSTSETUP}
  1062.   TDVMsgLocalHostSetup = DVMSG_LOCALHOSTSETUP;
  1063.   //
  1064.   // The current output level for the combined output of all incoming streams.
  1065.   // (DVMSGID_OUTPUTLEVEL)
  1066.   //
  1067.   PDVMsgOutputLevel = ^TDVMsgOutputLevel;
  1068.   DVMSG_OUTPUTLEVEL = packed record
  1069.     dwSize: DWORD;                         // Size of this structure
  1070.     dwPeakLevel: DWORD;                    // Current peak level of the output
  1071.     lOutputVolume: Longint;                // Current playback volume
  1072.     pvLocalPlayerContext: Pointer;         // Context value for the local player
  1073.   end;
  1074.   {$EXTERNALSYM DVMSG_OUTPUTLEVEL}
  1075.   TDVMsgOutputLevel = DVMSG_OUTPUTLEVEL;
  1076.   //
  1077.   // The current peak level of an individual player's incoming audio stream as it is
  1078.   // being played back.
  1079.   // (DVMSGID_PLAYEROUTPUTLEVEL)
  1080.   //
  1081.   PDVMsgPlayerOutputLevel = ^TDVMsgPlayerOutputLevel;
  1082.   DVMSG_PLAYEROUTPUTLEVEL = packed record
  1083.     dwSize: DWORD;                         // Size of this structure
  1084.     dvidSourcePlayerID: TDVID;             // DVID of the player
  1085.     dwPeakLevel: DWORD;                    // Peak level of the player's stream
  1086.     pvPlayerContext: Pointer;              // Context value for the player
  1087.   end;
  1088.   {$EXTERNALSYM DVMSG_PLAYEROUTPUTLEVEL}
  1089.   TDVMsgPlayerOutputLevel = DVMSG_PLAYEROUTPUTLEVEL;
  1090.   //
  1091.   // An audio stream from the specified player has started playing back on the local client.
  1092.   // (DVMSGID_PLAYERVOICESTART).
  1093.   //
  1094.   PDVMsgPlayerVoiceStart = ^TDVMsgPlayerVoiceStart;
  1095.   DVMSG_PLAYERVOICESTART = packed record
  1096.     dwSize: DWORD;                         // Size of this structure
  1097.     dvidSourcePlayerID: TDVID;             // DVID of the Player
  1098.     pvPlayerContext: Pointer;              // Context value for this player
  1099.   end;
  1100.   {$EXTERNALSYM DVMSG_PLAYERVOICESTART}
  1101.   TDVMsgPlayerVoiceStart = DVMSG_PLAYERVOICESTART;
  1102.   //
  1103.   // The audio stream from the specified player has stopped playing back on the local client.
  1104.   // (DVMSGID_PLAYERVOICESTOP)
  1105.   //
  1106.   PDVMsgPlayerVoiceStop = ^TDVMsgPlayerVoiceStop;
  1107.   DVMSG_PLAYERVOICESTOP = packed record
  1108.     dwSize:   DWORD;                         // Size of this structure
  1109.     dvidSourcePlayerID:    DVID;             // DVID of the player
  1110.     pvPlayerContext: Pointer;                // Context value for this player
  1111.   end;
  1112.   {$EXTERNALSYM DVMSG_PLAYERVOICESTOP}
  1113.   TDVMsgPlayerVoiceStop = DVMSG_PLAYERVOICESTOP;
  1114.   //
  1115.   // Transmission has started on the local machine
  1116.   // (DVMSGID_RECORDSTART)
  1117.   //
  1118.   PDVMsgRecordStart = ^TDVMsgRecordStart;
  1119.   DVMSG_RECORDSTART = packed record
  1120.     dwSize:   DWORD;                         // Size of this structure
  1121.     dwPeakLevel:   DWORD;                    // Peak level that caused transmission to start
  1122.     pvLocalPlayerContext: Pointer;           // Context value for the local player
  1123.   end;
  1124.   {$EXTERNALSYM DVMSG_RECORDSTART}
  1125.   TDVMsgRecordStart = DVMSG_RECORDSTART;
  1126.   //
  1127.   // Transmission has stopped on the local machine
  1128.   // (DVMSGID_RECORDSTOP)
  1129.   //
  1130.   PDVMsgRecordStop = ^TDVMsgRecordStop;
  1131.   DVMSG_RECORDSTOP = packed record
  1132.     dwSize: DWORD;                         // Size of this structure
  1133.     dwPeakLevel: DWORD;                    // Peak level that caused transmission to stop
  1134.     pvLocalPlayerContext: Pointer;         // Context value for the local player
  1135.   end;
  1136.   {$EXTERNALSYM DVMSG_RECORDSTOP}
  1137.   TDVMsgRecordStop = DVMSG_RECORDSTOP;
  1138.   //
  1139.   // The voice session has been lost
  1140.   // (DVMSGID_SESSIONLOST)
  1141.   //
  1142.   PDVMsgSessionLost = ^TDVMsgSessionLost;
  1143.   DVMSG_SESSIONLOST = packed record
  1144.     dwSize: DWORD;                         // Size of this structure
  1145.     hrResult: HRESULT;                     // Reason the session was disconnected
  1146.   end;
  1147.   {$EXTERNALSYM DVMSG_SESSIONLOST}
  1148.   TDVMsgSessionLost = DVMSG_SESSIONLOST;
  1149.   //
  1150.   // The target list has been updated for the local client
  1151.   // (DVMSGID_SETTARGETS)
  1152.   //
  1153.   PDVMsgSetTargets = ^TDVMsgSetTargets;
  1154.   DVMSG_SETTARGETS = packed record
  1155.     dwSize: DWORD;                         // Size of this structure
  1156.     dwNumTargets: DWORD;                   // # of targets
  1157.     pdvidTargets: PDVID;                   // An array of DVIDs specifying the current targets
  1158.   end;
  1159.   {$EXTERNALSYM DVMSG_SETTARGETS}
  1160.   TDVMsgSetTargets = DVMSG_SETTARGETS;
  1161. (****************************************************************************
  1162.  *
  1163.  * DirectPlayVoice Functions
  1164.  *
  1165.  ****************************************************************************)
  1166. (*
  1167.  *
  1168.  * This function is no longer supported.  It is recommended that CoCreateInstance be used to create
  1169.  * DirectPlay voice objects.
  1170.  *
  1171.  * extern HRESULT WINAPI DirectPlayVoiceCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown);
  1172.  *
  1173.  *)
  1174. (****************************************************************************
  1175.  *
  1176.  * DirectPlay8 Application Interfaces
  1177.  *
  1178.  ****************************************************************************)
  1179.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlayVoiceClient);'}
  1180.   {$EXTERNALSYM IDirectPlayVoiceClient}
  1181.   IDirectPlayVoiceClient = interface(IUnknown)
  1182.     ['{1dfdc8ea-bcf7-41d6-b295-ab64b3b23306}']
  1183.     (*** IDirectPlayVoiceClient methods ***)
  1184.     function Initialize(pVoid: IUnknown; pMessageHandler: TDVMessageHandler;
  1185.       pUserContext: Pointer; pdwMessageMask: PDWORD; dwMessageMaskElements: DWORD): HResult; stdcall;
  1186.     function Connect(const pSoundDeviceConfig: TDVSoundDeviceConfig;
  1187.       const pdvClientConfig: TDVClientConfig; dwFlags: DWORD): HResult; stdcall;
  1188.     function Disconnect(dwFlags: DWORD): HResult; stdcall;
  1189.     function GetSessionDesc(out pvSessionDesc: TDVSessionDesc): HResult; stdcall;
  1190.     function GetClientConfig(out pClientConfig: TDVClientConfig): HResult; stdcall;
  1191.     function SetClientConfig(const pClientConfig: TDVClientConfig): HResult; stdcall;
  1192.     function GetCaps(out pDVCaps: TDVCaps): HResult; stdcall;
  1193.     function GetCompressionTypes(pData: Pointer; var pdwDataSize: DWORD;
  1194.       out pdwNumElements: DWORD; dwFlags: DWORD): HResult; stdcall;
  1195.     function SetTransmitTargets(pdvIDTargets: PDVID; dwNumTargets, dwFlags: DWORD): HResult; stdcall;
  1196.     function GetTransmitTargets(pdvIDTargets: PDVID; var dwNumTargets: DWORD; dwFlags: DWORD): HResult; stdcall;
  1197.     function Create3DSoundBuffer(dvID: TDVID; lpdsSourceBuffer: IDirectSoundBuffer;
  1198.       dwPriority, dwFlags: DWORD; out lpUserBuffer: IDirectSound3DBuffer): HResult; stdcall;
  1199.     function Delete3DSoundBuffer(dvID: TDVID; lpUserBuffer: IDirectSound3DBuffer): HResult; stdcall;
  1200.     function SetNotifyMask(pdwMessageMask: PDWORD; dwMessageMaskElements: DWORD): HResult; stdcall;
  1201.     function GetSoundDeviceConfig(pSoundDeviceConfig: PDVSoundDeviceConfig; var pdwSize: DWORD): HResult; stdcall;
  1202.   end;
  1203.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlayVoiceServer);'}
  1204.   {$EXTERNALSYM IDirectPlayVoiceServer}
  1205.   IDirectPlayVoiceServer = interface(IUnknown)
  1206.     ['{faa1c173-0468-43b6-8a2a-ea8a4f2076c9}']
  1207.     (*** IDirectPlayVoiceServer methods ***)
  1208.     function Initialize(pVoid: IUnknown; pMessageHandler: TDVMessageHandler;
  1209.       pUserContext: Pointer; pdwMessageMask: PDWORD; dwMessageMaskElements: DWORD): HResult; stdcall;
  1210.     function StartSession(const pSessionDesc: TDVSessionDesc; dwFlags: DWORD): HResult; stdcall;
  1211.     function StopSession(dwFlags: DWORD): HResult; stdcall;
  1212.     function GetSessionDesc(out pvSessionDesc: TDVSessionDesc): HResult; stdcall;
  1213.     function SetSessionDesc(const pvSessionDesc: TDVSessionDesc): HResult; stdcall;
  1214.     function GetCaps(out pDVCaps: TDVCaps): HResult; stdcall;
  1215.     function GetCompressionTypes(pData: Pointer; var pdwDataSize: DWORD;
  1216.       out pdwNumElements: DWORD; dwFlags: DWORD): HResult; stdcall;
  1217.     function SetTransmitTargets(dvSource: TDVID; pdvIDTargets: PDVID;
  1218.       dwNumTargets, dwFlags: DWORD): HResult; stdcall;
  1219.     function GetTransmitTargets(dvSource: TDVID; pdvIDTargets: PDVID;
  1220.       var dwNumTargets: DWORD; dwFlags: DWORD): HResult; stdcall;
  1221.     function SetNotifyMask(pdwMessageMask: PDWORD; dwMessageMaskElements: DWORD): HResult; stdcall;
  1222.   end;
  1223.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlayVoiceTest);'}
  1224.   {$EXTERNALSYM IDirectPlayVoiceTest}
  1225.   IDirectPlayVoiceTest = interface(IUnknown)
  1226.     ['{d26af734-208b-41da-8224-e0ce79810be1}']
  1227.     (*** IDirectPlayVoiceTest methods ***)
  1228.     function CheckAudioSetup(pguidPlaybackDevice, pguidCaptureDevice: PGUID;
  1229.       hwndParent: hWND; dwFlags: DWORD): HResult; stdcall;
  1230.   end;
  1231. (****************************************************************************
  1232.  *
  1233.  * DirectPlayVoice Interface IIDs
  1234.  *
  1235.  ****************************************************************************)
  1236.   // {1DFDC8EA-BCF7-41d6-B295-AB64B3B23306}
  1237.   IID_IDirectPlayVoiceClient = IDirectPlayVoiceClient;
  1238.   {$EXTERNALSYM IID_IDirectPlayVoiceClient}
  1239.   // {FAA1C173-0468-43b6-8A2A-EA8A4F2076C9}
  1240.   IID_IDirectPlayVoiceServer = IDirectPlayVoiceServer;
  1241.   {$EXTERNALSYM IID_IDirectPlayVoiceServer}
  1242.   // {D26AF734-208B-41da-8224-E0CE79810BE1}
  1243.   IID_IDirectPlayVoiceTest = IDirectPlayVoiceTest;
  1244.   {$EXTERNALSYM IID_IDirectPlayVoiceTest}
  1245. (****************************************************************************
  1246.  *
  1247.  * DIRECTPLAYVOICE ERRORS
  1248.  *
  1249.  * Errors are represented by negative values and cannot be combined.
  1250.  *
  1251.  ****************************************************************************)
  1252. const
  1253.   _FACDPV  = $15;
  1254.   {$EXTERNALSYM _FACDPV}
  1255. //#define MAKE_DVHRESULT( code )          MAKE_HRESULT( 1, _FACDPV, code )
  1256. (*
  1257. #define DV_FULLDUPLEX                   MAKE_HRESULT( 0, _FACDPV,  0x0005 )
  1258. #define DV_HALFDUPLEX                   MAKE_HRESULT( 0, _FACDPV,  0x000A )
  1259. #define DV_PENDING MAKE_HRESULT( 0, _FACDPV,  0x0010 )
  1260. #define DVERR_BUFFERTOOSMALL            MAKE_DVHRESULT(  0x001E )
  1261. #define DVERR_EXCEPTION                 MAKE_DVHRESULT(  0x004A )
  1262. #define DVERR_GENERIC                   E_FAIL
  1263. #define DVERR_INVALIDFLAGS              MAKE_DVHRESULT( 0x0078 )
  1264. #define DVERR_INVALIDOBJECT             MAKE_DVHRESULT( 0x0082 )
  1265. #define DVERR_INVALIDPARAM              E_INVALIDARG
  1266. #define DVERR_INVALIDPLAYER             MAKE_DVHRESULT( 0x0087 )
  1267. #define DVERR_INVALIDGROUP              MAKE_DVHRESULT( 0x0091 )
  1268. #define DVERR_INVALIDHANDLE             MAKE_DVHRESULT( 0x0096 )
  1269. #define DVERR_OUTOFMEMORY               E_OUTOFMEMORY
  1270. #define DVERR_PENDING                   DV_PENDING
  1271. #define DVERR_NOTSUPPORTED              E_NOTIMPL
  1272. #define DVERR_NOINTERFACE               E_NOINTERFACE
  1273. #define DVERR_SESSIONLOST               MAKE_DVHRESULT( 0x012C )
  1274. #define DVERR_NOVOICESESSION            MAKE_DVHRESULT( 0x012E )
  1275. #define DVERR_CONNECTIONLOST            MAKE_DVHRESULT( 0x0168 )
  1276. #define DVERR_NOTINITIALIZED            MAKE_DVHRESULT( 0x0169 )
  1277. #define DVERR_CONNECTED                 MAKE_DVHRESULT( 0x016A )
  1278. #define DVERR_NOTCONNECTED              MAKE_DVHRESULT( 0x016B )
  1279. #define DVERR_CONNECTABORTING           MAKE_DVHRESULT( 0x016E )
  1280. #define DVERR_NOTALLOWED                MAKE_DVHRESULT( 0x016F )
  1281. #define DVERR_INVALIDTARGET             MAKE_DVHRESULT( 0x0170 )
  1282. #define DVERR_TRANSPORTNOTHOST          MAKE_DVHRESULT( 0x0171 )
  1283. #define DVERR_COMPRESSIONNOTSUPPORTED   MAKE_DVHRESULT( 0x0172 )
  1284. #define DVERR_ALREADYPENDING            MAKE_DVHRESULT( 0x0173 )
  1285. #define DVERR_SOUNDINITFAILURE          MAKE_DVHRESULT( 0x0174 )
  1286. #define DVERR_TIMEOUT                   MAKE_DVHRESULT( 0x0175 )
  1287. #define DVERR_CONNECTABORTED            MAKE_DVHRESULT( 0x0176 )
  1288. #define DVERR_NO3DSOUND                 MAKE_DVHRESULT( 0x0177 )
  1289. #define DVERR_ALREADYBUFFERED         MAKE_DVHRESULT( 0x0178 )
  1290. #define DVERR_NOTBUFFERED               MAKE_DVHRESULT( 0x0179 )
  1291. #define DVERR_HOSTING                   MAKE_DVHRESULT( 0x017A )
  1292. #define DVERR_NOTHOSTING                MAKE_DVHRESULT( 0x017B )
  1293. #define DVERR_INVALIDDEVICE             MAKE_DVHRESULT( 0x017C )
  1294. #define DVERR_RECORDSYSTEMERROR         MAKE_DVHRESULT( 0x017D )
  1295. #define DVERR_PLAYBACKSYSTEMERROR       MAKE_DVHRESULT( 0x017E )
  1296. #define DVERR_SENDERROR                 MAKE_DVHRESULT( 0x017F )
  1297. #define DVERR_USERCANCEL                MAKE_DVHRESULT( 0x0180 )
  1298. #define DVERR_RUNSETUP                  MAKE_DVHRESULT( 0x0183 )
  1299. #define DVERR_INCOMPATIBLEVERSION       MAKE_DVHRESULT( 0x0184 )
  1300. #define DVERR_INITIALIZED               MAKE_DVHRESULT( 0x0187 )
  1301. #define DVERR_INVALIDPOINTER            E_POINTER
  1302. #define DVERR_NOTRANSPORT               MAKE_DVHRESULT( 0x0188 )
  1303. #define DVERR_NOCALLBACK                MAKE_DVHRESULT( 0x0189 )
  1304. #define DVERR_TRANSPORTNOTINIT          MAKE_DVHRESULT( 0x018A )
  1305. #define DVERR_TRANSPORTNOSESSION        MAKE_DVHRESULT( 0x018B )
  1306. #define DVERR_TRANSPORTNOPLAYER         MAKE_DVHRESULT( 0x018C )
  1307. #define DVERR_USERBACK                  MAKE_DVHRESULT( 0x018D )
  1308. #define DVERR_NORECVOLAVAILABLE         MAKE_DVHRESULT( 0x018E )
  1309. #define DVERR_INVALIDBUFFER MAKE_DVHRESULT( 0x018F )
  1310. #define DVERR_LOCKEDBUFFER MAKE_DVHRESULT( 0x0190 )
  1311. *)
  1312.   MAKE_DVHRESULT_R                = (1 shl 31) or (_FACDPV shl 16);
  1313.   DV_OK                           = S_OK;
  1314.   {$EXTERNALSYM DV_OK}
  1315.   DV_FULLDUPLEX                   = (0 shl 31) or (_FACDPV shl 16) or $0005;
  1316.   {$EXTERNALSYM DV_FULLDUPLEX}
  1317.   DV_HALFDUPLEX                   = (0 shl 31) or (_FACDPV shl 16) or $000A;
  1318.   {$EXTERNALSYM DV_HALFDUPLEX}
  1319.   DV_PENDING          = (0 shl 31) or (_FACDPV shl 16) or $0010;
  1320.   {$EXTERNALSYM DV_PENDING}
  1321.   DVERR_BUFFERTOOSMALL            = MAKE_DVHRESULT_R + $001E ;
  1322.   {$EXTERNALSYM DVERR_BUFFERTOOSMALL}
  1323.   DVERR_EXCEPTION                 = MAKE_DVHRESULT_R + $004A ;
  1324.   {$EXTERNALSYM DVERR_EXCEPTION}
  1325.   DVERR_GENERIC                   = E_FAIL;
  1326.   {$EXTERNALSYM DVERR_GENERIC}
  1327.   DVERR_INVALIDFLAGS              = MAKE_DVHRESULT_R + $0078 ;
  1328.   {$EXTERNALSYM DVERR_INVALIDFLAGS}
  1329.   DVERR_INVALIDOBJECT             = MAKE_DVHRESULT_R + $0082 ;
  1330.   {$EXTERNALSYM DVERR_INVALIDOBJECT}
  1331.   DVERR_INVALIDPARAM              = E_INVALIDARG;
  1332.   {$EXTERNALSYM DVERR_INVALIDPARAM}
  1333.   DVERR_INVALIDPLAYER             = MAKE_DVHRESULT_R + $0087 ;
  1334.   {$EXTERNALSYM DVERR_INVALIDPLAYER}
  1335.   DVERR_INVALIDGROUP              = MAKE_DVHRESULT_R + $0091 ;
  1336.   {$EXTERNALSYM DVERR_INVALIDGROUP}
  1337.   DVERR_INVALIDHANDLE             = MAKE_DVHRESULT_R + $0096 ;
  1338.   {$EXTERNALSYM DVERR_INVALIDHANDLE}
  1339.   DVERR_OUTOFMEMORY               = E_OUTOFMEMORY;
  1340.   {$EXTERNALSYM DVERR_OUTOFMEMORY}
  1341.   DVERR_PENDING                   = DV_PENDING;
  1342.   {$EXTERNALSYM DVERR_PENDING}
  1343.   DVERR_NOTSUPPORTED              = E_NOTIMPL;
  1344.   {$EXTERNALSYM DVERR_NOTSUPPORTED}
  1345.   DVERR_NOINTERFACE               = E_NOINTERFACE;
  1346.   {$EXTERNALSYM DVERR_NOINTERFACE}
  1347.   DVERR_SESSIONLOST               = MAKE_DVHRESULT_R + $012C ;
  1348.   {$EXTERNALSYM DVERR_SESSIONLOST}
  1349.   DVERR_NOVOICESESSION            = MAKE_DVHRESULT_R + $012E ;
  1350.   {$EXTERNALSYM DVERR_NOVOICESESSION}
  1351.   DVERR_CONNECTIONLOST            = MAKE_DVHRESULT_R + $0168 ;
  1352.   {$EXTERNALSYM DVERR_CONNECTIONLOST}
  1353.   DVERR_NOTINITIALIZED            = MAKE_DVHRESULT_R + $0169 ;
  1354.   {$EXTERNALSYM DVERR_NOTINITIALIZED}
  1355.   DVERR_CONNECTED                 = MAKE_DVHRESULT_R + $016A ;
  1356.   {$EXTERNALSYM DVERR_CONNECTED}
  1357.   DVERR_NOTCONNECTED              = MAKE_DVHRESULT_R + $016B ;
  1358.   {$EXTERNALSYM DVERR_NOTCONNECTED}
  1359.   DVERR_CONNECTABORTING           = MAKE_DVHRESULT_R + $016E ;
  1360.   {$EXTERNALSYM DVERR_CONNECTABORTING}
  1361.   DVERR_NOTALLOWED                = MAKE_DVHRESULT_R + $016F ;
  1362.   {$EXTERNALSYM DVERR_NOTALLOWED}
  1363.   DVERR_INVALIDTARGET             = MAKE_DVHRESULT_R + $0170 ;
  1364.   {$EXTERNALSYM DVERR_INVALIDTARGET}
  1365.   DVERR_TRANSPORTNOTHOST          = MAKE_DVHRESULT_R + $0171 ;
  1366.   {$EXTERNALSYM DVERR_TRANSPORTNOTHOST}
  1367.   DVERR_COMPRESSIONNOTSUPPORTED   = MAKE_DVHRESULT_R + $0172 ;
  1368.   {$EXTERNALSYM DVERR_COMPRESSIONNOTSUPPORTED}
  1369.   DVERR_ALREADYPENDING            = MAKE_DVHRESULT_R + $0173 ;
  1370.   {$EXTERNALSYM DVERR_ALREADYPENDING}
  1371.   DVERR_SOUNDINITFAILURE          = MAKE_DVHRESULT_R + $0174 ;
  1372.   {$EXTERNALSYM DVERR_SOUNDINITFAILURE}
  1373.   DVERR_TIMEOUT                   = MAKE_DVHRESULT_R + $0175 ;
  1374.   {$EXTERNALSYM DVERR_TIMEOUT}
  1375.   DVERR_CONNECTABORTED            = MAKE_DVHRESULT_R + $0176 ;
  1376.   {$EXTERNALSYM DVERR_CONNECTABORTED}
  1377.   DVERR_NO3DSOUND                 = MAKE_DVHRESULT_R + $0177 ;
  1378.   {$EXTERNALSYM DVERR_NO3DSOUND}
  1379.   DVERR_ALREADYBUFFERED           = MAKE_DVHRESULT_R + $0178 ;
  1380.   {$EXTERNALSYM DVERR_ALREADYBUFFERED}
  1381.   DVERR_NOTBUFFERED               = MAKE_DVHRESULT_R + $0179 ;
  1382.   {$EXTERNALSYM DVERR_NOTBUFFERED}
  1383.   DVERR_HOSTING                   = MAKE_DVHRESULT_R + $017A ;
  1384.   {$EXTERNALSYM DVERR_HOSTING}
  1385.   DVERR_NOTHOSTING                = MAKE_DVHRESULT_R + $017B ;
  1386.   {$EXTERNALSYM DVERR_NOTHOSTING}
  1387.   DVERR_INVALIDDEVICE             = MAKE_DVHRESULT_R + $017C ;
  1388.   {$EXTERNALSYM DVERR_INVALIDDEVICE}
  1389.   DVERR_RECORDSYSTEMERROR         = MAKE_DVHRESULT_R + $017D ;
  1390.   {$EXTERNALSYM DVERR_RECORDSYSTEMERROR}
  1391.   DVERR_PLAYBACKSYSTEMERROR       = MAKE_DVHRESULT_R + $017E ;
  1392.   {$EXTERNALSYM DVERR_PLAYBACKSYSTEMERROR}
  1393.   DVERR_SENDERROR                 = MAKE_DVHRESULT_R + $017F ;
  1394.   {$EXTERNALSYM DVERR_SENDERROR}
  1395.   DVERR_USERCANCEL                = MAKE_DVHRESULT_R + $0180 ;
  1396.   {$EXTERNALSYM DVERR_USERCANCEL}
  1397.   DVERR_RUNSETUP                  = MAKE_DVHRESULT_R + $0183 ;
  1398.   {$EXTERNALSYM DVERR_RUNSETUP}
  1399.   DVERR_INCOMPATIBLEVERSION       = MAKE_DVHRESULT_R + $0184 ;
  1400.   {$EXTERNALSYM DVERR_INCOMPATIBLEVERSION}
  1401.   DVERR_INITIALIZED               = MAKE_DVHRESULT_R + $0187 ;
  1402.   {$EXTERNALSYM DVERR_INITIALIZED}
  1403.   DVERR_INVALIDPOINTER            = E_POINTER;
  1404.   {$EXTERNALSYM DVERR_INVALIDPOINTER}
  1405.   DVERR_NOTRANSPORT               = MAKE_DVHRESULT_R + $0188 ;
  1406.   {$EXTERNALSYM DVERR_NOTRANSPORT}
  1407.   DVERR_NOCALLBACK                = MAKE_DVHRESULT_R + $0189 ;
  1408.   {$EXTERNALSYM DVERR_NOCALLBACK}
  1409.   DVERR_TRANSPORTNOTINIT          = MAKE_DVHRESULT_R + $018A ;
  1410.   {$EXTERNALSYM DVERR_TRANSPORTNOTINIT}
  1411.   DVERR_TRANSPORTNOSESSION        = MAKE_DVHRESULT_R + $018B ;
  1412.   {$EXTERNALSYM DVERR_TRANSPORTNOSESSION}
  1413.   DVERR_TRANSPORTNOPLAYER         = MAKE_DVHRESULT_R + $018C ;
  1414.   {$EXTERNALSYM DVERR_TRANSPORTNOPLAYER}
  1415.   DVERR_USERBACK                  = MAKE_DVHRESULT_R + $018D ;
  1416.   {$EXTERNALSYM DVERR_USERBACK}
  1417.   DVERR_NORECVOLAVAILABLE         = MAKE_DVHRESULT_R + $018E ;
  1418.   {$EXTERNALSYM DVERR_NORECVOLAVAILABLE}
  1419.   DVERR_INVALIDBUFFER             = MAKE_DVHRESULT_R + $018F ;
  1420.   {$EXTERNALSYM DVERR_INVALIDBUFFER}
  1421.   DVERR_LOCKEDBUFFER              = MAKE_DVHRESULT_R + $0190 ;
  1422.   {$EXTERNALSYM DVERR_LOCKEDBUFFER}
  1423. ///////////////////////////////////////////////////////////////////////////////
  1424. ///////////////////////////////////////////////////////////////////////////////
  1425. // Compatibility types for non-Borland compliant translations of DirectPlay8 //
  1426. ///////////////////////////////////////////////////////////////////////////////
  1427. ///////////////////////////////////////////////////////////////////////////////
  1428. type
  1429.   PDvmsg_Connectresult = PDVMsgConnectResult;
  1430.   TDvmsg_Connectresult = TDVMsgConnectResult;
  1431.   PDvmsg_Createvoiceplayer = PDVMsgCreateVoicePlayer;
  1432.   TDvmsg_Createvoiceplayer = TDVMsgCreateVoicePlayer;
  1433.   PDvmsg_Deletevoiceplayer = PDVMsgDeleteVoicePlayer;
  1434.   TDvmsg_Deletevoiceplayer = TDVMsgDeleteVoicePlayer;
  1435.   PDvmsg_Disconnectresult = PDVMsgDisconnectResult;
  1436.   TDvmsg_Disconnectresult = TDVMsgDisconnectResult;
  1437.   PDvmsg_Hostmigrated = PDVMsgHostMigrated;
  1438.   TDvmsg_Hostmigrated = TDVMsgHostMigrated;
  1439.   PDvmsg_Inputlevel = PDVMsgInputlevel;
  1440.   TDvmsg_Inputlevel = TDVMsgInputlevel;
  1441.   PDvmsg_Localhostsetup = PDVMsgLocalHostSetup;
  1442.   TDvmsg_Localhostsetup = TDVMsgLocalHostSetup;
  1443.   PDvmsg_Outputlevel = PDVMsgOutputLevel;
  1444.   TDvmsg_Outputlevel = TDVMsgOutputLevel;
  1445.   PDvmsg_Playeroutputlevel = PDVMsgPlayerOutputLevel;
  1446.   TDvmsg_Playeroutputlevel = TDVMsgPlayerOutputLevel;
  1447.   PDvmsg_Playervoicestart = PDVMsgPlayerVoiceStart;
  1448.   TDvmsg_Playervoicestart = TDVMsgPlayerVoiceStart;
  1449.   PDvmsg_Playervoicestop = PDVMsgPlayerVoiceStop;
  1450.   TDvmsg_Playervoicestop = TDVMsgPlayerVoiceStop;
  1451.   PDvmsg_Recordstart = PDVMsgRecordStart;
  1452.   TDvmsg_Recordstart = TDVMsgRecordStart;
  1453.   PDvmsg_Recordstop = PDVMsgRecordStop;
  1454.   TDvmsg_Recordstop = TDVMsgRecordStop;
  1455.   PDvmsg_Sessionlost = PDVMsgSessionLost;
  1456.   TDvmsg_Sessionlost = TDVMsgSessionLost;
  1457.   PDvmsg_Settargets = PDVMsgSetTargets;
  1458.   TDvmsg_Settargets = TDVMsgSetTargets;
  1459.   PDPN_Application_Desc = PDPNApplicationDesc;
  1460.   TDPN_Application_Desc = TDPNApplicationDesc;
  1461.   PDPN_Caps = PDPNCaps;
  1462.   TDPN_Caps = TDPNCaps;
  1463.   PDPN_Caps_Ex = PDPNCapsEx;
  1464.   TDPN_Caps_Ex = TDPNCapsEx;
  1465.   PDPN_Connection_Info = PDPNConnectionInfo;
  1466.   TDPN_Connection_Info = TDPNConnectionInfo;
  1467.   PDPN_Group_Info = PDPNGroupInfo;
  1468.   TDPN_Group_Info = TDPNGroupInfo;
  1469.   PDPN_Player_Info = PDPNPlayerInfo;
  1470.   TDPN_Player_Info = TDPNPlayerInfo;
  1471.   PDPN_Security_Credentials = PDPNSecurityCredentials;
  1472.   TDPN_Security_Credentials = TDPNSecurityCredentials;
  1473.   PDPN_Security_Desc = PDPNSecurityDesc;
  1474.   TDPN_Security_Desc = TDPNSecurityDesc;
  1475.   PDPN_Service_Provider_Info = PDPNServiceProviderInfo;
  1476.   TDPN_Service_Provider_Info = TDPNServiceProviderInfo;
  1477.   PDPN_Sp_Caps = PDPNSpCaps;
  1478.   TDPN_Sp_Caps = TDPNSpCaps;
  1479.   PDPNMsg_Add_Player_To_Group = PDPNMsgAddPlayerToGroup;
  1480.   TDPNMsg_Add_Player_To_Group = TDPNMsgAddPlayerToGroup;
  1481.   PDPNMsg_Async_Op_Complete = PDPNMsgAsyncOpComplete;
  1482.   TDPNMsg_Async_Op_Complete = TDPNMsgAsyncOpComplete;
  1483.   PDPNMsg_Client_Info = PDPNMsgClientInfo;
  1484.   TDPNMsg_Client_Info = TDPNMsgClientInfo;
  1485.   PDPNMsg_Connect_Complete = PDPNMsgConnectComplete;
  1486.   TDPNMsg_Connect_Complete = TDPNMsgConnectComplete;
  1487.   PDPNMsg_Create_Group = PDPNMsgCreateGroup;
  1488.   TDPNMsg_Create_Group = TDPNMsgCreateGroup;
  1489.   PDPNMsg_Create_Player = PDPNMsgCreatePlayer;
  1490.   TDPNMsg_Create_Player = TDPNMsgCreatePlayer;
  1491.   PDPNMsg_Destroy_Group = PDPNMsgDestroyGroup;
  1492.   TDPNMsg_Destroy_Group = TDPNMsgDestroyGroup;
  1493.   PDPNMsg_Destroy_Player = PDPNMsgDestroyPlayer;
  1494.   TDPNMsg_Destroy_Player = TDPNMsgDestroyPlayer;
  1495.   PDPNMsg_Enum_Hosts_Query = PDPNMsgEnumHostsQuery;
  1496.   TDPNMsg_Enum_Hosts_Query = TDPNMsgEnumHostsQuery;
  1497.   PDPNMsg_Enum_Hosts_Response = PDPNMsgEnumHostsResponse;
  1498.   TDPNMsg_Enum_Hosts_Response = TDPNMsgEnumHostsResponse;
  1499.   PDPNMsg_Group_Info = PDPNMsgGroupInfo;
  1500.   TDPNMsg_Group_Info = TDPNMsgGroupInfo;
  1501.   PDPNMsg_Host_Migrate = PDPNMsgHostMigrate;
  1502.   TDPNMsg_Host_Migrate = TDPNMsgHostMigrate;
  1503.   PDPNMsg_Indicate_Connect = PDPNMsgIndicateConnect;
  1504.   TDPNMsg_Indicate_Connect = TDPNMsgIndicateConnect;
  1505.   PDPNMsg_Indicated_Connect_Aborted = PDPNMsgIndicatedConnectAborted;
  1506.   TDPNMsg_Indicated_Connect_Aborted = TDPNMsgIndicatedConnectAborted;
  1507.   PDPNMsg_Peer_Info = PDPNMsgPeerInfo;
  1508.   TDPNMsg_Peer_Info = TDPNMsgPeerInfo;
  1509.   PDPNMsg_Receive = PDPNMsgReceive;
  1510.   TDPNMsg_Receive = TDPNMsgReceive;
  1511.   PDPNMsg_Remove_Player_From_Group = PDPNMsgRemovePlayerFromGroup;
  1512.   TDPNMsg_Remove_Player_From_Group = TDPNMsgRemovePlayerFromGroup;
  1513.   PDPNMsg_Return_Buffer = PDPNMsgReturnBuffer;
  1514.   TDPNMsg_Return_Buffer = TDPNMsgReturnBuffer;
  1515.   PDPNMsg_Send_Complete = PDPNMsgSendComplete;
  1516.   TDPNMsg_Send_Complete = TDPNMsgSendComplete;
  1517.   PDPNMsg_Server_Info = PDPNMsgServerInfo;
  1518.   TDPNMsg_Server_Info = TDPNMsgServerInfo;
  1519.   PDPNMsg_Terminate_Session = PDPNMsgTerminateSession;
  1520.   TDPNMsg_Terminate_Session = TDPNMsgTerminateSession;
  1521.   PDPNMsg_Create_Thread = PDPNMsgCreateThread;
  1522.   TDPNMsg_Create_Thread = TDPNMsgCreateThread;
  1523.   PDPNMsg_Destroy_Thread = PDPNMsgDestroyThread;
  1524.   TDPNMsg_Destroy_Thread = TDPNMsgDestroyThread;
  1525.   PDPNMsg_Nat_Resolver_Query = PDPNMsgNatResolverQuery;
  1526.   TDPNMsg_Nat_Resolver_Query = TDPNMsgNatResolverQuery;
  1527. implementation
  1528. // #define MAKE_DPNHRESULT( code )  MAKE_HRESULT( 1, _DPN_FACILITY_CODE, ( code + _DPNHRESULT_BASE ) )
  1529. function MAKE_DPNHRESULT(Code: DWORD): DWORD;
  1530. begin
  1531.   Result:= DWord((1 shl 31) or (_DPN_FACILITY_CODE shl 16)) or (Code + _DPNHRESULT_BASE);
  1532. end;
  1533. end.