home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 May / CMCD0504.ISO / Software / Freeware / Programare / dspack / DSPACK231.exe / {app} / src / DirectX9 / DirectPlay8.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2003-04-27  |  143.3 KB  |  3,452 lines

  1. {******************************************************************************}
  2. {*                                                                            *}
  3. {*  Copyright (C) Microsoft Corporation.  All Rights Reserved.                *}
  4. {*                                                                            *}
  5. {*  Files:      dpaddr.h dplobby8.h dplay8.h dvoice.h                         *}
  6. {*  Content:    DirectPlay8 include files                                     *}
  7. {*                                                                            *}
  8. {*  DirectX 9.0 Delphi adaptation by Alexey Barkovoy                          *}
  9. {*  E-Mail: clootie@reactor.ru                                                *}
  10. {*                                                                            *}
  11. {*  Modified: 27-Apr-2003                                                     *}
  12. {*                                                                            *}
  13. {*  Latest version can be downloaded from:                                    *}
  14. {*     http://clootie.narod.ru/delphi                                         *}
  15. {*                                                                            *}
  16. {******************************************************************************}
  17. {                                                                              }
  18. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
  19. {                                                                              }
  20. { The contents of this file are used with permission, subject to the Mozilla   }
  21. { Public License Version 1.1 (the "License"); you may not use this file except }
  22. { in compliance with the License. You may obtain a copy of the License at      }
  23. { http://www.mozilla.org/MPL/MPL-1.1.html                                      }
  24. {                                                                              }
  25. { Software distributed under the License is distributed on an "AS IS" basis,   }
  26. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  27. { the specific language governing rights and limitations under the License.    }
  28. {                                                                              }
  29. { Alternatively, the contents of this file may be used under the terms of the  }
  30. { GNU Lesser General Public License (the  "LGPL License"), in which case the   }
  31. { provisions of the LGPL License are applicable instead of those above.        }
  32. { If you wish to allow use of your version of this file only under the terms   }
  33. { of the LGPL License and not to allow others to use your version of this file }
  34. { under the MPL, indicate your decision by deleting  the provisions above and  }
  35. { replace  them with the notice and other provisions required by the LGPL      }
  36. { License.  If you do not delete the provisions above, a recipient may use     }
  37. { your version of this file under either the MPL or the LGPL License.          }
  38. {                                                                              }
  39. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  40. {                                                                              }
  41. {******************************************************************************}
  42.  
  43. {$I DirectX.inc}
  44.  
  45. unit DirectPlay8;
  46.  
  47. interface
  48.  
  49. (*$HPPEMIT '#include "dplay8.h"' *)
  50. (*$HPPEMIT '#include "dplobby8.h"' *)
  51. (*$HPPEMIT '#include "dvoice.h"' *)
  52.  
  53. uses
  54.   Windows, WinSock, DirectSound;
  55.  
  56. (*==========================================================================;
  57.  *
  58.  *  Copyright (C) 2000-2002 Microsoft Corporation.  All Rights Reserved.
  59.  *
  60.  *  File:       dpaddr.h
  61.  *  Content:   DirectPlayAddress include file
  62.  ***************************************************************************)
  63.  
  64.  
  65. const
  66. (****************************************************************************
  67.  *
  68.  * DirectPlay8Address CLSIDs
  69.  *
  70.  ****************************************************************************)
  71.  
  72.   // {934A9523-A3CA-4bc5-ADA0-D6D95D979421}
  73.   CLSID_DirectPlay8Address: TGUID = '{934a9523-a3ca-4bc5-ada0-d6d95d979421}';
  74.   {$EXTERNALSYM CLSID_DirectPlay8Address}
  75.  
  76.   
  77. (****************************************************************************
  78.  *
  79.  * DirectPlay8Address Interface IIDs
  80.  *
  81.  ****************************************************************************)
  82. type
  83.   DPNAREFIID = TGUID;
  84.   {$EXTERNALSYM DPNAREFIID}
  85.   TDPNARefIID = DPNAREFIID;
  86.  
  87.  
  88. (****************************************************************************
  89.  *
  90.  * DirectPlay8Address Constants
  91.  *
  92.  ****************************************************************************)
  93. const
  94.   //
  95.   // Asynchronous operation flags
  96.   //
  97.   DPNA_DATATYPE_STRING        = $00000001;
  98.   {$EXTERNALSYM DPNA_DATATYPE_STRING}
  99.   DPNA_DATATYPE_DWORD         = $00000002;
  100.   {$EXTERNALSYM DPNA_DATATYPE_DWORD}
  101.   DPNA_DATATYPE_GUID          = $00000003;
  102.   {$EXTERNALSYM DPNA_DATATYPE_GUID}
  103.   DPNA_DATATYPE_BINARY        = $00000004;
  104.   {$EXTERNALSYM DPNA_DATATYPE_BINARY}
  105.   DPNA_DATATYPE_STRING_ANSI   = $00000005;
  106.   {$EXTERNALSYM DPNA_DATATYPE_STRING_ANSI}
  107.  
  108.   DPNA_DPNSVR_PORT            = 6073;
  109.   {$EXTERNALSYM DPNA_DPNSVR_PORT}
  110.  
  111.   DPNA_INDEX_INVALID          = $FFFFFFFF;
  112.   {$EXTERNALSYM DPNA_INDEX_INVALID}
  113.  
  114. (****************************************************************************
  115.  *
  116.  * DirectPlay8Address Address Elements
  117.  *
  118.  ****************************************************************************)
  119.  
  120.   DPNA_SEPARATOR_KEYVALUE       = WideChar('=');
  121.   {$EXTERNALSYM DPNA_SEPARATOR_KEYVALUE}
  122.   DPNA_SEPARATOR_USERDATA       = WideChar('#');
  123.   {$EXTERNALSYM DPNA_SEPARATOR_USERDATA}
  124.   DPNA_SEPARATOR_COMPONENT      = WideChar(';');
  125.   {$EXTERNALSYM DPNA_SEPARATOR_COMPONENT}
  126.   DPNA_ESCAPECHAR               = WideChar('%');
  127.   {$EXTERNALSYM DPNA_ESCAPECHAR}
  128.  
  129.   // Header
  130.   DPNA_HEADER                            = 'x-directplay:/';
  131.   {$EXTERNALSYM DPNA_HEADER}
  132.  
  133.   // key names for address components
  134.   DPNA_KEY_NAT_RESOLVER     = 'natresolver';
  135.   {$EXTERNALSYM DPNA_KEY_NAT_RESOLVER}
  136.   DPNA_KEY_NAT_RESOLVER_USER_STRING = 'natresolveruserstring';
  137.   {$EXTERNALSYM DPNA_KEY_NAT_RESOLVER_USER_STRING}
  138.   DPNA_KEY_APPLICATION_INSTANCE = 'applicationinstance';
  139.   {$EXTERNALSYM DPNA_KEY_APPLICATION_INSTANCE}
  140.   DPNA_KEY_DEVICE           = 'device';
  141.   {$EXTERNALSYM DPNA_KEY_DEVICE}
  142.   DPNA_KEY_HOSTNAME         = 'hostname';
  143.   {$EXTERNALSYM DPNA_KEY_HOSTNAME}
  144.   DPNA_KEY_PORT             = 'port';
  145.   {$EXTERNALSYM DPNA_KEY_PORT}
  146.   DPNA_KEY_NAMEINFO         = 'nameinfo';
  147.   {$EXTERNALSYM DPNA_KEY_NAMEINFO}
  148.   DPNA_KEY_PROCESSOR        = 'processor';
  149.   {$EXTERNALSYM DPNA_KEY_PROCESSOR}
  150.   DPNA_KEY_PROGRAM          = 'program';
  151.   {$EXTERNALSYM DPNA_KEY_PROGRAM}
  152.   DPNA_KEY_PROVIDER         = 'provider';
  153.   {$EXTERNALSYM DPNA_KEY_PROVIDER}
  154.   DPNA_KEY_SCOPE            = 'scope';
  155.   {$EXTERNALSYM DPNA_KEY_SCOPE}
  156.   DPNA_KEY_TRAVERSALMODE    = 'traversalmode';
  157.   {$EXTERNALSYM DPNA_KEY_TRAVERSALMODE}
  158.   DPNA_KEY_BAUD             = 'baud';
  159.   {$EXTERNALSYM DPNA_KEY_BAUD}
  160.   DPNA_KEY_FLOWCONTROL      = 'flowcontrol';
  161.   {$EXTERNALSYM DPNA_KEY_FLOWCONTROL}
  162.   DPNA_KEY_PARITY           = 'parity';
  163.   {$EXTERNALSYM DPNA_KEY_PARITY}
  164.   DPNA_KEY_PHONENUMBER      = 'phonenumber';
  165.   {$EXTERNALSYM DPNA_KEY_PHONENUMBER}
  166.   DPNA_KEY_STOPBITS         = 'stopbits';
  167.   {$EXTERNALSYM DPNA_KEY_STOPBITS}
  168.  
  169.   // values for baud rate
  170.   DPNA_BAUD_RATE_9600         = 9600;
  171.   {$EXTERNALSYM DPNA_BAUD_RATE_9600}
  172.   DPNA_BAUD_RATE_14400        = 14400;
  173.   {$EXTERNALSYM DPNA_BAUD_RATE_14400}
  174.   DPNA_BAUD_RATE_19200        = 19200;
  175.   {$EXTERNALSYM DPNA_BAUD_RATE_19200}
  176.   DPNA_BAUD_RATE_38400        = 38400;
  177.   {$EXTERNALSYM DPNA_BAUD_RATE_38400}
  178.   DPNA_BAUD_RATE_56000        = 56000;
  179.   {$EXTERNALSYM DPNA_BAUD_RATE_56000}
  180.   DPNA_BAUD_RATE_57600        = 57600;
  181.   {$EXTERNALSYM DPNA_BAUD_RATE_57600}
  182.   DPNA_BAUD_RATE_115200       = 115200;
  183.   {$EXTERNALSYM DPNA_BAUD_RATE_115200}
  184.  
  185.   // values for stop bits
  186.   DPNA_STOP_BITS_ONE          = '1';
  187.   {$EXTERNALSYM DPNA_STOP_BITS_ONE}
  188.   DPNA_STOP_BITS_ONE_FIVE     = '1.5';
  189.   {$EXTERNALSYM DPNA_STOP_BITS_ONE_FIVE}
  190.   DPNA_STOP_BITS_TWO          = '2';
  191.   {$EXTERNALSYM DPNA_STOP_BITS_TWO}
  192.  
  193.   // values for parity
  194.   DPNA_PARITY_NONE                    = 'NONE';
  195.   {$EXTERNALSYM DPNA_PARITY_NONE}
  196.   DPNA_PARITY_EVEN                    = 'EVEN';
  197.   {$EXTERNALSYM DPNA_PARITY_EVEN}
  198.   DPNA_PARITY_ODD                        = 'ODD';
  199.   {$EXTERNALSYM DPNA_PARITY_ODD}
  200.   DPNA_PARITY_MARK                    = 'MARK';
  201.   {$EXTERNALSYM DPNA_PARITY_MARK}
  202.   DPNA_PARITY_SPACE                    = 'SPACE';
  203.   {$EXTERNALSYM DPNA_PARITY_SPACE}
  204.  
  205.   // values for flow control
  206.   DPNA_FLOW_CONTROL_NONE            = 'NONE';
  207.   {$EXTERNALSYM DPNA_FLOW_CONTROL_NONE}
  208.   DPNA_FLOW_CONTROL_XONXOFF        = 'XONXOFF';
  209.   {$EXTERNALSYM DPNA_FLOW_CONTROL_XONXOFF}
  210.   DPNA_FLOW_CONTROL_RTS                = 'RTS';
  211.   {$EXTERNALSYM DPNA_FLOW_CONTROL_RTS}
  212.   DPNA_FLOW_CONTROL_DTR                = 'DTR';
  213.   {$EXTERNALSYM DPNA_FLOW_CONTROL_DTR}
  214.   DPNA_FLOW_CONTROL_RTSDTR        = 'RTSDTR';
  215.   {$EXTERNALSYM DPNA_FLOW_CONTROL_RTSDTR}
  216.   // values for traversal mode
  217.   DPNA_TRAVERSALMODE_NONE             = 0;
  218.   {$EXTERNALSYM DPNA_TRAVERSALMODE_NONE}
  219.   DPNA_TRAVERSALMODE_PORTREQUIRED     = 1;
  220.   {$EXTERNALSYM DPNA_TRAVERSALMODE_PORTREQUIRED}
  221.   DPNA_TRAVERSALMODE_PORTRECOMMENDED  = 2;
  222.   {$EXTERNALSYM DPNA_TRAVERSALMODE_PORTRECOMMENDED}
  223.   // Shortcut values
  224.   //
  225.   // These can be used instead of the corresponding CLSID_DP8SP_XXXX guids
  226.   //
  227.   DPNA_VALUE_TCPIPPROVIDER            = 'IP';
  228.   {$EXTERNALSYM DPNA_VALUE_TCPIPPROVIDER}
  229.   DPNA_VALUE_IPXPROVIDER              = 'IPX';
  230.   {$EXTERNALSYM DPNA_VALUE_IPXPROVIDER}
  231.   DPNA_VALUE_MODEMPROVIDER            = 'MODEM';
  232.   {$EXTERNALSYM DPNA_VALUE_MODEMPROVIDER}
  233.   DPNA_VALUE_SERIALPROVIDER           = 'SERIAL';
  234.   {$EXTERNALSYM DPNA_VALUE_SERIALPROVIDER}
  235.  
  236. //// ANSI DEFINITIONS
  237.  
  238.   // Header
  239.   DPNA_HEADER_A                              = 'x-directplay:/';
  240.   {$EXTERNALSYM DPNA_HEADER_A}
  241.   DPNA_SEPARATOR_KEYVALUE_A            = '=';
  242.   {$EXTERNALSYM DPNA_SEPARATOR_KEYVALUE_A}
  243.   DPNA_SEPARATOR_USERDATA_A            = '#';
  244.   {$EXTERNALSYM DPNA_SEPARATOR_USERDATA_A}
  245.   DPNA_SEPARATOR_COMPONENT_A        = ';';
  246.   {$EXTERNALSYM DPNA_SEPARATOR_COMPONENT_A}
  247.   DPNA_ESCAPECHAR_A                        = '%';
  248.   {$EXTERNALSYM DPNA_ESCAPECHAR_A}
  249.  
  250.   // key names for address components
  251.   DPNA_KEY_NAT_RESOLVER_A                    = 'natresolver';
  252.   {$EXTERNALSYM DPNA_KEY_NAT_RESOLVER_A}
  253.   DPNA_KEY_NAT_RESOLVER_USER_STRING_A        = 'natresolveruserstring';
  254.   {$EXTERNALSYM DPNA_KEY_NAT_RESOLVER_USER_STRING_A}
  255.   DPNA_KEY_APPLICATION_INSTANCE_A        = 'applicationinstance';
  256.   {$EXTERNALSYM DPNA_KEY_APPLICATION_INSTANCE_A}
  257.   DPNA_KEY_DEVICE_A                    = 'device';
  258.   {$EXTERNALSYM DPNA_KEY_DEVICE_A}
  259.   DPNA_KEY_HOSTNAME_A                    = 'hostname';
  260.   {$EXTERNALSYM DPNA_KEY_HOSTNAME_A}
  261.   DPNA_KEY_PORT_A                        = 'port';
  262.   {$EXTERNALSYM DPNA_KEY_PORT_A}
  263.   DPNA_KEY_NAMEINFO_A                    = 'nameinfo';
  264.   {$EXTERNALSYM DPNA_KEY_NAMEINFO_A}
  265.   DPNA_KEY_PROCESSOR_A                = 'processor';
  266.   {$EXTERNALSYM DPNA_KEY_PROCESSOR_A}
  267.   DPNA_KEY_PROGRAM_A                    = 'program';
  268.   {$EXTERNALSYM DPNA_KEY_PROGRAM_A}
  269.   DPNA_KEY_PROVIDER_A                    = 'provider';
  270.   {$EXTERNALSYM DPNA_KEY_PROVIDER_A}
  271.   DPNA_KEY_SCOPE_A                    = 'scope';
  272.   {$EXTERNALSYM DPNA_KEY_SCOPE_A}
  273.   DPNA_KEY_TRAVERSALMODE_A            = 'traversalmode';
  274.   {$EXTERNALSYM DPNA_KEY_TRAVERSALMODE_A}
  275.   DPNA_KEY_BAUD_A                        = 'baud';
  276.   {$EXTERNALSYM DPNA_KEY_BAUD_A}
  277.   DPNA_KEY_FLOWCONTROL_A                = 'flowcontrol';
  278.   {$EXTERNALSYM DPNA_KEY_FLOWCONTROL_A}
  279.   DPNA_KEY_PARITY_A                    = 'parity';
  280.   {$EXTERNALSYM DPNA_KEY_PARITY_A}
  281.   DPNA_KEY_PHONENUMBER_A                = 'phonenumber';
  282.   {$EXTERNALSYM DPNA_KEY_PHONENUMBER_A}
  283.   DPNA_KEY_STOPBITS_A                    = 'stopbits';
  284.   {$EXTERNALSYM DPNA_KEY_STOPBITS_A}
  285.  
  286.   // values for stop bits
  287.   DPNA_STOP_BITS_ONE_A                = '1';
  288.   {$EXTERNALSYM DPNA_STOP_BITS_ONE_A}
  289.   DPNA_STOP_BITS_ONE_FIVE_A            = '1.5';
  290.   {$EXTERNALSYM DPNA_STOP_BITS_ONE_FIVE_A}
  291.   DPNA_STOP_BITS_TWO_A                = '2';
  292.   {$EXTERNALSYM DPNA_STOP_BITS_TWO_A}
  293.  
  294.   // values for parity
  295.   DPNA_PARITY_NONE_A                    = 'NONE';
  296.   {$EXTERNALSYM DPNA_PARITY_NONE_A}
  297.   DPNA_PARITY_EVEN_A                    = 'EVEN';
  298.   {$EXTERNALSYM DPNA_PARITY_EVEN_A}
  299.   DPNA_PARITY_ODD_A              = 'ODD';
  300.   {$EXTERNALSYM DPNA_PARITY_ODD_A}
  301.   DPNA_PARITY_MARK_A                    = 'MARK';
  302.   {$EXTERNALSYM DPNA_PARITY_MARK_A}
  303.   DPNA_PARITY_SPACE_A                    = 'SPACE';
  304.   {$EXTERNALSYM DPNA_PARITY_SPACE_A}
  305.  
  306.   // values for flow control
  307.   DPNA_FLOW_CONTROL_NONE_A            = 'NONE';
  308.   {$EXTERNALSYM DPNA_FLOW_CONTROL_NONE_A}
  309.   DPNA_FLOW_CONTROL_XONXOFF_A   = 'XONXOFF';
  310.   {$EXTERNALSYM DPNA_FLOW_CONTROL_XONXOFF_A}
  311.   DPNA_FLOW_CONTROL_RTS_A                = 'RTS';
  312.   {$EXTERNALSYM DPNA_FLOW_CONTROL_RTS_A}
  313.   DPNA_FLOW_CONTROL_DTR_A                = 'DTR';
  314.   {$EXTERNALSYM DPNA_FLOW_CONTROL_DTR_A}
  315.   DPNA_FLOW_CONTROL_RTSDTR_A        = 'RTSDTR';
  316.   {$EXTERNALSYM DPNA_FLOW_CONTROL_RTSDTR_A}
  317.   // Shortcut values
  318.   //
  319.   // These can be used instead of the corresponding CLSID_DP8SP_XXXX guids
  320.   //
  321.   DPNA_VALUE_TCPIPPROVIDER_A          = 'IP';
  322.   {$EXTERNALSYM DPNA_VALUE_TCPIPPROVIDER_A}
  323.   DPNA_VALUE_IPXPROVIDER_A            = 'IPX';
  324.   {$EXTERNALSYM DPNA_VALUE_IPXPROVIDER_A}
  325.   DPNA_VALUE_MODEMPROVIDER_A          = 'MODEM';
  326.   {$EXTERNALSYM DPNA_VALUE_MODEMPROVIDER_A}
  327.   DPNA_VALUE_SERIALPROVIDER_A         = 'SERIAL';
  328.   {$EXTERNALSYM DPNA_VALUE_SERIALPROVIDER_A}
  329.  
  330. type
  331. (****************************************************************************
  332.  *
  333.  * DirectPlay8Address Forward Declarations For External Types
  334.  *
  335.  ****************************************************************************)
  336.  
  337.   SOCKADDR = TSockAddr;
  338.   {$EXTERNALSYM SOCKADDR}
  339.  
  340. (****************************************************************************
  341.  *
  342.  * DirectPlay8Address Functions
  343.  *
  344.  ****************************************************************************)
  345.  
  346.  
  347. (*
  348.  *
  349.  * This function is no longer supported.  It is recommended that CoCreateInstance be used to create
  350.  * DirectPlay8 address objects.
  351.  *
  352.  * HRESULT WINAPI DirectPlay8AddressCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown);
  353.  *
  354.  *)
  355.  
  356. (****************************************************************************
  357.  *
  358.  * DirectPlay8Address Application Interfaces
  359.  *
  360.  ****************************************************************************)
  361.  
  362.   //
  363.   // COM definition for IDirectPlay8Address Generic Interface
  364.   //
  365.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8Address);'}
  366.   {$EXTERNALSYM IDirectPlay8Address}
  367.   IDirectPlay8Address = interface(IUnknown)
  368.     ['{83783300-4063-4c8a-9db3-82830a7feb31}']
  369.     (*** IDirectPlay8Address methods ***)
  370.     function BuildFromURLW(pwszSourceURL: PWideChar): HResult; stdcall;
  371.     function BuildFromURLA(pszSourceURL: PAnsiChar): HResult; stdcall;
  372.     function Duplicate(out ppdpaNewAddress: IDirectPlay8Address): HResult; stdcall;
  373.     function SetEqual(pdpaAddress: IDirectPlay8Address): HResult; stdcall;
  374.     function IsEqual(pdpaAddress: IDirectPlay8Address): HResult; stdcall;
  375.     function Clear: HResult; stdcall;
  376.     function GetURLW(pwszURL: PWideChar; var pdwNumChars: DWORD): HResult; stdcall;
  377.     function GetURLA(pszURL: PAnsiChar; var pdwNumChars: DWORD): HResult; stdcall;
  378.     function GetSP(out pguidSP: TGUID): HResult; stdcall;
  379.     function GetUserData(pvUserData: Pointer; var pdwBufferSize: DWORD): HResult; stdcall;
  380.     function SetSP(const pguidSP: TGUID): HResult; stdcall;
  381.     function SetUserData(pvUserData: Pointer; dwDataSize: DWORD): HResult; stdcall;
  382.     function GetNumComponents(out pdwNumComponents: DWORD): HResult; stdcall;
  383.     function GetComponentByName(pwszName: PWideChar; pvBuffer: Pointer; var pdwBufferSize: DWORD; out pdwDataType: DWORD): HResult; stdcall;
  384.     function GetComponentByIndex(dwComponentID: DWORD; pwszName: PWideChar; var pdwNameLen: DWORD; pvBuffer: Pointer; var pdwBufferSize: DWORD; out pdwDataType: DWORD): HResult; stdcall;
  385.     function AddComponent(pwszName: PWideChar; lpvData: Pointer; dwDataSize, dwDataType: DWORD): HResult; stdcall;
  386.     function GetDevice(out pguidDevice: TGUID): HResult; stdcall;
  387.     function SetDevice(const pguidDevice: TGUID): HResult; stdcall;
  388.     function BuildFromDPADDRESS(pvAddress: Pointer; dwDataSize: DWORD): HResult; stdcall;
  389.   end;
  390.   {$NODEFINE PIDirectPlay8Address}
  391.   {$HPPEMIT 'typedef _di_IDirectPlay8Address *PIDirectPlay8Address;'}
  392.   PIDirectPlay8Address = ^IDirectPlay8Address;
  393.  
  394.   //
  395.   // COM definition for IDirectPlay8AddressIP Generic Interface
  396.   //
  397.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8AddressIP);'}
  398.   {$EXTERNALSYM IDirectPlay8AddressIP}
  399.   IDirectPlay8AddressIP = interface(IUnknown)
  400.     ['{e5a0e990-2bad-430b-87da-a142cf75de58}']
  401.     (*** IDirectPlay8AddressIP methods ***)
  402.     // Constructs a IDirectPlay8 TCP Address from a SOCKADDR structure
  403.     function BuildFromSockAddr(const pSockAddr: TSockAddr): HResult; stdcall;
  404.  
  405.     // Constructs a TCP Address from a string (hostname) and port
  406.     function BuildAddress(wszAddress: PWideChar; usPort: Word): HResult; stdcall;
  407.  
  408.     // Builds a local TCP Address
  409.     function BuildLocalAddress(const pguidAdapter: TGUID; usPort: Word): HResult; stdcall;
  410.  
  411.     // Gets the address from the structure in SOCKADR format
  412.     function GetSockAddress(psockAddress: PSockAddr; var pdwAddressBufferSize: DWORD): HResult; stdcall;
  413.  
  414.     // Gets the local afddress
  415.     function GetLocalAddress(out pguidAdapter: TGUID; out pusPort: Word): HResult; stdcall;
  416.  
  417.     // Gets the remote address
  418.     function GetAddress(wszAddress: PWideChar; var pdwAddressLength: DWORD; out psPort: Word): HResult; stdcall;
  419.   end;
  420.  
  421.  
  422. (****************************************************************************
  423.  *
  424.  * DirectPlay8Address Interface IIDs
  425.  *
  426.  ****************************************************************************)
  427.  
  428. type
  429.   // {83783300-4063-4c8a-9DB3-82830A7FEB31}
  430.   IID_IDirectPlay8Address = IDirectPlay8Address;
  431.   {$EXTERNALSYM IID_IDirectPlay8Address}
  432.   // {E5A0E990-2BAD-430b-87DA-A142CF75DE58}
  433.   IID_IDirectPlay8AddressIP = IDirectPlay8AddressIP; 
  434.   {$EXTERNALSYM IID_IDirectPlay8AddressIP}
  435.  
  436.  
  437.  
  438. (*==========================================================================;
  439.  *
  440.  *  Copyright (C) 1998-2002 Microsoft Corporation.  All Rights Reserved.
  441.  *
  442.  *  File:   DPlay8.h
  443.  *  Content: DirectPlay8 include file
  444.  *
  445.  ***************************************************************************)
  446.  
  447. const
  448. (****************************************************************************
  449.  *
  450.  * DirectPlay8 CLSIDs
  451.  *
  452.  ****************************************************************************)
  453.  
  454.   // {743F1DC6-5ABA-429f-8BDF-C54D03253DC2}
  455.   CLSID_DirectPlay8Client: TGUID = '{743f1dc6-5aba-429f-8bdf-c54d03253dc2}';
  456.   {$EXTERNALSYM CLSID_DirectPlay8Client}
  457.  
  458.   // {DA825E1B-6830-43d7-835D-0B5AD82956A2}
  459.   CLSID_DirectPlay8Server: TGUID = '{da825e1b-6830-43d7-835d-0b5ad82956a2}';
  460.   {$EXTERNALSYM CLSID_DirectPlay8Server}
  461.  
  462.   // {286F484D-375E-4458-A272-B138E2F80A6A}
  463.   CLSID_DirectPlay8Peer: TGUID = '{286f484d-375e-4458-a272-b138e2f80a6a}';
  464.   {$EXTERNALSYM CLSID_DirectPlay8Peer}
  465.  
  466.   // CLSIDs added for DirectX 9
  467.  
  468.   // {FC47060E-6153-4b34-B975-8E4121EB7F3C}
  469.   CLSID_DirectPlay8ThreadPool: TGUID = '{fc47060e-6153-4b34-b975-8e4121eb7f3c}';
  470.   {$EXTERNALSYM CLSID_DirectPlay8ThreadPool}
  471.  
  472.   // {E4C1D9A2-CBF7-48bd-9A69-34A55E0D8941}
  473.   CLSID_DirectPlay8NATResolver: TGUID = '{e4c1d9a2-cbf7-48bd-9a69-34a55e0d8941}';
  474.   {$EXTERNALSYM CLSID_DirectPlay8NATResolver}
  475.  
  476. (****************************************************************************
  477.  *
  478.  * DirectPlay8 Service Provider GUIDs
  479.  *
  480.  ****************************************************************************)
  481.  
  482.   // {53934290-628D-11D2-AE0F-006097B01411}
  483.   CLSID_DP8SP_IPX: TGUID = '{53934290-628d-11d2-ae0f-006097b01411}';
  484.   {$EXTERNALSYM CLSID_DP8SP_IPX}
  485.  
  486.   // {6D4A3650-628D-11D2-AE0F-006097B01411}
  487.   CLSID_DP8SP_MODEM: TGUID = '{6d4a3650-628d-11d2-ae0f-006097b01411}';
  488.   {$EXTERNALSYM CLSID_DP8SP_MODEM}
  489.  
  490.   // {743B5D60-628D-11D2-AE0F-006097B01411}
  491.   CLSID_DP8SP_SERIAL: TGUID = '{743b5d60-628d-11d2-ae0f-006097b01411}';
  492.   {$EXTERNALSYM CLSID_DP8SP_SERIAL}
  493.  
  494.   // {EBFE7BA0-628D-11D2-AE0F-006097B01411}
  495.   CLSID_DP8SP_TCPIP: TGUID = '{ebfe7ba0-628d-11d2-ae0f-006097b01411}';
  496.   {$EXTERNALSYM CLSID_DP8SP_TCPIP}
  497.  
  498.  
  499.   // Service providers added for DirectX 9
  500.  
  501.  
  502.   // {995513AF-3027-4b9a-956E-C772B3F78006}
  503.   CLSID_DP8SP_BLUETOOTH: TGUID = '{995513af-3027-4b9a-956e-c772b3f78006}';
  504.   {$EXTERNALSYM CLSID_DP8SP_BLUETOOTH}
  505.  
  506.  
  507. type
  508. (****************************************************************************
  509.  *
  510.  * DirectPlay8 Callback Functions
  511.  *
  512.  ****************************************************************************)
  513.  
  514.   //
  515.   // Callback Function Type Definition
  516.   //
  517.   TFNDPNMessageHandler = function (pvUserContext: Pointer; dwMessageType: DWORD; pMessage: Pointer): HRESULT; stdcall;
  518.   {$NODEFINE TFNDPNMessageHandler}
  519.   {$HPPEMIT 'typedef PFNDPNMESSAGEHANDLER TFNDPNMessageHandler;'}
  520.  
  521. (****************************************************************************
  522.  *
  523.  * DirectPlay8 Datatypes (Non-Structure / Non-Message)
  524.  *
  525.  ****************************************************************************)
  526.  
  527.   //
  528.   // Player IDs.  Used to uniquely identify a player in a session
  529.   //
  530.   PDPNID = ^DPNID;
  531.   {$EXTERNALSYM PDPNID}
  532.   DPNID = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWORD;
  533.   {$EXTERNALSYM DPNID}
  534.   TDPNID = DPNID;
  535.  
  536.   //
  537.   // Used as identifiers for operations
  538.   //
  539.   PDPNHandle = ^TDPNHandle;
  540.   DPNHANDLE = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWORD;
  541.   {$EXTERNALSYM DPNHANDLE}
  542.   TDPNHandle = DPNHANDLE;
  543.  
  544. (****************************************************************************
  545.  *
  546.  * DirectPlay8 Message Identifiers
  547.  *
  548.  ****************************************************************************)
  549.  
  550. const
  551.   DPN_MSGID_OFFSET                    = $FFFF0000;
  552.   {$EXTERNALSYM DPN_MSGID_OFFSET}
  553.   DPN_MSGID_ADD_PLAYER_TO_GROUP       = (DPN_MSGID_OFFSET or $0001);
  554.   {$EXTERNALSYM DPN_MSGID_ADD_PLAYER_TO_GROUP}
  555.   DPN_MSGID_APPLICATION_DESC          = (DPN_MSGID_OFFSET or $0002);
  556.   {$EXTERNALSYM DPN_MSGID_APPLICATION_DESC}
  557.   DPN_MSGID_ASYNC_OP_COMPLETE         = (DPN_MSGID_OFFSET or $0003);
  558.   {$EXTERNALSYM DPN_MSGID_ASYNC_OP_COMPLETE}
  559.   DPN_MSGID_CLIENT_INFO               = (DPN_MSGID_OFFSET or $0004);
  560.   {$EXTERNALSYM DPN_MSGID_CLIENT_INFO}
  561.   DPN_MSGID_CONNECT_COMPLETE          = (DPN_MSGID_OFFSET or $0005);
  562.   {$EXTERNALSYM DPN_MSGID_CONNECT_COMPLETE}
  563.   DPN_MSGID_CREATE_GROUP              = (DPN_MSGID_OFFSET or $0006);
  564.   {$EXTERNALSYM DPN_MSGID_CREATE_GROUP}
  565.   DPN_MSGID_CREATE_PLAYER             = (DPN_MSGID_OFFSET or $0007);
  566.   {$EXTERNALSYM DPN_MSGID_CREATE_PLAYER}
  567.   DPN_MSGID_DESTROY_GROUP             = (DPN_MSGID_OFFSET or $0008);
  568.   {$EXTERNALSYM DPN_MSGID_DESTROY_GROUP}
  569.   DPN_MSGID_DESTROY_PLAYER            = (DPN_MSGID_OFFSET or $0009);
  570.   {$EXTERNALSYM DPN_MSGID_DESTROY_PLAYER}
  571.   DPN_MSGID_ENUM_HOSTS_QUERY          = (DPN_MSGID_OFFSET or $000a);
  572.   {$EXTERNALSYM DPN_MSGID_ENUM_HOSTS_QUERY}
  573.   DPN_MSGID_ENUM_HOSTS_RESPONSE       = (DPN_MSGID_OFFSET or $000b);
  574.   {$EXTERNALSYM DPN_MSGID_ENUM_HOSTS_RESPONSE}
  575.   DPN_MSGID_GROUP_INFO                = (DPN_MSGID_OFFSET or $000c);
  576.   {$EXTERNALSYM DPN_MSGID_GROUP_INFO}
  577.   DPN_MSGID_HOST_MIGRATE              = (DPN_MSGID_OFFSET or $000d);
  578.   {$EXTERNALSYM DPN_MSGID_HOST_MIGRATE}
  579.   DPN_MSGID_INDICATE_CONNECT          = (DPN_MSGID_OFFSET or $000e);
  580.   {$EXTERNALSYM DPN_MSGID_INDICATE_CONNECT}
  581.   DPN_MSGID_INDICATED_CONNECT_ABORTED = (DPN_MSGID_OFFSET or $000f);
  582.   {$EXTERNALSYM DPN_MSGID_INDICATED_CONNECT_ABORTED}
  583.   DPN_MSGID_PEER_INFO                 = (DPN_MSGID_OFFSET or $0010);
  584.   {$EXTERNALSYM DPN_MSGID_PEER_INFO}
  585.   DPN_MSGID_RECEIVE                   = (DPN_MSGID_OFFSET or $0011);
  586.   {$EXTERNALSYM DPN_MSGID_RECEIVE}
  587.   DPN_MSGID_REMOVE_PLAYER_FROM_GROUP  = (DPN_MSGID_OFFSET or $0012);
  588.   {$EXTERNALSYM DPN_MSGID_REMOVE_PLAYER_FROM_GROUP}
  589.   DPN_MSGID_RETURN_BUFFER             = (DPN_MSGID_OFFSET or $0013);
  590.   {$EXTERNALSYM DPN_MSGID_RETURN_BUFFER}
  591.   DPN_MSGID_SEND_COMPLETE             = (DPN_MSGID_OFFSET or $0014);
  592.   {$EXTERNALSYM DPN_MSGID_SEND_COMPLETE}
  593.   DPN_MSGID_SERVER_INFO               = (DPN_MSGID_OFFSET or $0015);
  594.   {$EXTERNALSYM DPN_MSGID_SERVER_INFO}
  595.   DPN_MSGID_TERMINATE_SESSION         = (DPN_MSGID_OFFSET or $0016);
  596.   {$EXTERNALSYM DPN_MSGID_TERMINATE_SESSION}
  597.  
  598.   // Messages added for DirectX 9
  599.   DPN_MSGID_CREATE_THREAD             = (DPN_MSGID_OFFSET or $0017);
  600.   {$EXTERNALSYM DPN_MSGID_CREATE_THREAD}
  601.   DPN_MSGID_DESTROY_THREAD            = (DPN_MSGID_OFFSET or $0018);
  602.   {$EXTERNALSYM DPN_MSGID_DESTROY_THREAD}
  603.   DPN_MSGID_NAT_RESOLVER_QUERY        = (DPN_MSGID_OFFSET or $0101);
  604.   {$EXTERNALSYM DPN_MSGID_NAT_RESOLVER_QUERY}
  605.  
  606. (****************************************************************************
  607.  *
  608.  * DirectPlay8 Constants
  609.  *
  610.  ****************************************************************************)
  611.  
  612.   DPNID_ALL_PLAYERS_GROUP                 = 0;
  613.   {$EXTERNALSYM DPNID_ALL_PLAYERS_GROUP}
  614.  
  615.   //
  616.   // DESTROY_GROUP reasons
  617.   //
  618.   DPNDESTROYGROUPREASON_NORMAL            = $0001;
  619.   {$EXTERNALSYM DPNDESTROYGROUPREASON_NORMAL}
  620.   DPNDESTROYGROUPREASON_AUTODESTRUCTED    = $0002;
  621.   {$EXTERNALSYM DPNDESTROYGROUPREASON_AUTODESTRUCTED}
  622.   DPNDESTROYGROUPREASON_SESSIONTERMINATED = $0003;
  623.   {$EXTERNALSYM DPNDESTROYGROUPREASON_SESSIONTERMINATED}
  624.  
  625.   //
  626.   // DESTROY_PLAYER reasons
  627.   //
  628.   DPNDESTROYPLAYERREASON_NORMAL              = $0001;
  629.   {$EXTERNALSYM DPNDESTROYPLAYERREASON_NORMAL}
  630.   DPNDESTROYPLAYERREASON_CONNECTIONLOST      = $0002;
  631.   {$EXTERNALSYM DPNDESTROYPLAYERREASON_CONNECTIONLOST}
  632.   DPNDESTROYPLAYERREASON_SESSIONTERMINATED   = $0003;
  633.   {$EXTERNALSYM DPNDESTROYPLAYERREASON_SESSIONTERMINATED}
  634.   DPNDESTROYPLAYERREASON_HOSTDESTROYEDPLAYER = $0004;
  635.   {$EXTERNALSYM DPNDESTROYPLAYERREASON_HOSTDESTROYEDPLAYER}
  636.  
  637.  
  638.   DPN_MAX_APPDESC_RESERVEDDATA_SIZE          = 64;
  639.   {$EXTERNALSYM DPN_MAX_APPDESC_RESERVEDDATA_SIZE}
  640.  
  641.  
  642. (****************************************************************************
  643.  *
  644.  * DirectPlay8 Flags
  645.  *
  646.  ****************************************************************************)
  647.  
  648.   //
  649.   // Asynchronous operation flags (For Async Ops)
  650.   //
  651.   DPNOP_SYNC                   = $80000000;
  652.   {$EXTERNALSYM DPNOP_SYNC}
  653.  
  654.   //
  655.   // Add player to group flags (For AddPlayerToGroup)
  656.   //
  657.   DPNADDPLAYERTOGROUP_SYNC     = DPNOP_SYNC;
  658.   {$EXTERNALSYM DPNADDPLAYERTOGROUP_SYNC}
  659.  
  660.   //
  661.   // Cancel flags
  662.   //
  663.   DPNCANCEL_CONNECT           = $0001;
  664.   {$EXTERNALSYM DPNCANCEL_CONNECT}
  665.   DPNCANCEL_ENUM              = $0002;
  666.   {$EXTERNALSYM DPNCANCEL_ENUM}
  667.   DPNCANCEL_SEND              = $0004;
  668.   {$EXTERNALSYM DPNCANCEL_SEND}
  669.   DPNCANCEL_ALL_OPERATIONS    = $8000;
  670.   {$EXTERNALSYM DPNCANCEL_ALL_OPERATIONS}
  671.  
  672.   // Flags added for DirectX 9
  673.   DPNCANCEL_PLAYER_SENDS                    = $80000000;
  674.   {$EXTERNALSYM DPNCANCEL_PLAYER_SENDS}
  675.   DPNCANCEL_PLAYER_SENDS_PRIORITY_HIGH    = (DPNCANCEL_PLAYER_SENDS or $00010000);
  676.   {$EXTERNALSYM DPNCANCEL_PLAYER_SENDS_PRIORITY_HIGH}
  677.   DPNCANCEL_PLAYER_SENDS_PRIORITY_NORMAL    = (DPNCANCEL_PLAYER_SENDS or $00020000);
  678.   {$EXTERNALSYM DPNCANCEL_PLAYER_SENDS_PRIORITY_NORMAL}
  679.   DPNCANCEL_PLAYER_SENDS_PRIORITY_LOW        = (DPNCANCEL_PLAYER_SENDS or $00040000);
  680.   {$EXTERNALSYM DPNCANCEL_PLAYER_SENDS_PRIORITY_LOW}
  681.  
  682.   //
  683.   // Close flags (for Close, added for DirectX 9)
  684.   //
  685.   DPNCLOSE_IMMEDIATE                        = $00000001;
  686.   {$EXTERNALSYM DPNCLOSE_IMMEDIATE}
  687.  
  688.   //
  689.   // Connect flags (For Connect)
  690.   //
  691.   DPNCONNECT_SYNC              = DPNOP_SYNC;
  692.   {$EXTERNALSYM DPNCONNECT_SYNC}
  693.   DPNCONNECT_OKTOQUERYFORADDRESSING = $0001;
  694.   {$EXTERNALSYM DPNCONNECT_OKTOQUERYFORADDRESSING}
  695.  
  696.   //
  697.   // Create group flags (For CreateGroup)
  698.   //
  699.   DPNCREATEGROUP_SYNC          = DPNOP_SYNC;
  700.   {$EXTERNALSYM DPNCREATEGROUP_SYNC}
  701.  
  702.   //
  703.   // Destroy group flags (For DestroyGroup)
  704.   //
  705.   DPNDESTROYGROUP_SYNC         = DPNOP_SYNC;
  706.   {$EXTERNALSYM DPNDESTROYGROUP_SYNC}
  707.  
  708.   //
  709.   // Enumerate clients and groups flags (For EnumPlayersAndGroups)
  710.   //
  711.   DPNENUM_PLAYERS              = $0001;
  712.   {$EXTERNALSYM DPNENUM_PLAYERS}
  713.   DPNENUM_GROUPS               = $0010;
  714.   {$EXTERNALSYM DPNENUM_GROUPS}
  715.  
  716.   //
  717.   // Enum hosts flags (For EnumHosts)
  718.   //
  719.   DPNENUMHOSTS_SYNC                   = DPNOP_SYNC;
  720.   {$EXTERNALSYM DPNENUMHOSTS_SYNC}
  721.   DPNENUMHOSTS_OKTOQUERYFORADDRESSING = $0001;
  722.   {$EXTERNALSYM DPNENUMHOSTS_OKTOQUERYFORADDRESSING}
  723.   DPNENUMHOSTS_NOBROADCASTFALLBACK    = $0002;
  724.   {$EXTERNALSYM DPNENUMHOSTS_NOBROADCASTFALLBACK}
  725.  
  726.   //
  727.   // Enum service provider flags (For EnumSP)
  728.   //
  729.   DPNENUMSERVICEPROVIDERS_ALL         = $0001;
  730.   {$EXTERNALSYM DPNENUMSERVICEPROVIDERS_ALL}
  731.  
  732.   //
  733.   // GetLocalHostAddresses flags (added for DirectX 9)
  734.   //
  735.   DPNGETLOCALHOSTADDRESSES_COMBINED   = $0001;
  736.   {$EXTERNALSYM DPNGETLOCALHOSTADDRESSES_COMBINED}
  737.  
  738.   //
  739.   // Get send queue info flags (For GetSendQueueInfo)
  740.   //
  741.   DPNGETSENDQUEUEINFO_PRIORITY_NORMAL = $0001;
  742.   {$EXTERNALSYM DPNGETSENDQUEUEINFO_PRIORITY_NORMAL}
  743.   DPNGETSENDQUEUEINFO_PRIORITY_HIGH   = $0002;
  744.   {$EXTERNALSYM DPNGETSENDQUEUEINFO_PRIORITY_HIGH}
  745.   DPNGETSENDQUEUEINFO_PRIORITY_LOW    = $0004;
  746.   {$EXTERNALSYM DPNGETSENDQUEUEINFO_PRIORITY_LOW}
  747.  
  748.   //
  749.   // Group information flags (For Group Info)
  750.   //
  751.   DPNGROUP_AUTODESTRUCT               = $0001;
  752.   {$EXTERNALSYM DPNGROUP_AUTODESTRUCT}
  753.  
  754.   //
  755.   // Host flags (For Host)
  756.   //
  757.   DPNHOST_OKTOQUERYFORADDRESSING      = $0001;
  758.   {$EXTERNALSYM DPNHOST_OKTOQUERYFORADDRESSING}
  759.  
  760.   //
  761.   // Set info
  762.   //
  763.   DPNINFO_NAME                        = $0001;
  764.   {$EXTERNALSYM DPNINFO_NAME}
  765.   DPNINFO_DATA                        = $0002;
  766.   {$EXTERNALSYM DPNINFO_DATA}
  767.  
  768.   //
  769.   // Initialize flags (For Initialize)
  770.   //
  771.   DPNINITIALIZE_DISABLEPARAMVAL       = $0001;
  772.   {$EXTERNALSYM DPNINITIALIZE_DISABLEPARAMVAL}
  773.   // Flags added for DirectX 9
  774.   DPNINITIALIZE_HINT_LANSESSION       = $0002;
  775.   {$EXTERNALSYM DPNINITIALIZE_HINT_LANSESSION}
  776.   DPNINITIALIZE_DISABLELINKTUNING     = $0004;
  777.   {$EXTERNALSYM DPNINITIALIZE_DISABLELINKTUNING}
  778.  
  779.  
  780.   //
  781.   // Register Lobby flags
  782.   //
  783.   DPNLOBBY_REGISTER                   = $0001;
  784.   {$EXTERNALSYM DPNLOBBY_REGISTER}
  785.   DPNLOBBY_UNREGISTER                 = $0002;
  786.   {$EXTERNALSYM DPNLOBBY_UNREGISTER}
  787.  
  788.   //
  789.   // Player information flags (For Player Info / Player Messages)
  790.   //
  791.   DPNPLAYER_LOCAL       = $0002;
  792.   {$EXTERNALSYM DPNPLAYER_LOCAL}
  793.   DPNPLAYER_HOST        = $0004;
  794.   {$EXTERNALSYM DPNPLAYER_HOST}
  795.  
  796.   //
  797.   // Receive indication flags (added for DirectX 9)
  798.   //
  799.   DPNRECEIVE_GUARANTEED       = $0001;
  800.   {$EXTERNALSYM DPNRECEIVE_GUARANTEED}
  801.   DPNRECEIVE_COALESCED        = $0002;
  802.   {$EXTERNALSYM DPNRECEIVE_COALESCED}
  803.  
  804.   //
  805.   // Remove player from group flags (For RemovePlayerFromGroup)
  806.   //
  807.   DPNREMOVEPLAYERFROMGROUP_SYN = DPNOP_SYNC;
  808.   {$EXTERNALSYM DPNREMOVEPLAYERFROMGROUP_SYN}
  809.  
  810.   //
  811.   // Send flags (For Send/SendTo)
  812.   //
  813.   DPNSEND_SYNC                = DPNOP_SYNC;
  814.   {$EXTERNALSYM DPNSEND_SYNC}
  815.   DPNSEND_NOCOPY              = $0001;
  816.   {$EXTERNALSYM DPNSEND_NOCOPY}
  817.   DPNSEND_NOCOMPLETE          = $0002;
  818.   {$EXTERNALSYM DPNSEND_NOCOMPLETE}
  819.   DPNSEND_COMPLETEONPROCESS   = $0004;
  820.   {$EXTERNALSYM DPNSEND_COMPLETEONPROCESS}
  821.   DPNSEND_GUARANTEED          = $0008;
  822.   {$EXTERNALSYM DPNSEND_GUARANTEED}
  823.   DPNSEND_NONSEQUENTIAL       = $0010;
  824.   {$EXTERNALSYM DPNSEND_NONSEQUENTIAL}
  825.   DPNSEND_NOLOOPBACK          = $0020;
  826.   {$EXTERNALSYM DPNSEND_NOLOOPBACK}
  827.   DPNSEND_PRIORITY_LOW        = $0040;
  828.   {$EXTERNALSYM DPNSEND_PRIORITY_LOW}
  829.   DPNSEND_PRIORITY_HIGH       = $0080;
  830.   {$EXTERNALSYM DPNSEND_PRIORITY_HIGH}
  831.   // Flag added for DirectX 9
  832.   DPNSEND_COALESCE                        = $0100;
  833.   {$EXTERNALSYM DPNSEND_COALESCE}
  834.  
  835.   //
  836.   // Send complete indication flags (added for DirectX 9)
  837.   //
  838.   DPNSENDCOMPLETE_GUARANTEED                = $0001;
  839.   {$EXTERNALSYM DPNSENDCOMPLETE_GUARANTEED}
  840.   DPNSENDCOMPLETE_COALESCED                = $0002;
  841.   {$EXTERNALSYM DPNSENDCOMPLETE_COALESCED}
  842.  
  843.   //
  844.   // Session Flags (for DPN_APPLICATION_DESC)
  845.   //
  846.   DPNSESSION_CLIENT_SERVER    = $0001;
  847.   {$EXTERNALSYM DPNSESSION_CLIENT_SERVER}
  848.   DPNSESSION_MIGRATE_HOST     = $0004;
  849.   {$EXTERNALSYM DPNSESSION_MIGRATE_HOST}
  850.   DPNSESSION_NODPNSVR         = $0040;
  851.   {$EXTERNALSYM DPNSESSION_NODPNSVR}
  852.   DPNSESSION_REQUIREPASSWORD  = $0080;
  853.   {$EXTERNALSYM DPNSESSION_REQUIREPASSWORD}
  854.   // Flag added for DirectX 9
  855.   DPNSESSION_NOENUMS                        = $0100;
  856.   {$EXTERNALSYM DPNSESSION_NOENUMS}
  857.   DPNSESSION_FAST_SIGNED                    = $0200;
  858.   {$EXTERNALSYM DPNSESSION_FAST_SIGNED}
  859.   DPNSESSION_FULL_SIGNED                    = $0400;
  860.   {$EXTERNALSYM DPNSESSION_FULL_SIGNED}
  861.  
  862.   //
  863.   // Set client info flags (For SetClientInfo)
  864.   //
  865.   DPNSETCLIENTINFO_SYNC       = DPNOP_SYNC;
  866.   {$EXTERNALSYM DPNSETCLIENTINFO_SYNC}
  867.  
  868.   //
  869.   // Set group info flags (For SetGroupInfo)
  870.   //
  871.   DPNSETGROUPINFO_SYNC        = DPNOP_SYNC;
  872.   {$EXTERNALSYM DPNSETGROUPINFO_SYNC}
  873.  
  874.   //
  875.   // Set peer info flags (For SetPeerInfo)
  876.   //
  877.   DPNSETPEERINFO_SYNC         = DPNOP_SYNC;
  878.   {$EXTERNALSYM DPNSETPEERINFO_SYNC}
  879.  
  880.   //
  881.   // Set server info flags (For SetServerInfo)
  882.   //
  883.   DPNSETSERVERINFO_SYNC       = DPNOP_SYNC;
  884.   {$EXTERNALSYM DPNSETSERVERINFO_SYNC}
  885.  
  886.   //
  887.   // SP capabilities flags
  888.   //
  889.   DPNSPCAPS_SUPPORTSDPNSVR      = $0001;
  890.   {$EXTERNALSYM DPNSPCAPS_SUPPORTSDPNSVR}
  891.   DPNSPCAPS_SUPPORTSDPNSRV      = DPNSPCAPS_SUPPORTSDPNSVR;
  892.   {$EXTERNALSYM DPNSPCAPS_SUPPORTSDPNSRV}
  893.   DPNSPCAPS_SUPPORTSBROADCAST   = $0002;
  894.   {$EXTERNALSYM DPNSPCAPS_SUPPORTSBROADCAST}
  895.   DPNSPCAPS_SUPPORTSALLADAPTERS = $0004;
  896.   {$EXTERNALSYM DPNSPCAPS_SUPPORTSALLADAPTERS}
  897.   // Flags added for DirectX 9
  898.   DPNSPCAPS_SUPPORTSTHREADPOOL            = $0008;
  899.   {$EXTERNALSYM DPNSPCAPS_SUPPORTSTHREADPOOL}
  900.   DPNSPCAPS_NETWORKSIMULATOR                = $0010;
  901.   {$EXTERNALSYM DPNSPCAPS_NETWORKSIMULATOR}
  902.  
  903.   //
  904.   // SP information flags (added for DirectX 9)
  905.   //
  906.   DPNSPINFO_NETWORKSIMULATORDEVICE        = $0001;
  907.   {$EXTERNALSYM DPNSPINFO_NETWORKSIMULATORDEVICE}
  908.  
  909. (****************************************************************************
  910.  *
  911.  * DirectPlay8 Structures (Non-Message)
  912.  *
  913.  ****************************************************************************)
  914.  
  915. type
  916.   //
  917.   // Application description
  918.   //
  919.  
  920.   PDPNApplicationDesc = ^TDPNApplicationDesc;
  921.   _DPN_APPLICATION_DESC = packed record
  922.     dwSize: DWORD;                    // Size of this structure
  923.     dwFlags: DWORD;                   // Flags (DPNSESSION_...)
  924.     guidInstance: TGUID;              // Instance GUID
  925.     guidApplication: TGUID;           // Application GUID
  926.     dwMaxPlayers: DWORD;              // Maximum # of players allowed (0=no limit)
  927.     dwCurrentPlayers: DWORD;          // Current # of players allowed
  928.     pwszSessionName: PWideChar;       // Name of the session
  929.     pwszPassword: PWideChar;          // Password for the session
  930.     pvReservedData: Pointer;
  931.     dwReservedDataSize: DWORD;
  932.     pvApplicationReservedData: Pointer;
  933.     dwApplicationReservedDataSize: DWORD;
  934.   end;
  935.   {$EXTERNALSYM _DPN_APPLICATION_DESC}
  936.   DPN_APPLICATION_DESC = _DPN_APPLICATION_DESC;
  937.   {$EXTERNALSYM DPN_APPLICATION_DESC}
  938.   TDPNApplicationDesc = _DPN_APPLICATION_DESC;
  939.  
  940.   //
  941.   // Generic Buffer Description
  942.   //
  943.   PBufferDesc = ^TBufferDesc;
  944.   _BUFFERDESC = packed record
  945.     wBufferSize:DWORD;
  946.     pBufferData: PByte;
  947.   end;
  948.   {$EXTERNALSYM _BUFFERDESC}
  949.   BUFFERDESC = _BUFFERDESC;
  950.   {$EXTERNALSYM BUFFERDESC}
  951.   TBufferDesc = _BUFFERDESC;
  952.  
  953.   PDPNBufferDesc = ^TDPNBufferDesc;
  954.   DPN_BUFFER_DESC = _BUFFERDESC;
  955.   {$EXTERNALSYM DPN_BUFFER_DESC}
  956.   TDPNBufferDesc = DPN_BUFFER_DESC;
  957.  
  958.   //
  959.   // DirectPlay8 capabilities
  960.   //
  961.   PDPNCaps = ^TDPNCaps;
  962.   _DPN_CAPS = packed record
  963.     dwSize: DWORD;                            // Size of this structure
  964.     dwFlags: DWORD;                        // Flags
  965.     dwConnectTimeout: DWORD;                // ms before a connect request times out
  966.     dwConnectRetries: DWORD;                // # of times to attempt the connection
  967.     dwTimeoutUntilKeepAlive: DWORD;        // ms of inactivity before a keep alive is sent
  968.   end;
  969.   {$EXTERNALSYM _DPN_CAPS}
  970.   DPN_CAPS = _DPN_CAPS;
  971.   {$EXTERNALSYM DPN_CAPS}
  972.   TDPNCaps = _DPN_CAPS;
  973.  
  974.   //
  975.   // Extended capabilities structures (added for DirectX 9)
  976.   //
  977.   PDPNCapsEx = ^TDPNCapsEx;
  978.   _DPN_CAPS_EX = packed record
  979.     dwSize: DWORD;                        // Size of this structure
  980.     dwFlags: DWORD;                        // Flags
  981.     dwConnectTimeout: DWORD;            // ms before a connect request times out
  982.     dwConnectRetries: DWORD;                // # of times to attempt the connection
  983.     dwTimeoutUntilKeepAlive: DWORD;        // ms of inactivity before a keep alive is sent
  984.     dwMaxRecvMsgSize: DWORD;            // maximum size in bytes of message that can be received
  985.     dwNumSendRetries: DWORD;            // maximum number of send retries before link is considered dead
  986.     dwMaxSendRetryInterval: DWORD;        // maximum period in msec between send retries
  987.     dwDropThresholdRate: DWORD;            // percentage of dropped packets before throttling
  988.     dwThrottleRate: DWORD;                // percentage amount to reduce send window when throttling
  989.     dwNumHardDisconnectSends: DWORD;    // number of hard disconnect frames to send when close immediate flag is specified
  990.     dwMaxHardDisconnectPeriod: DWORD;    // maximum period between hard disconnect sends
  991.   end;
  992.   {$EXTERNALSYM _DPN_CAPS_EX}
  993.   DPN_CAPS_EX = _DPN_CAPS_EX;
  994.   {$EXTERNALSYM DPN_CAPS_EX}
  995.   TDPNCapsEx = _DPN_CAPS_EX;
  996.  
  997.   // Connection Statistics information
  998.  
  999.   PDPNConnectionInfo = ^TDPNConnectionInfo;
  1000.   _DPN_CONNECTION_INFO = packed record
  1001.     dwSize: DWORD;
  1002.     dwRoundTripLatencyMS: DWORD;
  1003.     dwThroughputBPS: DWORD;
  1004.     dwPeakThroughputBPS: DWORD;
  1005.  
  1006.     dwBytesSentGuaranteed: DWORD;
  1007.     dwPacketsSentGuaranteed: DWORD;
  1008.     dwBytesSentNonGuaranteed: DWORD;
  1009.     dwPacketsSentNonGuaranteed: DWORD;
  1010.  
  1011.     dwBytesRetried: DWORD;    // Guaranteed only
  1012.     dwPacketsRetried: DWORD;  // Guaranteed only
  1013.     dwBytesDropped: DWORD;    // Non Guaranteed only
  1014.     dwPacketsDropped: DWORD;  // Non Guaranteed only
  1015.  
  1016.     dwMessagesTransmittedHighPriority: DWORD;
  1017.     dwMessagesTimedOutHighPriority: DWORD;
  1018.     dwMessagesTransmittedNormalPriority: DWORD;
  1019.     dwMessagesTimedOutNormalPriority: DWORD;
  1020.     dwMessagesTransmittedLowPriority: DWORD;
  1021.     dwMessagesTimedOutLowPriority: DWORD;
  1022.  
  1023.     dwBytesReceivedGuaranteed: DWORD;
  1024.     dwPacketsReceivedGuaranteed: DWORD;
  1025.     dwBytesReceivedNonGuaranteed: DWORD;
  1026.     dwPacketsReceivedNonGuaranteed: DWORD;
  1027.     dwMessagesReceived: DWORD;
  1028.   end;
  1029.   {$EXTERNALSYM _DPN_CONNECTION_INFO}
  1030.   DPN_CONNECTION_INFO = _DPN_CONNECTION_INFO;
  1031.   {$EXTERNALSYM DPN_CONNECTION_INFO}
  1032.   TDPNConnectionInfo = _DPN_CONNECTION_INFO;
  1033.  
  1034.  
  1035.   //
  1036.   // Group information strucutre
  1037.   //
  1038.   PDPNGroupInfo = ^TDPNGroupInfo;
  1039.   _DPN_GROUP_INFO = packed record
  1040.     dwSize: DWORD;          // size of this structure
  1041.     dwInfoFlags: DWORD;     // information contained
  1042.     pwszName: PWideChar;    // Unicode Name
  1043.     pvData: Pointer;        // data block
  1044.     dwDataSize: DWORD;      // size in BYTES of data block
  1045.     dwGroupFlags: DWORD;    // group flags (DPNGROUP_...)
  1046.   end;
  1047.   {$EXTERNALSYM _DPN_GROUP_INFO}
  1048.   DPN_GROUP_INFO = _DPN_GROUP_INFO;
  1049.   {$EXTERNALSYM DPN_GROUP_INFO}
  1050.   TDPNGroupInfo = _DPN_GROUP_INFO;
  1051.  
  1052.   //
  1053.   // Player information structure
  1054.   //
  1055.   PDPNPlayerInfo = ^TDPNPlayerInfo;
  1056.   _DPN_PLAYER_INFO = packed record
  1057.     dwSize: DWORD;          // size of this structure
  1058.     dwInfoFlags: DWORD;     // information contained
  1059.     pwszName: PWideChar;    // Unicode Name
  1060.     pvData: Pointer;        // data block
  1061.     dwDataSize: DWORD;      // size in BYTES of data block
  1062.     dwPlayerFlags: DWORD;   // player flags (DPNPLAYER_...)
  1063.   end;
  1064.   {$EXTERNALSYM _DPN_PLAYER_INFO}
  1065.   DPN_PLAYER_INFO = _DPN_PLAYER_INFO;
  1066.   {$EXTERNALSYM DPN_PLAYER_INFO}
  1067.   TDPNPlayerInfo = _DPN_PLAYER_INFO;
  1068.  
  1069.   PDPNSecurityCredentials = ^TDPNSecurityCredentials;
  1070.   _DPN_SECURITY_CREDENTIALS = record
  1071.   end;
  1072.   {$EXTERNALSYM _DPN_SECURITY_CREDENTIALS}
  1073.   DPN_SECURITY_CREDENTIALS = _DPN_SECURITY_CREDENTIALS;
  1074.   {$EXTERNALSYM DPN_SECURITY_CREDENTIALS}
  1075.   TDPNSecurityCredentials = _DPN_SECURITY_CREDENTIALS;
  1076.  
  1077.   PDPNSecurityDesc = ^TDPNSecurityDesc;
  1078.   _DPN_SECURITY_DESC = record
  1079.   end;
  1080.   {$EXTERNALSYM _DPN_SECURITY_DESC}
  1081.   DPN_SECURITY_DESC = _DPN_SECURITY_DESC;
  1082.   {$EXTERNALSYM DPN_SECURITY_DESC}
  1083.   TDPNSecurityDesc = _DPN_SECURITY_DESC;
  1084.  
  1085.   //
  1086.   // Service provider & adapter enumeration structure
  1087.   //
  1088.   PDPNServiceProviderInfo = ^TDPNServiceProviderInfo;
  1089.   _DPN_SERVICE_PROVIDER_INFO = packed record
  1090.      dwFlags: DWORD;
  1091.      guid: TGUID;            // SP Guid
  1092.      pwszName: PWideChar;    // Friendly Name
  1093.      pvReserved: Pointer;
  1094.      dwReserved: DWORD;
  1095.   end;
  1096.   {$EXTERNALSYM _DPN_SERVICE_PROVIDER_INFO}
  1097.   DPN_SERVICE_PROVIDER_INFO = _DPN_SERVICE_PROVIDER_INFO;
  1098.   {$EXTERNALSYM DPN_SERVICE_PROVIDER_INFO}
  1099.   TDPNServiceProviderInfo = _DPN_SERVICE_PROVIDER_INFO;
  1100.  
  1101.   //
  1102.   // Service provider caps structure
  1103.   //
  1104.   PDPNSpCaps = ^TDPNSpCaps;
  1105.   _DPN_SP_CAPS = packed record
  1106.     dwSize: DWORD;                   // Size of this structure
  1107.     dwFlags: DWORD;                  // Flags ((DPNSPCAPS_...)
  1108.     dwNumThreads: DWORD;             // # of worker threads to use
  1109.     dwDefaultEnumCount: DWORD;       // default # of enum requests
  1110.     dwDefaultEnumRetryInterval: DWORD; // default ms between enum requests
  1111.     dwDefaultEnumTimeout: DWORD;     // default enum timeout
  1112.     dwMaxEnumPayloadSize: DWORD;     // maximum size in bytes for enum payload data
  1113.     dwBuffersPerThread: DWORD;       // number of receive buffers per thread
  1114.     dwSystemBufferSize: DWORD;       // amount of buffering to do in addition to posted receive buffers
  1115.   end;
  1116.   {$EXTERNALSYM _DPN_SP_CAPS}
  1117.   DPN_SP_CAPS = _DPN_SP_CAPS;
  1118.   {$EXTERNALSYM DPN_SP_CAPS}
  1119.   TDPNSpCaps = _DPN_SP_CAPS;
  1120.  
  1121.  
  1122. (****************************************************************************
  1123.  *
  1124.  * IDirectPlay8 message handler call back structures
  1125.  *
  1126.  ****************************************************************************)
  1127.  
  1128.   //
  1129.   // Add player to group strucutre for message handler
  1130.   // (DPN_MSGID_ADD_PLAYER_TO_GROUP)
  1131.   //
  1132.   PDPNMsgAddPlayerToGroup = ^TDPNMsgAddPlayerToGroup;
  1133.   _DPNMSG_ADD_PLAYER_TO_GROUP = packed record
  1134.     dwSize: DWORD;            // Size of this structure
  1135.     dpnidGroup: TDPNID;       // DPNID of group
  1136.     pvGroupContext: Pointer;  // Group context value
  1137.     dpnidPlayer: TDPNID;      // DPNID of added player
  1138.     pvPlayerContext: Pointer; // Player context value
  1139.   end;
  1140.   {$EXTERNALSYM _DPNMSG_ADD_PLAYER_TO_GROUP}
  1141.   DPNMSG_ADD_PLAYER_TO_GROUP = _DPNMSG_ADD_PLAYER_TO_GROUP;
  1142.   {$EXTERNALSYM DPNMSG_ADD_PLAYER_TO_GROUP}
  1143.   TDPNMsgAddPlayerToGroup = _DPNMSG_ADD_PLAYER_TO_GROUP;
  1144.  
  1145.   //
  1146.   // Async operation completion structure for message handler
  1147.   // (DPN_MSGID_ASYNC_OP_COMPLETE)
  1148.   //
  1149.   PDPNMsgAsyncOpComplete = ^TDPNMsgAsyncOpComplete;
  1150.   _DPNMSG_ASYNC_OP_COMPLETE = packed record
  1151.     dwSize: DWORD;          // Size of this structure
  1152.     hAsyncOp: TDPNHandle;   // DirectPlay8 async operation handle
  1153.     pvUserContext: Pointer; // User context supplied
  1154.     hResultCode: HRESULT;   // HRESULT of operation
  1155.   end;
  1156.   {$EXTERNALSYM _DPNMSG_ASYNC_OP_COMPLETE}
  1157.   DPNMSG_ASYNC_OP_COMPLETE = _DPNMSG_ASYNC_OP_COMPLETE;
  1158.   {$EXTERNALSYM DPNMSG_ASYNC_OP_COMPLETE}
  1159.   TDPNMsgAsyncOpComplete = _DPNMSG_ASYNC_OP_COMPLETE;
  1160.  
  1161.   //
  1162.   // Client info structure for message handler
  1163.   // (DPN_MSGID_CLIENT_INFO)
  1164.   //
  1165.   PDPNMsgClientInfo = ^TDPNMsgClientInfo;
  1166.   _DPNMSG_CLIENT_INFO = packed record
  1167.     dwSize: DWORD;            // Size of this structure
  1168.     dpnidClient: TDPNID;      // DPNID of client
  1169.     pvPlayerContext: Pointer; // Player context value
  1170.   end;
  1171.   {$EXTERNALSYM _DPNMSG_CLIENT_INFO}
  1172.   DPNMSG_CLIENT_INFO = _DPNMSG_CLIENT_INFO;
  1173.   {$EXTERNALSYM DPNMSG_CLIENT_INFO}
  1174.   TDPNMsgClientInfo = _DPNMSG_CLIENT_INFO;
  1175.  
  1176.   //
  1177.   // Connect complete structure for message handler
  1178.   // (DPN_MSGID_CONNECT_COMPLETE)
  1179.   //
  1180.   PDPNMsgConnectComplete = ^TDPNMsgConnectComplete;
  1181.   _DPNMSG_CONNECT_COMPLETE = packed record
  1182.     dwSize: DWORD;                     // Size of this structure
  1183.     hAsyncOp: TDPNHandle;              // DirectPlay8 Async operation handle
  1184.     pvUserContext: Pointer;            // User context supplied at Connect
  1185.     hResultCode: HRESULT;              // HRESULT of connection attempt
  1186.     pvApplicationReplyData: Pointer;   // Connection reply data from Host/Server
  1187.     dwApplicationReplyDataSize: DWORD; // Size (in bytes) of pvApplicationReplyData
  1188.  
  1189.     // Fields added for DirectX 9
  1190.     dpnidLocal: TDPNID;                // DPNID of local player
  1191.   end;
  1192.   {$EXTERNALSYM _DPNMSG_CONNECT_COMPLETE}
  1193.   DPNMSG_CONNECT_COMPLETE = _DPNMSG_CONNECT_COMPLETE;
  1194.   {$EXTERNALSYM DPNMSG_CONNECT_COMPLETE}
  1195.   TDPNMsgConnectComplete = _DPNMSG_CONNECT_COMPLETE;
  1196.  
  1197.   //
  1198.   // Create group structure for message handler
  1199.   // (DPN_MSGID_CREATE_GROUP)
  1200.   //
  1201.   PDPNMsgCreateGroup = ^TDPNMsgCreateGroup;
  1202.   _DPNMSG_CREATE_GROUP = packed record
  1203.     dwSize: DWORD;           // Size of this structure
  1204.     dpnidGroup: TDPNID;      // DPNID of new group
  1205.     dpnidOwner: TDPNID;      // Owner of newgroup
  1206.     pvGroupContext: Pointer; // Group context value
  1207.  
  1208.     // Fields added for DirectX 9
  1209.     pvOwnerContext: Pointer; // Owner context value
  1210.   end;
  1211.   {$EXTERNALSYM _DPNMSG_CREATE_GROUP}
  1212.   DPNMSG_CREATE_GROUP = _DPNMSG_CREATE_GROUP;
  1213.   {$EXTERNALSYM DPNMSG_CREATE_GROUP}
  1214.   TDPNMsgCreateGroup = _DPNMSG_CREATE_GROUP;
  1215.  
  1216.   //
  1217.   // Create player structure for message handler
  1218.   // (DPN_MSGID_CREATE_PLAYER)
  1219.   //
  1220.   PDPNMsgCreatePlayer = ^TDPNMsgCreatePlayer;
  1221.   _DPNMSG_CREATE_PLAYER = packed record
  1222.     dwSize: DWORD;            // Size of this structure
  1223.     dpnidPlayer: DPNID;       // DPNID of new player
  1224.     pvPlayerContext: Pointer; // Player context value
  1225.   end;
  1226.   {$EXTERNALSYM _DPNMSG_CREATE_PLAYER}
  1227.   DPNMSG_CREATE_PLAYER = _DPNMSG_CREATE_PLAYER;
  1228.   {$EXTERNALSYM DPNMSG_CREATE_PLAYER}
  1229.   TDPNMsgCreatePlayer = _DPNMSG_CREATE_PLAYER;
  1230.  
  1231.   //
  1232.   // Destroy group structure for message handler
  1233.   // (DPN_MSGID_DESTROY_GROUP)
  1234.   //
  1235.   PDPNMsgDestroyGroup = ^TDPNMsgDestroyGroup;
  1236.   _DPNMSG_DESTROY_GROUP = packed record
  1237.     dwSize: DWORD;           // Size of this structure
  1238.     dpnidGroup: TDPNID;      // DPNID of destroyed group
  1239.     pvGroupContext: Pointer; // Group context value
  1240.     dwReason: DWORD;         // Information only
  1241.   end;
  1242.   {$EXTERNALSYM _DPNMSG_DESTROY_GROUP}
  1243.   DPNMSG_DESTROY_GROUP = _DPNMSG_DESTROY_GROUP;
  1244.   {$EXTERNALSYM DPNMSG_DESTROY_GROUP}
  1245.   TDPNMsgDestroyGroup = _DPNMSG_DESTROY_GROUP;
  1246.  
  1247.   //
  1248.   // Destroy player structure for message handler
  1249.   // (DPN_MSGID_DESTROY_PLAYER)
  1250.   //
  1251.   PDPNMsgDestroyPlayer = ^TDPNMsgDestroyPlayer;
  1252.   _DPNMSG_DESTROY_PLAYER = packed record
  1253.     dwSize: DWORD;            // Size of this structure
  1254.     dpnidPlayer: TDPNID;      // DPNID of leaving player
  1255.     pvPlayerContext: Pointer; // Player context value
  1256.     dwReason: DWORD;          // Information only
  1257.   end;
  1258.   {$EXTERNALSYM _DPNMSG_DESTROY_PLAYER}
  1259.   DPNMSG_DESTROY_PLAYER = _DPNMSG_DESTROY_PLAYER;
  1260.   {$EXTERNALSYM DPNMSG_DESTROY_PLAYER}
  1261.   TDPNMsgDestroyPlayer = _DPNMSG_DESTROY_PLAYER;
  1262.  
  1263.   //
  1264.   // Enumeration request received structure for message handler
  1265.   // (DPN_MSGID_ENUM_HOSTS_QUERY)
  1266.   //
  1267.   PDPNMsgEnumHostsQuery = ^TDPNMsgEnumHostsQuery;
  1268.   _DPNMSG_ENUM_HOSTS_QUERY = packed record
  1269.     dwSize: DWORD;                        // Size of this structure.
  1270.     pAddressSender: IDirectPlay8Address;  // Address of client who sent the request
  1271.     pAddressDevice: IDirectPlay8Address;  // Address of device request was received on
  1272.     pvReceivedData: Pointer;              // Request data (set on client)
  1273.     dwReceivedDataSize: DWORD;            // Request data size (set on client)
  1274.     dwMaxResponseDataSize: DWORD;         // Max allowable size of enum response
  1275.     pvResponseData: Pointer;              // Optional query repsonse (user set)
  1276.     dwResponseDataSize: DWORD;            // Optional query response size (user set)
  1277.     pvResponseContext: Pointer;           // Optional query response context (user set)
  1278.   end;
  1279.   {$EXTERNALSYM _DPNMSG_ENUM_HOSTS_QUERY}
  1280.   DPNMSG_ENUM_HOSTS_QUERY = _DPNMSG_ENUM_HOSTS_QUERY;
  1281.   {$EXTERNALSYM DPNMSG_ENUM_HOSTS_QUERY}
  1282.   TDPNMsgEnumHostsQuery = _DPNMSG_ENUM_HOSTS_QUERY;
  1283.  
  1284.   //
  1285.   // Enumeration response received structure for message handler
  1286.   // (DPN_MSGID_ENUM_HOSTS_RESPONSE)
  1287.   //
  1288.   PDPNMsgEnumHostsResponse = ^TDPNMsgEnumHostsResponse;
  1289.   _DPNMSG_ENUM_HOSTS_RESPONSE = packed record
  1290.     dwSize: DWORD;                                // Size of this structure
  1291.     pAddressSender: IDirectPlay8Address;          // Address of host who responded
  1292.     pAddressDevice: IDirectPlay8Address;          // Device response was received on
  1293.     pApplicationDescription: PDPNApplicationDesc; // Application description for the session
  1294.     pvResponseData: Pointer;                      // Optional response data (set on host)
  1295.     dwResponseDataSize: DWORD;                    // Optional response data size (set on host)
  1296.     pvUserContext: Pointer;                       // Context value supplied for enumeration
  1297.     dwRoundTripLatencyMS: DWORD;                  // Round trip latency in MS
  1298.   end;
  1299.   {$EXTERNALSYM _DPNMSG_ENUM_HOSTS_RESPONSE}
  1300.   DPNMSG_ENUM_HOSTS_RESPONSE = _DPNMSG_ENUM_HOSTS_RESPONSE;
  1301.   {$EXTERNALSYM DPNMSG_ENUM_HOSTS_RESPONSE}
  1302.   TDPNMsgEnumHostsResponse = _DPNMSG_ENUM_HOSTS_RESPONSE;
  1303.  
  1304.   //
  1305.   // Group info structure for message handler
  1306.   // (DPN_MSGID_GROUP_INFO)
  1307.   //
  1308.   PDPNMsgGroupInfo = ^TDPNMsgGroupInfo;
  1309.   _DPNMSG_GROUP_INFO = packed record
  1310.     dwSize: DWORD;              // Size of this structure
  1311.     dpnidGroup: TDPNID;         // DPNID of group
  1312.     pvGroupContext: Pointer;    // Group context value
  1313.   end;
  1314.   {$EXTERNALSYM _DPNMSG_GROUP_INFO}
  1315.   DPNMSG_GROUP_INFO = _DPNMSG_GROUP_INFO;
  1316.   {$EXTERNALSYM DPNMSG_GROUP_INFO}
  1317.   TDPNMsgGroupInfo = _DPNMSG_GROUP_INFO;
  1318.  
  1319.   //
  1320.   // Migrate host structure for message handler
  1321.   // (DPN_MSGID_HOST_MIGRATE)
  1322.   //
  1323.   PDPNMsgHostMigrate = ^TDPNMsgHostMigrate;
  1324.   _DPNMSG_HOST_MIGRATE = packed record
  1325.     dwSize: DWORD;             // Size of this structure
  1326.     dpnidNewHost: TDPNID;      // DPNID of new Host player
  1327.     pvPlayerContext: Pointer;  // Player context value
  1328.   end;
  1329.   {$EXTERNALSYM _DPNMSG_HOST_MIGRATE}
  1330.   DPNMSG_HOST_MIGRATE = _DPNMSG_HOST_MIGRATE;
  1331.   {$EXTERNALSYM DPNMSG_HOST_MIGRATE}
  1332.   TDPNMsgHostMigrate = _DPNMSG_HOST_MIGRATE;
  1333.  
  1334.   //
  1335.   // Indicate connect structure for message handler
  1336.   // (DPN_MSGID_INDICATE_CONNECT)
  1337.   //
  1338.   PDPNMsgIndicateConnect = ^TDPNMsgIndicateConnect;
  1339.   _DPNMSG_INDICATE_CONNECT = packed record
  1340.     dwSize: DWORD;                        // Size of this structure
  1341.     pvUserConnectData: Pointer;           // Connecting player data
  1342.     dwUserConnectDataSize: DWORD;         // Size (in bytes) of pvUserConnectData
  1343.     pvReplyData: Pointer;                 // Connection reply data
  1344.     dwReplyDataSize: DWORD;               // Size (in bytes) of pvReplyData
  1345.     pvReplyContext: Pointer;              // Buffer context for pvReplyData
  1346.     pvPlayerContext: Pointer;             // Player context preset
  1347.     pAddressPlayer: IDirectPlay8Address;  // Address of connecting player
  1348.     pAddressDevice: IDirectPlay8Address;  // Address of device receiving connect attempt
  1349.   end;
  1350.   {$EXTERNALSYM _DPNMSG_INDICATE_CONNECT}
  1351.   DPNMSG_INDICATE_CONNECT = _DPNMSG_INDICATE_CONNECT;
  1352.   {$EXTERNALSYM DPNMSG_INDICATE_CONNECT}
  1353.   TDPNMsgIndicateConnect = _DPNMSG_INDICATE_CONNECT;
  1354.  
  1355.   //
  1356.   // Indicated connect aborted structure for message handler
  1357.   // (DPN_MSGID_INDICATED_CONNECT_ABORTED)
  1358.   //
  1359.   PDPNMsgIndicatedConnectAborted = ^TDPNMsgIndicatedConnectAborted;
  1360.   _DPNMSG_INDICATED_CONNECT_ABORTED = packed record
  1361.     dwSize: DWORD;            // Size of this structure
  1362.     pvPlayerContext: Pointer; // Player context preset from DPNMSG_INDICATE_CONNECT
  1363.   end;
  1364.   {$EXTERNALSYM _DPNMSG_INDICATED_CONNECT_ABORTED}
  1365.   DPNMSG_INDICATED_CONNECT_ABORTED = _DPNMSG_INDICATED_CONNECT_ABORTED;
  1366.   {$EXTERNALSYM DPNMSG_INDICATED_CONNECT_ABORTED}
  1367.   TDPNMsgIndicatedConnectAborted = _DPNMSG_INDICATED_CONNECT_ABORTED;
  1368.  
  1369.   //
  1370.   // Peer info structure for message handler
  1371.   // (DPN_MSGID_PEER_INFO)
  1372.   //
  1373.   PDPNMsgPeerInfo = ^TDPNMsgPeerInfo;
  1374.   _DPNMSG_PEER_INFO = packed record
  1375.     dwSize: DWORD;              // Size of this structure
  1376.     dpnidPeer: TDPNID;          // DPNID of peer
  1377.     pvPlayerContext: Pointer;   // Player context value
  1378.   end;
  1379.   {$EXTERNALSYM _DPNMSG_PEER_INFO}
  1380.   DPNMSG_PEER_INFO = _DPNMSG_PEER_INFO;
  1381.   {$EXTERNALSYM DPNMSG_PEER_INFO}
  1382.   TDPNMsgPeerInfo = _DPNMSG_PEER_INFO;
  1383.  
  1384.   //
  1385.   // Receive structure for message handler
  1386.   // (DPN_MSGID_RECEIVE)
  1387.   //
  1388.   PDPNMsgReceive = ^TDPNMsgReceive;
  1389.   _DPNMSG_RECEIVE = packed record
  1390.     dwSize: DWORD;             // Size of this structure
  1391.     dpnidSender: TDPNID;       // DPNID of sending player
  1392.     pvPlayerContext: Pointer;  // Player context value of sending player
  1393.     pReceiveData: PByte;       // Received data
  1394.     dwReceiveDataSize: DWORD;  // Size (in bytes) of pReceiveData
  1395.     hBufferHandle: TDPNHandle; // Buffer handle for pReceiveData
  1396.  
  1397.     // Fields added for DirectX 9
  1398.     dwReceiveFlags: DWORD;     // Flags describing how message was received
  1399.   end;
  1400.   {$EXTERNALSYM _DPNMSG_RECEIVE}
  1401.   DPNMSG_RECEIVE = _DPNMSG_RECEIVE;
  1402.   {$EXTERNALSYM DPNMSG_RECEIVE}
  1403.   TDPNMsgReceive = _DPNMSG_RECEIVE;
  1404.  
  1405.   //
  1406.   // Remove player from group structure for message handler
  1407.   // (DPN_MSGID_REMOVE_PLAYER_FROM_GROUP)
  1408.   //
  1409.   PDPNMsgRemovePlayerFromGroup = ^TDPNMsgRemovePlayerFromGroup;
  1410.   _DPNMSG_REMOVE_PLAYER_FROM_GROUP = packed record
  1411.     dwSize: DWORD;               // Size of this structure
  1412.     dpnidGroup: TDPNID;          // DPNID of group
  1413.     pvGroupContext: Pointer;     // Group context value
  1414.     dpnidPlayer: TDPNID;         // DPNID of deleted player
  1415.     pvPlayerContext: Pointer;    // Player context value
  1416.   end;
  1417.   {$EXTERNALSYM _DPNMSG_REMOVE_PLAYER_FROM_GROUP}
  1418.   DPNMSG_REMOVE_PLAYER_FROM_GROUP = _DPNMSG_REMOVE_PLAYER_FROM_GROUP;
  1419.   {$EXTERNALSYM DPNMSG_REMOVE_PLAYER_FROM_GROUP}
  1420.   TDPNMsgRemovePlayerFromGroup = _DPNMSG_REMOVE_PLAYER_FROM_GROUP;
  1421.  
  1422.   //
  1423.   // Returned buffer structure for message handler
  1424.   // (DPN_MSGID_RETURN_BUFFER)
  1425.   //
  1426.   PDPNMsgReturnBuffer = ^TDPNMsgReturnBuffer;
  1427.   _DPNMSG_RETURN_BUFFER = packed record
  1428.     dwSize: DWORD;          // Size of this structure
  1429.     hResultCode: HRESULT;   // Return value of operation
  1430.     pvBuffer: Pointer;      // Buffer being returned
  1431.     pvUserContext: Pointer; // Context associated with buffer
  1432.   end;
  1433.   {$EXTERNALSYM _DPNMSG_RETURN_BUFFER}
  1434.   DPNMSG_RETURN_BUFFER = _DPNMSG_RETURN_BUFFER;
  1435.   {$EXTERNALSYM DPNMSG_RETURN_BUFFER}
  1436.   TDPNMsgReturnBuffer = _DPNMSG_RETURN_BUFFER;
  1437.  
  1438.   //
  1439.   // Send complete structure for message handler
  1440.   // (DPN_MSGID_SEND_COMPLETE)
  1441.   //
  1442.   PDPNMsgSendComplete = ^TDPNMsgSendComplete;
  1443.   _DPNMSG_SEND_COMPLETE = packed record
  1444.     dwSize: DWORD;          // Size of this structure
  1445.     hAsyncOp: TDPNHandle;   // DirectPlay8 Async operation handle
  1446.     pvUserContext: Pointer; // User context supplied at Send/SendTo
  1447.     hResultCode: HRESULT;   // HRESULT of send
  1448.     dwSendTime: DWORD;      // Send time in ms
  1449.  
  1450.     // Fields added for DirectX 9
  1451.     dwFirstFrameRTT: DWORD;        // RTT of the first frame in the message
  1452.     dwFirstFrameRetryCount: DWORD;    // Retry count of the first frame
  1453.     dwSendCompleteFlags: DWORD;    // Flags describing how message was sent
  1454.     pBuffers: PDPNBufferDesc;                // Pointer to array of buffers sent, if DirectPlay did not make a copy
  1455.     dwNumBuffers: DWORD;            // Number of buffers in previous array
  1456.   end;
  1457.   {$EXTERNALSYM _DPNMSG_SEND_COMPLETE}
  1458.   DPNMSG_SEND_COMPLETE = _DPNMSG_SEND_COMPLETE;
  1459.   {$EXTERNALSYM DPNMSG_SEND_COMPLETE}
  1460.   TDPNMsgSendComplete = _DPNMSG_SEND_COMPLETE;
  1461.  
  1462.   //
  1463.   // Server info structure for message handler
  1464.   // (DPN_MSGID_SERVER_INFO)
  1465.   //
  1466.   PDPNMsgServerInfo = ^TDPNMsgServerInfo;
  1467.   _DPNMSG_SERVER_INFO = packed record
  1468.     dwSize: DWORD;              // Size of this structure
  1469.     dpnidServer: TDPNID;        // DPNID of server
  1470.     pvPlayerContext: Pointer;   // Player context value
  1471.   end;
  1472.   {$EXTERNALSYM _DPNMSG_SERVER_INFO}
  1473.   DPNMSG_SERVER_INFO = _DPNMSG_SERVER_INFO;
  1474.   {$EXTERNALSYM DPNMSG_SERVER_INFO}
  1475.   TDPNMsgServerInfo = _DPNMSG_SERVER_INFO;
  1476.  
  1477.   //
  1478.   // Terminated session structure for message handler
  1479.   // (DPN_MSGID_TERMINATE_SESSION)
  1480.   //
  1481.   PDPNMsgTerminateSession = ^TDPNMsgTerminateSession;
  1482.   _DPNMSG_TERMINATE_SESSION = packed record
  1483.     dwSize: DWORD;              // Size of this structure
  1484.     hResultCode: HRESULT;       // Reason
  1485.     pvTerminateData: Pointer;   // Data passed from Host/Server
  1486.     dwTerminateDataSize: DWORD; // Size (in bytes) of pvTerminateData
  1487.   end;
  1488.   {$EXTERNALSYM _DPNMSG_TERMINATE_SESSION}
  1489.   DPNMSG_TERMINATE_SESSION = _DPNMSG_TERMINATE_SESSION;
  1490.   {$EXTERNALSYM DPNMSG_TERMINATE_SESSION}
  1491.   TDPNMsgTerminateSession = _DPNMSG_TERMINATE_SESSION;
  1492.  
  1493.   //
  1494.   // Message structures added for DirectX 9
  1495.   //
  1496.  
  1497.   //
  1498.   // Create thread info structure for message handler
  1499.   // (DPN_MSGID_CREATE_THREAD)
  1500.   //
  1501.   PDPNMsgCreateThread = ^TDPNMsgCreateThread;
  1502.   _DPNMSG_CREATE_THREAD = packed record
  1503.     dwSize: DWORD;                // Size of this structure
  1504.     dwFlags: DWORD;            // Flags describing this thread
  1505.     dwProcessorNum: DWORD;        // Index of processor to which thread is bound
  1506.     pvUserContext: Pointer;        // Thread context value
  1507.   end;
  1508.   {$EXTERNALSYM _DPNMSG_CREATE_THREAD}
  1509.   DPNMSG_CREATE_THREAD = _DPNMSG_CREATE_THREAD;
  1510.   {$EXTERNALSYM DPNMSG_CREATE_THREAD}
  1511.   TDPNMsgCreateThread = _DPNMSG_CREATE_THREAD;
  1512.  
  1513.   //
  1514.   // Destroy thread info structure for message handler
  1515.   // (DPN_MSGID_DESTROY_THREAD)
  1516.   //
  1517.   PDPNMsgDestroyThread = ^TDPNMsgDestroyThread;
  1518.   _DPNMSG_DESTROY_THREAD = packed record
  1519.     dwSize:    DWORD;                // Size of this structure
  1520.     dwProcessorNum:    DWORD;        // Index of processor to which thread was bound
  1521.     pvUserContext:    Pointer;        // Thread context value
  1522.   end;
  1523.   {$EXTERNALSYM _DPNMSG_DESTROY_THREAD}
  1524.   DPNMSG_DESTROY_THREAD = _DPNMSG_DESTROY_THREAD;
  1525.   {$EXTERNALSYM DPNMSG_DESTROY_THREAD}
  1526.   TDPNMsgDestroyThread = _DPNMSG_DESTROY_THREAD;
  1527.  
  1528.  
  1529.   //
  1530.   // Query-to-resolve-NAT-address structure for message handler
  1531.   // (DPN_MSGID_NAT_RESOLVER_QUERY)
  1532.   //
  1533.   PDPNMsgNatResolverQuery = ^TDPNMsgNatResolverQuery;
  1534.   _DPNMSG_NAT_RESOLVER_QUERY = packed record
  1535.     dwSize: DWORD;                // Size of this structure.
  1536.     pAddressSender: IDirectPlay8Address;    // Address of client that sent the query
  1537.     pAddressDevice: IDirectPlay8Address;    // Address of device on which query was received
  1538.     pwszUserString: PWideChar;    // User specified string, or NULL if none
  1539.   end;
  1540.   {$EXTERNALSYM _DPNMSG_NAT_RESOLVER_QUERY}
  1541.   DPNMSG_NAT_RESOLVER_QUERY = _DPNMSG_NAT_RESOLVER_QUERY;
  1542.   {$EXTERNALSYM DPNMSG_NAT_RESOLVER_QUERY}
  1543.   TDPNMsgNatResolverQuery = _DPNMSG_NAT_RESOLVER_QUERY;
  1544.  
  1545.  
  1546. (****************************************************************************
  1547.  *
  1548.  * DirectPlay8 Functions
  1549.  *
  1550.  ****************************************************************************)
  1551.  
  1552. (*
  1553.  * This function is no longer supported.  It is recommended that CoCreateInstance be used to create
  1554.  * DirectPlay8 objects.
  1555.  *
  1556.  * extern HRESULT WINAPI DirectPlay8Create( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown);
  1557.  *
  1558.  *)
  1559.  
  1560.  
  1561. (****************************************************************************
  1562.  *
  1563.  * DirectPlay8Lobby Interface Pointer
  1564.  *
  1565.  ****************************************************************************)
  1566.  
  1567.   IDirectPlay8LobbiedApplication = interface;
  1568.  
  1569. (****************************************************************************
  1570.  *
  1571.  * DirectPlay8 Application Interfaces
  1572.  *
  1573.  ****************************************************************************)
  1574.  
  1575.   //
  1576.   // COM definition for DirectPlay8 Client interface
  1577.   //
  1578.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8Client);'}
  1579.   {$EXTERNALSYM IDirectPlay8Client}
  1580.   IDirectPlay8Client = interface(IUnknown)
  1581.     ['{5102dacd-241b-11d3-aea7-006097b01411}']
  1582.     (*** IDirectPlay8Client methods ***)
  1583.     function Initialize(pvUserContext: Pointer; pfn: TFNDPNMessageHandler; dwFlags: DWORD): HResult; stdcall;
  1584.     function EnumServiceProviders(pguidServiceProvider, pguidApplication: PGUID;
  1585.       pSPInfoBuffer: PDPNServiceProviderInfo; out pcbEnumData, pcReturned: DWORD;
  1586.       dwFlags: DWORD): HResult; stdcall;
  1587.     function EnumHosts(const pApplicationDesc: TDPNApplicationDesc;
  1588.       pAddrHost, pDeviceInfo: IDirectPlay8Address; pUserEnumData: Pointer;
  1589.       dwUserEnumDataSize, dwEnumCount, dwRetryInterval, dwTimeOut: DWORD;
  1590.       pvUserContext: Pointer; pAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1591.     function CancelAsyncOperation(hAsyncHandle: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1592.     function Connect(const pdnAppDesc: TDPNApplicationDesc;
  1593.       pHostAddr: IDirectPlay8Address; pDeviceInfo: IDirectPlay8Address;
  1594.       pdnSecurity: PDPNSecurityDesc; pdnCredentials: PDPNSecurityCredentials;
  1595.       pvUserConnectData: Pointer; dwUserConnectDataSize: DWORD; pvAsyncContext: Pointer;
  1596.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1597.     function Send(const prgBufferDesc: TDPNBufferDesc; cBufferDesc, dwTimeOut: DWORD;
  1598.       pvAsyncContext: Pointer; phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1599.     function GetSendQueueInfo(pdwNumMsgs, pdwNumBytes: PDWORD; dwFlags: DWORD): HResult; stdcall;
  1600.     function GetApplicationDesc(pAppDescBuffer: PDPNApplicationDesc; var pcbDataSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  1601.     function SetClientInfo(const pdpnPlayerInfo: TDPNPlayerInfo; pvAsyncContext: Pointer;
  1602.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1603.     function GetServerInfo(pdpnPlayerInfo: PDPNPlayerInfo; var pdwSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  1604.     function GetServerAddress(out pAddress: IDirectPlay8Address; dwFlags: DWORD): HResult; stdcall;
  1605.     function Close(dwFlags: DWORD): HResult; stdcall;
  1606.     function ReturnBuffer(hBufferHandle: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1607.     function GetCaps(pdpCaps: PDPNCaps; dwFlags: DWORD): HResult; stdcall; //Translator: pdpCaps can be either PDPNCaps or PDPNCapsEx
  1608.     function SetCaps(pdpCaps: PDPNCaps; dwFlags: DWORD): HResult; stdcall; //Translator: pdpCaps can be either PDPNCaps or PDPNCapsEx
  1609.     function SetSPCaps(const pguidSP: TGUID; const pdpspCaps: TDPNSpCaps; dwFlags: DWORD): HResult; stdcall;
  1610.     function GetSPCaps(const pguidSP: TGUID; var pdpspCaps: TDPNSpCaps; dwFlags: DWORD): HResult; stdcall;
  1611.     function GetConnectionInfo(var pdpConnectionInfo: TDPNConnectionInfo; dwFlags: DWORD): HResult; stdcall;
  1612.     function RegisterLobby(dpnHandle: TDPNHandle; pIDP8LobbiedApplication: IDirectPlay8LobbiedApplication; dwFlags: DWORD): HResult; stdcall;
  1613.   end;
  1614.  
  1615.   //
  1616.   // COM definition for DirectPlay8 Server interface
  1617.   //
  1618.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8Server);'}
  1619.   {$EXTERNALSYM IDirectPlay8Server}
  1620.   IDirectPlay8Server = interface(IUnknown)
  1621.     ['{5102dace-241b-11d3-aea7-006097b01411}']
  1622.     (*** IDirectPlay8Server methods ***)
  1623.     function Initialize(pvUserContext: Pointer; pfn: TFNDPNMessageHandler; dwFlags: DWORD): HResult; stdcall;
  1624.     function EnumServiceProviders(pguidServiceProvider, pguidApplication: PGUID;
  1625.       pSPInfoBuffer: PDPNServiceProviderInfo; out pcbEnumData, pcReturned: DWORD;
  1626.       dwFlags: DWORD): HResult; stdcall;
  1627.     function CancelAsyncOperation(hAsyncHandle: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1628.     function GetSendQueueInfo(dpnid: TDPNID; pdwNumMsgs, pdwNumBytes: PDWORD; dwFlags: DWORD): HResult; stdcall;
  1629.     function GetApplicationDesc(pAppDescBuffer: PDPNApplicationDesc; var pcbDataSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  1630.     function GetServerInfo(pdpnPlayerInfo: PDPNPlayerInfo; pvAsyncContext: Pointer; phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1631.     function GetClientInfo(dpnid: TDPNID; pdpnPlayerInfo: PDPNPlayerInfo; pdwSize: PDWORD; dwFlags: DWORD): HResult; stdcall;
  1632.     function GetClientAddress(dpnid: TDPNID; out pAddress: IDirectPlay8Address; dwFlags: DWORD): HResult; stdcall;
  1633.     function GetLocalHostAddresses(out prgpAddress: IDirectPlay8Address; var pcAddress: DWORD; dwFlags: DWORD): HResult; stdcall;
  1634.     function SetApplicationDesc(const pad: TDPNApplicationDesc; dwFlags: DWORD): HResult; stdcall;
  1635.     function Host(const pdnAppDesc: TDPNApplicationDesc; prgpDeviceInfo: PIDirectPlay8Address;
  1636.       cDeviceInfo: DWORD; pdnSecurity: PDPNSecurityDesc; pdnCredentials: PDPNSecurityCredentials;
  1637.       pvPlayerContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  1638.     function SendTo(dpnid: TDPNID; const prgBufferDesc: TDPNBufferDesc; cBufferDesc, dwTimeOut: DWORD;
  1639.       pvAsyncContext: Pointer; phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1640.     function CreateGroup(const pdpnGroupInfo: TDPNGroupInfo; pvGroupContext, pvAsyncContext: Pointer;
  1641.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1642.     function DestroyGroup(idGroup: TDPNID; pvAsyncContext: Pointer;
  1643.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1644.     function AddPlayerToGroup(idGroup, idClient: TDPNID; pvAsyncContext: Pointer;
  1645.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1646.     function RemovePlayerFromGroup(idGroup, idClient: TDPNID; pvAsyncContext: Pointer;
  1647.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1648.     function SetGroupInfo(dpnid: TDPNID; const pdpnGroupInfo: TDPNGroupInfo; pvAsyncContext: Pointer; phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1649.     function GetGroupInfo(dpnid: TDPNID; pdpnGroupInfo: PDPNGroupInfo; pdwSize: PDWORD; dwFlags: DWORD): HResult; stdcall; //todo: Changed
  1650.     function EnumPlayersAndGroups(prgdpnid: PDPNID; var pcdpnid: DWORD; dwFlags: DWORD): HResult; stdcall;
  1651.     function EnumGroupMembers(dpnid: TDPNID; prgdpnid: PDPNID; var pcdpnid: DWORD; dwFlags: DWORD): HResult; stdcall;
  1652.     function Close(dwFlags: DWORD): HResult; stdcall;
  1653.     function DestroyClient(dpnidClient: TDPNID; pvDestroyData: Pointer; dwDestroyDataSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  1654.     function ReturnBuffer(hBufferHandle: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1655.     function GetPlayerContext(dpnid: TDPNID; out ppvPlayerContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  1656.     function GetGroupContext(dpnid: TDPNID; out ppvGroupContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  1657.     function GetCaps(pdpCaps: PDPNCaps; dwFlags: DWORD): HResult; stdcall; //Translator: pdpCaps can be either PDPNCaps or PDPNCapsEx
  1658.     function SetCaps(pdpCaps: PDPNCaps; dwFlags: DWORD): HResult; stdcall; //Translator: pdpCaps can be either PDPNCaps or PDPNCapsEx
  1659.     function SetSPCaps(const pguidSP: TGUID; const pdpspCaps: TDPNSpCaps; dwFlags: DWORD): HResult; stdcall;
  1660.     function GetSPCaps(const pguidSP: TGUID; var pdpspCaps: TDPNSpCaps; dwFlags: DWORD): HResult; stdcall;
  1661.     function GetConnectionInfo(dpnid: TDPNID; var pdpConnectionInfo: TDPNConnectionInfo; dwFlags: DWORD): HResult; stdcall;
  1662.     function RegisterLobby(dpnHandle: TDPNHandle; pIDP8LobbiedApplication: IDirectPlay8LobbiedApplication; dwFlags: DWORD): HResult; stdcall;
  1663.   end;
  1664.  
  1665.   //
  1666.   // COM definition for DirectPlay8 Peer interface
  1667.   //
  1668.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8Peer);'}
  1669.   {$EXTERNALSYM IDirectPlay8Peer}
  1670.   IDirectPlay8Peer = interface(IUnknown)
  1671.     ['{5102dacf-241b-11d3-aea7-006097b01411}']
  1672.     (*** IDirectPlay8Peer methods ***)
  1673.     function Initialize(pvUserContext: Pointer; pfn: TFNDPNMessageHandler; dwFlags: DWORD): HResult; stdcall;
  1674.     function EnumServiceProviders(pguidServiceProvider, pguidApplication: PGUID;
  1675.       pSPInfoBuffer: PDPNServiceProviderInfo; out pcbEnumData, pcReturned: DWORD;
  1676.       dwFlags: DWORD): HResult; stdcall;
  1677.     function CancelAsyncOperation(hAsyncHandle: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1678.     function Connect(const pdnAppDesc: TDPNApplicationDesc;
  1679.       pHostAddr: IDirectPlay8Address; pDeviceInfo: IDirectPlay8Address;
  1680.       pdnSecurity: PDPNSecurityDesc; pdnCredentials: PDPNSecurityCredentials;
  1681.       pvUserConnectData: Pointer; dwUserConnectDataSize: DWORD;
  1682.       pvPlayerContext, pvAsyncContext: Pointer;
  1683.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1684.     function SendTo(dpnid: TDPNID; const prgBufferDesc: TDPNBufferDesc; cBufferDesc, dwTimeOut: DWORD;
  1685.       pvAsyncContext: Pointer; phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1686.     function GetSendQueueInfo(dpnid: TDPNID; pdwNumMsgs, pdwNumBytes: PDWORD; dwFlags: DWORD): HResult; stdcall;
  1687.     function Host(const pdnAppDesc: TDPNApplicationDesc; prgpDeviceInfo: PIDirectPlay8Address;
  1688.       cDeviceInfo: DWORD; pdnSecurity: PDPNSecurityDesc; pdnCredentials: PDPNSecurityCredentials;
  1689.       pvPlayerContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  1690.     function GetApplicationDesc(pAppDescBuffer: PDPNApplicationDesc; var pcbDataSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  1691.     function SetApplicationDesc(const pad: TDPNApplicationDesc; dwFlags: DWORD): HResult; stdcall;
  1692.     function CreateGroup(const pdpnGroupInfo: TDPNGroupInfo; pvGroupContext, pvAsyncContext: Pointer;
  1693.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1694.     function DestroyGroup(idGroup: TDPNID; pvAsyncContext: Pointer;
  1695.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1696.     function AddPlayerToGroup(idGroup, idClient: TDPNID; pvAsyncContext: Pointer;
  1697.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1698.     function RemovePlayerFromGroup(idGroup, idClient: TDPNID; pvAsyncContext: Pointer;
  1699.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1700.     function SetGroupInfo(dpnid: TDPNID; const pdpnGroupInfo: TDPNGroupInfo; pvAsyncContext: Pointer; phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1701.     function GetGroupInfo(dpnid: TDPNID; pdpnGroupInfo: PDPNGroupInfo; pdwSize: PDWORD; dwFlags: DWORD): HResult; stdcall; //todo: Changed
  1702.     function EnumPlayersAndGroups(prgdpnid: PDPNID; var pcdpnid: DWORD; dwFlags: DWORD): HResult; stdcall;
  1703.     function EnumGroupMembers(dpnid: TDPNID; prgdpnid: PDPNID; var pcdpnid: DWORD; dwFlags: DWORD): HResult; stdcall;
  1704.     function SetPeerInfo(const pdpnPlayerInfo: TDPNPlayerInfo; pvAsyncContext: Pointer;
  1705.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1706.     function GetPeerInfo(dpnid: TDPNID; var pdpnPlayerInfo: TDPNPlayerInfo; pdwSize: PDWORD; dwFlags: DWORD): HResult; stdcall; //todo: Changed
  1707.     function GetPeerAddress(dpnid: TDPNID; out pAddress: IDirectPlay8Address; dwFlags: DWORD): HResult; stdcall;
  1708.     function GetLocalHostAddresses(prgpAddress: PIDirectPlay8Address; var pcAddress: DWORD; dwFlags: DWORD): HResult; stdcall;
  1709.     function Close(dwFlags: DWORD): HResult; stdcall;
  1710.     function EnumHosts(const pApplicationDesc: TDPNApplicationDesc;
  1711.       pAddrHost, pDeviceInfo: IDirectPlay8Address; pUserEnumData: Pointer;
  1712.       dwUserEnumDataSize, dwEnumCount, dwRetryInterval, dwTimeOut: DWORD;
  1713.       pvUserContext: Pointer; pAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1714.     function DestroyPeer(dpnidClient: TDPNID; pvDestroyData: Pointer; dwDestroyDataSize, dwFlags: DWORD): HResult; stdcall;
  1715.     function ReturnBuffer(hBufferHandle: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1716.     function GetPlayerContext(dpnid: TDPNID; out ppvPlayerContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  1717.     function GetGroupContext(dpnid: TDPNID; out ppvGroupContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  1718.     function GetCaps(pdpCaps: PDPNCaps; dwFlags: DWORD): HResult; stdcall; //Translator: pdpCaps can be either PDPNCaps or PDPNCapsEx
  1719.     function SetCaps(pdpCaps: PDPNCaps; dwFlags: DWORD): HResult; stdcall; //Translator: pdpCaps can be either PDPNCaps or PDPNCapsEx
  1720.     function SetSPCaps(const pguidSP: TGUID; const pdpspCaps: TDPNSpCaps; dwFlags: DWORD): HResult; stdcall;
  1721.     function GetSPCaps(const pguidSP: TGUID; var pdpspCaps: TDPNSpCaps; dwFlags: DWORD): HResult; stdcall;
  1722.     function GetConnectionInfo(dpnid: TDPNID; var pdpConnectionInfo: TDPNConnectionInfo; dwFlags: DWORD): HResult; stdcall;
  1723.     function RegisterLobby(dpnHandle: TDPNHandle; pIDP8LobbiedApplication: IDirectPlay8LobbiedApplication; dwFlags: DWORD): HResult; stdcall; 
  1724.     function TerminateSession(pvTerminateData: Pointer; dwTerminateDataSize, dwFlags: DWORD): HResult; stdcall;
  1725.   end;
  1726.  
  1727.  
  1728.   //
  1729.   // COM definition for DirectPlay8 Thread Pool interface
  1730.   //
  1731.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8ThreadPool);'}
  1732.   {$EXTERNALSYM IDirectPlay8ThreadPool}
  1733.   IDirectPlay8ThreadPool = interface(IUnknown)
  1734.     ['{0d22ee73-4a46-4a0d-89b2-045b4d666425}']
  1735.     (*** IDirectPlay8ThreadPool methods ***)
  1736.     function Initialize(pvUserContext: Pointer; pfn: TFNDPNMessageHandler; dwFlags: DWORD): HResult; stdcall;
  1737.     function Close(dwFlags: DWORD): HResult; stdcall;
  1738.     function GetThreadCount(dwProcessorNum: DWORD; out pdwNumThreads: DWORD; dwFlags: DWORD): HResult; stdcall;
  1739.     function SetThreadCount(dwProcessorNum: DWORD; dwNumThreads: DWORD; dwFlags: DWORD): HResult; stdcall;
  1740.     function DoWork(dwAllowedTimeSlice: DWORD; dwFlags: DWORD): HResult; stdcall;
  1741.   end;
  1742.  
  1743.  
  1744.   //
  1745.   // COM definition for DirectPlay8 NAT Resolver interface
  1746.   //
  1747.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8NATResolver);'}
  1748.   {$EXTERNALSYM IDirectPlay8NATResolver}
  1749.   IDirectPlay8NATResolver = interface(IUnknown)
  1750.     ['{a9e213f2-9a60-486f-bf3b-53408b6d1cbb}']
  1751.     (*** IDirectPlay8NATResolver methods ***)
  1752.     function Initialize(pvUserContext: Pointer; pfn: TFNDPNMessageHandler; dwFlags: DWORD): HResult; stdcall;
  1753.     function Start(ppDevices: PIDirectPlay8Address; dwNumDevices: DWORD; dwFlags: DWORD): HResult; stdcall;
  1754.     function Close(dwFlags: DWORD): HResult; stdcall;
  1755.     function EnumDevices(pSPInfoBuffer: PDPNServiceProviderInfo; var pdwBufferSize: DWORD; out pdwNumDevices: DWORD; dwFlags: DWORD): HResult; stdcall;
  1756.     function GetAddresses(ppAddresses: PIDirectPlay8Address; out pdwNumAddresses: DWORD; dwFlags: DWORD): HResult; stdcall;
  1757.   end;
  1758.  
  1759.  
  1760. (****************************************************************************
  1761.  *
  1762.  * DirectPlay8 Interface IIDs
  1763.  *
  1764.  ****************************************************************************)
  1765.  
  1766.   // {5102DACD-241B-11d3-AEA7-006097B01411}
  1767.   IID_IDirectPlay8Client = IDirectPlay8Client;
  1768.   {$EXTERNALSYM IID_IDirectPlay8Client}
  1769.  
  1770.   // {5102DACE-241B-11d3-AEA7-006097B01411}
  1771.   IID_IDirectPlay8Server = IDirectPlay8Server;
  1772.   {$EXTERNALSYM IID_IDirectPlay8Server}
  1773.  
  1774.   // {5102DACF-241B-11d3-AEA7-006097B01411}
  1775.   IID_IDirectPlay8Peer = IDirectPlay8Peer;
  1776.   {$EXTERNALSYM IID_IDirectPlay8Peer}
  1777.  
  1778.  
  1779.   // IIDs added for DirectX 9
  1780.  
  1781.   // {0D22EE73-4A46-4a0d-89B2-045B4D666425}
  1782.   IID_IDirectPlay8ThreadPool = IDirectPlay8ThreadPool;
  1783.   {$EXTERNALSYM IID_IDirectPlay8ThreadPool}
  1784.  
  1785.   // {A9E213F2-9A60-486f-BF3B-53408B6D1CBB}
  1786.   IID_IDirectPlay8NATResolver = IDirectPlay8NATResolver;
  1787.   {$EXTERNALSYM IID_IDirectPlay8NATResolver}
  1788.  
  1789.  
  1790.  
  1791. (*==========================================================================
  1792.  *
  1793.  *  Copyright (C) 2000 Microsoft Corporation.  All Rights Reserved.
  1794.  *
  1795.  *  File:       DPLobby.h
  1796.  *  Content:    DirectPlay8 Lobby Include File
  1797.  *
  1798.  ***************************************************************************)
  1799.  
  1800.  
  1801. (****************************************************************************
  1802.  *
  1803.  * DirectPlay8Lobby Structures (Non-Message)
  1804.  *
  1805.  ****************************************************************************)
  1806.  
  1807.   //
  1808.   // Information on a registered game
  1809.   //
  1810.   PDPLApplicationInfo = ^TDPLApplicationInfo;
  1811.   _DPL_APPLICATION_INFO = packed record
  1812.     guidApplication: TGUID;            // GUID of the application
  1813.     pwszApplicationName: PWideChar;    // Name of the application
  1814.     dwNumRunning: DWORD;               // # of instances of this application running
  1815.     dwNumWaiting: DWORD;               // # of instances of this application waiting
  1816.     dwFlags: DWORD;                    // Flags
  1817.   end;
  1818.   {$EXTERNALSYM _DPL_APPLICATION_INFO}
  1819.   DPL_APPLICATION_INFO = _DPL_APPLICATION_INFO;
  1820.   {$EXTERNALSYM DPL_APPLICATION_INFO}
  1821.   TDPLApplicationInfo = _DPL_APPLICATION_INFO;
  1822.  
  1823.   //
  1824.   // Settings to be used for connecting / hosting a game session
  1825.   //
  1826.   PDPLConnectionSettings = ^TDPLConnectionSettings;
  1827.   _DPL_CONNECTION_SETTINGS = packed record
  1828.     dwSize: DWORD;                    // Size of this structure
  1829.     dwFlags: DWORD;                // Connection settings flags (DPLCONNECTSETTINGS_...)
  1830.     dpnAppDesc: TDPNApplicationDesc;             // Application desc for the associated DirectPlay session
  1831.     pdp8HostAddress: IDirectPlay8Address;       // Address of host to connect to
  1832.     ppdp8DeviceAddresses: IDirectPlay8Address; // Address of device to connect from / host on
  1833.     cNumDeviceAddresses: DWORD;    // # of addresses specified in ppdp8DeviceAddresses
  1834.     pwszPlayerName: PWideChar;         // Name to give the player
  1835.   end;
  1836.   {$EXTERNALSYM _DPL_CONNECTION_SETTINGS}
  1837.   DPL_CONNECTION_SETTINGS = _DPL_CONNECTION_SETTINGS;
  1838.   {$EXTERNALSYM DPL_CONNECTION_SETTINGS}
  1839.   TDPLConnectionSettings = _DPL_CONNECTION_SETTINGS;
  1840.  
  1841.   //
  1842.   // Information for performing a lobby connect
  1843.   // (ConnectApplication)
  1844.   //
  1845.   PDPLConnectInfo = ^TDPLConnectInfo;
  1846.   _DPL_CONNECT_INFO = packed record
  1847.     dwSize: DWORD;                                  // Size of this structure
  1848.     dwFlags: DWORD;                                 // Flags (DPLCONNECT_...)
  1849.     guidApplication: TGUID;                         // GUID of application to launch
  1850.     pdplConnectionSettings: PDPLConnectionSettings; // Settings application should use
  1851.     pvLobbyConnectData: Pointer;                    // User defined data block
  1852.     dwLobbyConnectDataSize: DWORD;                  // Size of user defined data block
  1853.   end;
  1854.   {$EXTERNALSYM _DPL_CONNECT_INFO}
  1855.   DPL_CONNECT_INFO = _DPL_CONNECT_INFO;
  1856.   {$EXTERNALSYM DPL_CONNECT_INFO}
  1857.   TDPLConnectInfo = _DPL_CONNECT_INFO;
  1858.  
  1859.   //
  1860.   // Information for registering an application
  1861.   // (RegisterApplication)
  1862.   //
  1863.   PDPLProgramDesc = ^TDPLProgramDesc;
  1864.   _DPL_PROGRAM_DESC = packed record
  1865.     dwSize: DWORD;
  1866.     dwFlags: DWORD;
  1867.     guidApplication: TGUID;               // Application GUID
  1868.     pwszApplicationName: PWideChar;       // Unicode application name
  1869.     pwszCommandLine: PWideChar;           // Unicode command line arguments
  1870.     pwszCurrentDirectory: PWideChar;      // Unicode current directory
  1871.     pwszDescription: PWideChar;           // Unicode application description
  1872.     pwszExecutableFilename: PWideChar;    // Unicode filename of application executable
  1873.     pwszExecutablePath: PWideChar;        // Unicode path of application executable
  1874.     pwszLauncherFilename: PWideChar;      // Unicode filename of launcher executable
  1875.     pwszLauncherPath: PWideChar;          // Unicode path of launcher executable
  1876.   end;
  1877.   {$EXTERNALSYM _DPL_PROGRAM_DESC}
  1878.   DPL_PROGRAM_DESC = _DPL_PROGRAM_DESC;
  1879.   {$EXTERNALSYM DPL_PROGRAM_DESC}
  1880.   TDPLProgramDesc = _DPL_PROGRAM_DESC;
  1881.  
  1882. (****************************************************************************
  1883.  *
  1884.  * DirectPlay8 Lobby Message Structures
  1885.  *
  1886.  ****************************************************************************)
  1887.  
  1888.   //
  1889.   // A connection was established
  1890.   // (DPL_MSGID_CONNECT)
  1891.   //
  1892.   PDPLMessageConnect = ^TDPLMessageConnect;
  1893.   _DPL_MESSAGE_CONNECT = packed record
  1894.     dwSize: DWORD;                 // Size of this structure
  1895.     hConnectId: TDPNHandle;        // Handle of new connection
  1896.     pdplConnectionSettings: PDPLConnectionSettings; // Connection settings for this connection
  1897.     pvLobbyConnectData: Pointer;   // User defined lobby data block
  1898.     dwLobbyConnectDataSize: DWORD; // Size of user defined lobby data block
  1899.     pvConnectionContext: Pointer;  // Context value for this connection (user set)
  1900.   end;
  1901.   {$EXTERNALSYM _DPL_MESSAGE_CONNECT}
  1902.   DPL_MESSAGE_CONNECT = _DPL_MESSAGE_CONNECT;
  1903.   {$EXTERNALSYM DPL_MESSAGE_CONNECT}
  1904.   TDPLMessageConnect = _DPL_MESSAGE_CONNECT;
  1905.  
  1906.   //
  1907.   // Connection settings have been updated
  1908.   // (DPL_MSGID_CONNECTION_SETTINGS)
  1909.   //
  1910.   PDPLMessageConnectionSettings = ^TDPLMessageConnectionSettings;
  1911.   _DPL_MESSAGE_CONNECTION_SETTINGS = packed record
  1912.     dwSize: DWORD;                // Size of this structure
  1913.     hSender: TDPNHandle;          // Handle of the connection for these settings
  1914.     pdplConnectionSettings: PDPLConnectionSettings;     // Connection settings
  1915.     pvConnectionContext: Pointer; // Context value for this connection
  1916.   end;
  1917.   {$EXTERNALSYM _DPL_MESSAGE_CONNECTION_SETTINGS}
  1918.   DPL_MESSAGE_CONNECTION_SETTINGS = _DPL_MESSAGE_CONNECTION_SETTINGS;
  1919.   {$EXTERNALSYM DPL_MESSAGE_CONNECTION_SETTINGS}
  1920.   TDPLMessageConnectionSettings = _DPL_MESSAGE_CONNECTION_SETTINGS;
  1921.  
  1922.   //
  1923.   // A connection has been disconnected
  1924.   // (DPL_MSGID_DISCONNECT)
  1925.   //
  1926.   PDPLMessageDisconnect = ^TDPLMessageDisconnect;
  1927.   _DPL_MESSAGE_DISCONNECT = packed record
  1928.     dwSize: DWORD;                // Size of this structure
  1929.     hDisconnectId: TDPNHandle;    // Handle of the connection that was terminated
  1930.     hrReason: HRESULT;            // Reason the connection was broken
  1931.     pvConnectionContext: Pointer; // Context value for this connection
  1932.   end;
  1933.   {$EXTERNALSYM _DPL_MESSAGE_DISCONNECT}
  1934.   DPL_MESSAGE_DISCONNECT = _DPL_MESSAGE_DISCONNECT;
  1935.   {$EXTERNALSYM DPL_MESSAGE_DISCONNECT}
  1936.   TDPLMessageDisconnect = _DPL_MESSAGE_DISCONNECT;
  1937.  
  1938.   //
  1939.   // Data was received through a connection
  1940.   // (DPL_MSGID_RECEIVE)
  1941.   //
  1942.   PDPLMessageReceive = ^TDPLMessageReceive;
  1943.   _DPL_MESSAGE_RECEIVE = packed record
  1944.     dwSize: DWORD;                  // Size of this structure
  1945.     hSender: TDPNHandle;            // Handle of the connection that is from
  1946.     pBuffer: PByte;                 // Contents of the message
  1947.     dwBufferSize: DWORD;            // Size of the message context
  1948.     pvConnectionContext: Pointer;   // Context value for this connection
  1949.   end;
  1950.   {$EXTERNALSYM _DPL_MESSAGE_RECEIVE}
  1951.   DPL_MESSAGE_RECEIVE = _DPL_MESSAGE_RECEIVE;
  1952.   {$EXTERNALSYM DPL_MESSAGE_RECEIVE}
  1953.   TDPLMessageReceive = _DPL_MESSAGE_RECEIVE;
  1954.  
  1955.   //
  1956.   // Current status of the associated connection
  1957.   // (DPL_MSGID_SESSION_STATUS)
  1958.   //
  1959.   PDPLMessageSessionStatus = ^TDPLMessageSessionStatus;
  1960.   _DPL_MESSAGE_SESSION_STATUS = packed record
  1961.     dwSize: DWORD;                // Size of this structure
  1962.     hSender: TDPNHandle;          // Handle of the connection that this is from
  1963.     dwStatus: DWORD;              // Status (DPLSESSION_...)
  1964.     pvConnectionContext: Pointer; // Context value for this connection
  1965.   end;
  1966.   {$EXTERNALSYM _DPL_MESSAGE_SESSION_STATUS}
  1967.   DPL_MESSAGE_SESSION_STATUS = _DPL_MESSAGE_SESSION_STATUS;
  1968.   {$EXTERNALSYM DPL_MESSAGE_SESSION_STATUS}
  1969.   TDPLMessageSessionStatus = _DPL_MESSAGE_SESSION_STATUS;
  1970.  
  1971. (****************************************************************************
  1972.  *
  1973.  * DirectPlay8Lobby Create
  1974.  *
  1975.  ****************************************************************************)
  1976.  
  1977. (*
  1978.  * This function is no longer supported.  It is recommended that CoCreateInstance be used to create
  1979.  * DirectPlay8 lobby objects.
  1980.  *
  1981.  * extern HRESULT WINAPI DirectPlay8LobbyCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown);
  1982.  *
  1983.  *)
  1984.  
  1985. (****************************************************************************
  1986.  *
  1987.  * DirectPlay8 Functions
  1988.  *
  1989.  ****************************************************************************)
  1990.  
  1991.   //
  1992.   // COM definition for DirectPlayLobbyClient
  1993.   //
  1994.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8LobbyClient);'}
  1995.   {$EXTERNALSYM IDirectPlay8LobbyClient}
  1996.   IDirectPlay8LobbyClient = interface(IUnknown)
  1997.     ['{819074a2-016c-11d3-ae14-006097b01411}']
  1998.     // IDirectPlayLobbyClient methods
  1999.     function Initialize(pvUserContext: Pointer; pfn: TFNDPNMessageHandler; dwFlags: DWORD): HResult; stdcall;
  2000.     function EnumLocalPrograms(pGuidApplication: PGUID; pEnumData: PByte; var pdwEnumData: DWORD; out pdwItems: DWORD; dwFlags: DWORD): HResult; stdcall;
  2001.     function ConnectApplication(const pdplConnectionInfo: PDPLConnectInfo;
  2002.       pvConnectionContext: Pointer; hApplication: PDPNHandle; dwTimeOut, dwFlags: DWORD): HResult; stdcall;
  2003.     function Send(hConnection: TDPNHandle; pBuffer: PByte; pBufferSize, dwFlags: DWORD): HResult; stdcall;
  2004.     function ReleaseApplication(hConnection: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
  2005.     function Close(dwFlags: DWORD): HResult; stdcall;
  2006.     function GetConnectionSettings(hConnection: TDPNHandle; pdplSessionInfo: PDPLConnectionSettings; var pdwInfoSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  2007.     function SetConnectionSettings(hConnection: TDPNHandle; const pdplSessionInfo: TDPLConnectionSettings; dwFlags: DWORD): HResult; stdcall;
  2008.   end;
  2009.  
  2010.  
  2011.   //
  2012.   // COM definition for DirectPlayLobbiedApplication
  2013.   //
  2014.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8LobbiedApplication);'}
  2015.   {$EXTERNALSYM IDirectPlay8LobbiedApplication}
  2016.   IDirectPlay8LobbiedApplication = interface(IUnknown)
  2017.     ['{819074a3-016c-11d3-ae14-006097b01411}']
  2018.     // IDirectPlayLobbiedApplication methods
  2019.     function Initialize(pvUserContext: Pointer; pfn: TFNDPNMessageHandler; pdpnhConnection: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  2020.     function RegisterProgram(const pdplProgramDesc: TDPLProgramDesc; dwFlags: DWORD): HResult; stdcall;
  2021.     function UnRegisterProgram(const pguidApplication: TGUID; dwFlags: DWORD): HResult; stdcall;
  2022.     function Send(hConnection: TDPNHandle; pBuffer: PByte; pBufferSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  2023.     function SetAppAvailable(fAvailable: BOOL;  dwFlags: DWORD): HResult; stdcall;
  2024.     function UpdateStatus(hConnection: TDPNHandle; dwStatus, dwFlags: DWORD): HResult; stdcall;
  2025.     function Close(dwFlags: DWORD): HResult; stdcall;
  2026.     function GetConnectionSettings(hConnection: TDPNHandle; pdplSessionInfo: PDPLConnectionSettings; var pdwInfoSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  2027.     function SetConnectionSettings(hConnection: TDPNHandle; const pdplSessionInfo: TDPLConnectionSettings; dwFlags: DWORD): HResult; stdcall;
  2028.   end;
  2029.  
  2030.  
  2031. const
  2032. (****************************************************************************
  2033.  *
  2034.  * DirectPlay8Lobby CLSIDs
  2035.  *
  2036.  ****************************************************************************)
  2037.  
  2038.   // {667955AD-6B3B-43ca-B949-BC69B5BAFF7F}
  2039.   CLSID_DirectPlay8LobbiedApplication: TGUID = '{667955ad-6b3b-43ca-b949-bc69b5baff7f}';
  2040.   {$EXTERNALSYM CLSID_DirectPlay8LobbiedApplication}
  2041.  
  2042.   // {3B2B6775-70B6-45af-8DEA-A209C69559F3}
  2043.   CLSID_DirectPlay8LobbyClient: TGUID = '{3b2b6775-70b6-45af-8dea-a209c69559f3}';
  2044.   {$EXTERNALSYM CLSID_DirectPlay8LobbyClient}
  2045.  
  2046. (****************************************************************************
  2047.  *
  2048.  * DirectPlay8Lobby Interface IIDs
  2049.  *
  2050.  ****************************************************************************)
  2051.  
  2052.   // {819074A3-016C-11d3-AE14-006097B01411}
  2053.   IID_IDirectPlay8LobbiedApplication = IDirectPlay8LobbiedApplication;
  2054.   {$EXTERNALSYM IID_IDirectPlay8LobbiedApplication}
  2055.  
  2056.   // {819074A2-016C-11d3-AE14-006097B01411}
  2057.   IID_IDirectPlay8LobbyClient = IDirectPlay8LobbyClient;
  2058.   {$EXTERNALSYM IID_IDirectPlay8LobbyClient}
  2059.  
  2060. (****************************************************************************
  2061.  *
  2062.  * DirectPlay8 Lobby Message IDs
  2063.  *
  2064.  ****************************************************************************)
  2065.  
  2066.   DPL_MSGID_LOBBY                     = $8000;
  2067.   {$EXTERNALSYM DPL_MSGID_LOBBY}
  2068.   DPL_MSGID_RECEIVE                   = ($0001 or DPL_MSGID_LOBBY);
  2069.   {$EXTERNALSYM DPL_MSGID_RECEIVE}
  2070.   DPL_MSGID_CONNECT                   = ($0002 or DPL_MSGID_LOBBY);
  2071.   {$EXTERNALSYM DPL_MSGID_CONNECT}
  2072.   DPL_MSGID_DISCONNECT                = ($0003 or DPL_MSGID_LOBBY);
  2073.   {$EXTERNALSYM DPL_MSGID_DISCONNECT}
  2074.   DPL_MSGID_SESSION_STATUS            = ($0004 or DPL_MSGID_LOBBY);
  2075.   {$EXTERNALSYM DPL_MSGID_SESSION_STATUS}
  2076.   DPL_MSGID_CONNECTION_SETTINGS       = ($0005 or DPL_MSGID_LOBBY);
  2077.   {$EXTERNALSYM DPL_MSGID_CONNECTION_SETTINGS}
  2078.  
  2079. (****************************************************************************
  2080.  *
  2081.  * DirectPlay8Lobby Constants
  2082.  *
  2083.  ****************************************************************************)
  2084.  
  2085.   //
  2086.   // Specifies that operation should be performed on all open connections
  2087.   //
  2088.   DPLHANDLE_ALLCONNECTIONS     = $FFFFFFFF;
  2089.   {$EXTERNALSYM DPLHANDLE_ALLCONNECTIONS}
  2090.  
  2091.   //
  2092.   // The associated game session has suceeded in connecting / hosting
  2093.   //
  2094.   DPLSESSION_CONNECTED         = $0001;
  2095.   {$EXTERNALSYM DPLSESSION_CONNECTED}
  2096.  
  2097.   // The associated game session failed connecting / hosting
  2098.   //
  2099.   DPLSESSION_COULDNOTCONNECT   = $0002;
  2100.   {$EXTERNALSYM DPLSESSION_COULDNOTCONNECT}
  2101.  
  2102.   //
  2103.   // The associated game session has disconnected
  2104.   //
  2105.   DPLSESSION_DISCONNECTED      = $0003;
  2106.   {$EXTERNALSYM DPLSESSION_DISCONNECTED}
  2107.  
  2108.   //
  2109.   // The associated game session has terminated
  2110.   //
  2111.   DPLSESSION_TERMINATED        = $0004;
  2112.   {$EXTERNALSYM DPLSESSION_TERMINATED}
  2113.  
  2114.   //
  2115.   // The associated game session's host has migrated
  2116.   //
  2117.   DPLSESSION_HOSTMIGRATED      = $0005;
  2118.   {$EXTERNALSYM DPLSESSION_HOSTMIGRATED}
  2119.  
  2120.   //
  2121.   // The associated game session's host has migrated to the local client
  2122.   //
  2123.   DPLSESSION_HOSTMIGRATEDHERE  = $0006;
  2124.   {$EXTERNALSYM DPLSESSION_HOSTMIGRATEDHERE}
  2125.  
  2126.  
  2127. (****************************************************************************
  2128.  *
  2129.  * DirectPlay8 Lobby Flags
  2130.  *
  2131.  ****************************************************************************)
  2132.  
  2133.   //
  2134.   // Do not automatically make the lobby app unavailable when a connection is established
  2135.   //
  2136.   DPLAVAILABLE_ALLOWMULTIPLECONNECT   = $0001;
  2137.   {$EXTERNALSYM DPLAVAILABLE_ALLOWMULTIPLECONNECT}
  2138.  
  2139.   //
  2140.   // Launch a new instance of the application to connect to
  2141.   //
  2142.   DPLCONNECT_LAUNCHNEW                = $0001;
  2143.   {$EXTERNALSYM DPLCONNECT_LAUNCHNEW}
  2144.  
  2145.   //
  2146.   // Launch a new instance of the application if one is not waiting
  2147.   //
  2148.   DPLCONNECT_LAUNCHNOTFOUND           = $0002;
  2149.   {$EXTERNALSYM DPLCONNECT_LAUNCHNOTFOUND}
  2150.  
  2151.   //
  2152.   // When starting the associated game session, start it as a host
  2153.   //
  2154.   DPLCONNECTSETTINGS_HOST             = $0001;
  2155.   {$EXTERNALSYM DPLCONNECTSETTINGS_HOST}
  2156.  
  2157.   //
  2158.   // Disable parameter validation
  2159.   //
  2160.   DPLINITIALIZE_DISABLEPARAMVAL       = $0001;
  2161.   {$EXTERNALSYM DPLINITIALIZE_DISABLEPARAMVAL}
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167. ///// Part 2 of dplay8.h /////
  2168. (*==========================================================================;
  2169.  *
  2170.  *  Copyright (C) 1998-2000 Microsoft Corporation.  All Rights Reserved.
  2171.  *
  2172.  *  File:        DPlay8.h
  2173.  *  Content:    DirectPlay8 include file
  2174.  *
  2175.  ***************************************************************************)
  2176.  
  2177. (****************************************************************************
  2178.  *
  2179.  * DIRECTPLAY8 ERRORS
  2180.  *
  2181.  * Errors are represented by negative values and cannot be combined.
  2182.  *
  2183.  ****************************************************************************)
  2184.  
  2185. const
  2186.   _DPN_FACILITY_CODE = $015;
  2187.   {$EXTERNALSYM _DPN_FACILITY_CODE}
  2188.   _DPNHRESULT_BASE   = $8000;
  2189.   {$EXTERNALSYM _DPNHRESULT_BASE}
  2190.  
  2191.   MAKE_DPNHRESULT_R  = (1 shl 31) or (_DPN_FACILITY_CODE shl 16) + _DPNHRESULT_BASE;
  2192.  
  2193. // #define MAKE_DPNHRESULT( code )  MAKE_HRESULT( 1, _DPN_FACILITY_CODE, ( code + _DPNHRESULT_BASE ) )
  2194. function MAKE_DPNHRESULT(Code: DWORD): DWORD;
  2195. {$EXTERNALSYM MAKE_DPNHRESULT}
  2196.  
  2197. const
  2198.   DPN_OK                    = S_OK;
  2199.   {$EXTERNALSYM DPN_OK}
  2200.  
  2201.   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 ) )
  2202.   {$EXTERNALSYM DPNSUCCESS_EQUAL}
  2203.   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
  2204.   {$EXTERNALSYM DPNSUCCESS_NOPLAYERSINGROUP}
  2205.   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 ) )
  2206.   {$EXTERNALSYM DPNSUCCESS_NOTEQUAL}
  2207.   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 ) )
  2208.   {$EXTERNALSYM DPNSUCCESS_PENDING}
  2209.  
  2210.   DPNERR_ABORTED                 = HRESULT(MAKE_DPNHRESULT_R + $30); // MAKE_DPNHRESULT( 0x30 )
  2211.   {$EXTERNALSYM DPNERR_ABORTED}
  2212.   DPNERR_ADDRESSING              = HRESULT(MAKE_DPNHRESULT_R + $40); // MAKE_DPNHRESULT( 0x40 )
  2213.   {$EXTERNALSYM DPNERR_ADDRESSING}
  2214.   DPNERR_ALREADYCLOSING          = HRESULT(MAKE_DPNHRESULT_R + $50); // MAKE_DPNHRESULT( 0x50 )
  2215.   {$EXTERNALSYM DPNERR_ALREADYCLOSING}
  2216.   DPNERR_ALREADYCONNECTED        = HRESULT(MAKE_DPNHRESULT_R + $60); // MAKE_DPNHRESULT( 0x60 )
  2217.   {$EXTERNALSYM DPNERR_ALREADYCONNECTED}
  2218.   DPNERR_ALREADYDISCONNECTING    = HRESULT(MAKE_DPNHRESULT_R + $70); // MAKE_DPNHRESULT( 0x70 )
  2219.   {$EXTERNALSYM DPNERR_ALREADYDISCONNECTING}
  2220.   DPNERR_ALREADYINITIALIZED      = HRESULT(MAKE_DPNHRESULT_R + $80); // MAKE_DPNHRESULT(  0x80 )
  2221.   {$EXTERNALSYM DPNERR_ALREADYINITIALIZED}
  2222.   DPNERR_ALREADYREGISTERED       = HRESULT(MAKE_DPNHRESULT_R + $90); // MAKE_DPNHRESULT(  0x90 )
  2223.   {$EXTERNALSYM DPNERR_ALREADYREGISTERED}
  2224.   DPNERR_BUFFERTOOSMALL          = HRESULT(MAKE_DPNHRESULT_R + $100); // MAKE_DPNHRESULT( 0x100 )
  2225.   {$EXTERNALSYM DPNERR_BUFFERTOOSMALL}
  2226.   DPNERR_CANNOTCANCEL            = HRESULT(MAKE_DPNHRESULT_R + $110); // MAKE_DPNHRESULT( 0x110 )
  2227.   {$EXTERNALSYM DPNERR_CANNOTCANCEL}
  2228.   DPNERR_CANTCREATEGROUP         = HRESULT(MAKE_DPNHRESULT_R + $120); // MAKE_DPNHRESULT( 0x120 )
  2229.   {$EXTERNALSYM DPNERR_CANTCREATEGROUP}
  2230.   DPNERR_CANTCREATEPLAYER        = HRESULT(MAKE_DPNHRESULT_R + $130); // MAKE_DPNHRESULT( 0x130 )
  2231.   {$EXTERNALSYM DPNERR_CANTCREATEPLAYER}
  2232.   DPNERR_CANTLAUNCHAPPLICATION   = HRESULT(MAKE_DPNHRESULT_R + $140); // MAKE_DPNHRESULT( 0x140 )
  2233.   {$EXTERNALSYM DPNERR_CANTLAUNCHAPPLICATION}
  2234.   DPNERR_CONNECTING              = HRESULT(MAKE_DPNHRESULT_R + $150); // MAKE_DPNHRESULT( 0x150 )
  2235.   {$EXTERNALSYM DPNERR_CONNECTING}
  2236.   DPNERR_CONNECTIONLOST          = HRESULT(MAKE_DPNHRESULT_R + $160); // MAKE_DPNHRESULT( 0x160 )
  2237.   {$EXTERNALSYM DPNERR_CONNECTIONLOST}
  2238.   DPNERR_CONVERSION              = HRESULT(MAKE_DPNHRESULT_R + $170); // MAKE_DPNHRESULT( 0x170 )
  2239.   {$EXTERNALSYM DPNERR_CONVERSION}
  2240.   DPNERR_DATATOOLARGE            = HRESULT(MAKE_DPNHRESULT_R + $175); // MAKE_DPNHRESULT( 0x175 )
  2241.   {$EXTERNALSYM DPNERR_DATATOOLARGE}
  2242.   DPNERR_DOESNOTEXIST            = HRESULT(MAKE_DPNHRESULT_R + $180); // MAKE_DPNHRESULT( 0x180 )
  2243.   {$EXTERNALSYM DPNERR_DOESNOTEXIST}
  2244.   DPNERR_DPNSVRNOTAVAILABLE      = HRESULT(MAKE_DPNHRESULT_R + $185); // MAKE_DPNHRESULT( 0x185 )
  2245.   {$EXTERNALSYM DPNERR_DPNSVRNOTAVAILABLE}
  2246.   DPNERR_DUPLICATECOMMAND        = HRESULT(MAKE_DPNHRESULT_R + $190); // MAKE_DPNHRESULT( 0x190 )
  2247.   {$EXTERNALSYM DPNERR_DUPLICATECOMMAND}
  2248.   DPNERR_ENDPOINTNOTRECEIVING    = HRESULT(MAKE_DPNHRESULT_R + $200); // MAKE_DPNHRESULT( 0x200 )
  2249.   {$EXTERNALSYM DPNERR_ENDPOINTNOTRECEIVING}
  2250.   DPNERR_ENUMQUERYTOOLARGE       = HRESULT(MAKE_DPNHRESULT_R + $210); // MAKE_DPNHRESULT( 0x210 )
  2251.   {$EXTERNALSYM DPNERR_ENUMQUERYTOOLARGE}
  2252.   DPNERR_ENUMRESPONSETOOLARGE    = HRESULT(MAKE_DPNHRESULT_R + $220); // MAKE_DPNHRESULT( 0x220 )
  2253.   {$EXTERNALSYM DPNERR_ENUMRESPONSETOOLARGE}
  2254.   DPNERR_EXCEPTION               = HRESULT(MAKE_DPNHRESULT_R + $230); // MAKE_DPNHRESULT( 0x230 )
  2255.   {$EXTERNALSYM DPNERR_EXCEPTION}
  2256.   DPNERR_GENERIC                 = E_FAIL;
  2257.   {$EXTERNALSYM DPNERR_GENERIC}
  2258.   DPNERR_GROUPNOTEMPTY           = HRESULT(MAKE_DPNHRESULT_R + $240); // MAKE_DPNHRESULT( 0x240 )
  2259.   {$EXTERNALSYM DPNERR_GROUPNOTEMPTY}
  2260.   DPNERR_HOSTING                 = HRESULT(MAKE_DPNHRESULT_R + $250); // MAKE_DPNHRESULT( 0x250 )
  2261.   {$EXTERNALSYM DPNERR_HOSTING}
  2262.   DPNERR_HOSTREJECTEDCONNECTION  = HRESULT(MAKE_DPNHRESULT_R + $260); // MAKE_DPNHRESULT( 0x260 )
  2263.   {$EXTERNALSYM DPNERR_HOSTREJECTEDCONNECTION}
  2264.   DPNERR_HOSTTERMINATEDSESSION   = HRESULT(MAKE_DPNHRESULT_R + $270); // MAKE_DPNHRESULT( 0x270 )
  2265.   {$EXTERNALSYM DPNERR_HOSTTERMINATEDSESSION}
  2266.   DPNERR_INCOMPLETEADDRESS       = HRESULT(MAKE_DPNHRESULT_R + $280); // MAKE_DPNHRESULT( 0x280 )
  2267.   {$EXTERNALSYM DPNERR_INCOMPLETEADDRESS}
  2268.   DPNERR_INVALIDADDRESSFORMAT    = HRESULT(MAKE_DPNHRESULT_R + $290); // MAKE_DPNHRESULT( 0x290 )
  2269.   {$EXTERNALSYM DPNERR_INVALIDADDRESSFORMAT}
  2270.   DPNERR_INVALIDAPPLICATION      = HRESULT(MAKE_DPNHRESULT_R + $300); // MAKE_DPNHRESULT( 0x300 )
  2271.   {$EXTERNALSYM DPNERR_INVALIDAPPLICATION}
  2272.   DPNERR_INVALIDCOMMAND          = HRESULT(MAKE_DPNHRESULT_R + $310); // MAKE_DPNHRESULT( 0x310 )
  2273.   {$EXTERNALSYM DPNERR_INVALIDCOMMAND}
  2274.   DPNERR_INVALIDDEVICEADDRESS    = HRESULT(MAKE_DPNHRESULT_R + $320); // MAKE_DPNHRESULT( 0x320 )
  2275.   {$EXTERNALSYM DPNERR_INVALIDDEVICEADDRESS}
  2276.   DPNERR_INVALIDENDPOINT         = HRESULT(MAKE_DPNHRESULT_R + $330); // MAKE_DPNHRESULT( 0x330 )
  2277.   {$EXTERNALSYM DPNERR_INVALIDENDPOINT}
  2278.   DPNERR_INVALIDFLAGS            = HRESULT(MAKE_DPNHRESULT_R + $340); // MAKE_DPNHRESULT( 0x340 )
  2279.   {$EXTERNALSYM DPNERR_INVALIDFLAGS}
  2280.   DPNERR_INVALIDGROUP            = HRESULT(MAKE_DPNHRESULT_R + $350); // MAKE_DPNHRESULT( 0x350 )
  2281.   {$EXTERNALSYM DPNERR_INVALIDGROUP}
  2282.   DPNERR_INVALIDHANDLE           = HRESULT(MAKE_DPNHRESULT_R + $360); // MAKE_DPNHRESULT( 0x360 )
  2283.   {$EXTERNALSYM DPNERR_INVALIDHANDLE}
  2284.   DPNERR_INVALIDHOSTADDRESS      = HRESULT(MAKE_DPNHRESULT_R + $370); // MAKE_DPNHRESULT( 0x370 )
  2285.   {$EXTERNALSYM DPNERR_INVALIDHOSTADDRESS}
  2286.   DPNERR_INVALIDINSTANCE         = HRESULT(MAKE_DPNHRESULT_R + $380); // MAKE_DPNHRESULT( 0x380 )
  2287.   {$EXTERNALSYM DPNERR_INVALIDINSTANCE}
  2288.   DPNERR_INVALIDINTERFACE        = HRESULT(MAKE_DPNHRESULT_R + $390); // MAKE_DPNHRESULT( 0x390 )
  2289.   {$EXTERNALSYM DPNERR_INVALIDINTERFACE}
  2290.   DPNERR_INVALIDOBJECT           = HRESULT(MAKE_DPNHRESULT_R + $400); // MAKE_DPNHRESULT( 0x400 )
  2291.   {$EXTERNALSYM DPNERR_INVALIDOBJECT}
  2292.   DPNERR_INVALIDPARAM            = E_INVALIDARG;
  2293.   {$EXTERNALSYM DPNERR_INVALIDPARAM}
  2294.   DPNERR_INVALIDPASSWORD         = HRESULT(MAKE_DPNHRESULT_R + $410); // MAKE_DPNHRESULT( 0x410 )
  2295.   {$EXTERNALSYM DPNERR_INVALIDPASSWORD}
  2296.   DPNERR_INVALIDPLAYER           = HRESULT(MAKE_DPNHRESULT_R + $420); // MAKE_DPNHRESULT( 0x420 )
  2297.   {$EXTERNALSYM DPNERR_INVALIDPLAYER}
  2298.   DPNERR_INVALIDPOINTER          = E_POINTER;
  2299.   {$EXTERNALSYM DPNERR_INVALIDPOINTER}
  2300.   DPNERR_INVALIDPRIORITY         = HRESULT(MAKE_DPNHRESULT_R + $430); // MAKE_DPNHRESULT( 0x430 )
  2301.   {$EXTERNALSYM DPNERR_INVALIDPRIORITY}
  2302.   DPNERR_INVALIDSTRING           = HRESULT(MAKE_DPNHRESULT_R + $440); // MAKE_DPNHRESULT( 0x440 )
  2303.   {$EXTERNALSYM DPNERR_INVALIDSTRING}
  2304.   DPNERR_INVALIDURL              = HRESULT(MAKE_DPNHRESULT_R + $450); // MAKE_DPNHRESULT( 0x450 )
  2305.   {$EXTERNALSYM DPNERR_INVALIDURL}
  2306.   DPNERR_INVALIDVERSION          = HRESULT(MAKE_DPNHRESULT_R + $460); // MAKE_DPNHRESULT( 0x460 )
  2307.   {$EXTERNALSYM DPNERR_INVALIDVERSION}
  2308.   DPNERR_NOCAPS                  = HRESULT(MAKE_DPNHRESULT_R + $470); // MAKE_DPNHRESULT( 0x470 )
  2309.   {$EXTERNALSYM DPNERR_NOCAPS}
  2310.   DPNERR_NOCONNECTION            = HRESULT(MAKE_DPNHRESULT_R + $480); // MAKE_DPNHRESULT( 0x480 )
  2311.   {$EXTERNALSYM DPNERR_NOCONNECTION}
  2312.   DPNERR_NOHOSTPLAYER            = HRESULT(MAKE_DPNHRESULT_R + $490); // MAKE_DPNHRESULT( 0x490 )
  2313.   {$EXTERNALSYM DPNERR_NOHOSTPLAYER}
  2314.   DPNERR_NOINTERFACE             = E_NOINTERFACE;
  2315.   {$EXTERNALSYM DPNERR_NOINTERFACE}
  2316.   DPNERR_NOMOREADDRESSCOMPONENTS = HRESULT(MAKE_DPNHRESULT_R + $500); // MAKE_DPNHRESULT( 0x500 )
  2317.   {$EXTERNALSYM DPNERR_NOMOREADDRESSCOMPONENTS}
  2318.   DPNERR_NORESPONSE              = HRESULT(MAKE_DPNHRESULT_R + $510); // MAKE_DPNHRESULT( 0x510 )
  2319.   {$EXTERNALSYM DPNERR_NORESPONSE}
  2320.   DPNERR_NOTALLOWED              = HRESULT(MAKE_DPNHRESULT_R + $520); // MAKE_DPNHRESULT( 0x520 )
  2321.   {$EXTERNALSYM DPNERR_NOTALLOWED}
  2322.   DPNERR_NOTHOST                 = HRESULT(MAKE_DPNHRESULT_R + $530); // MAKE_DPNHRESULT( 0x530 )
  2323.   {$EXTERNALSYM DPNERR_NOTHOST}
  2324.   DPNERR_NOTREADY                = HRESULT(MAKE_DPNHRESULT_R + $540); // MAKE_DPNHRESULT( 0x540 )
  2325.   {$EXTERNALSYM DPNERR_NOTREADY}
  2326.   DPNERR_NOTREGISTERED           = HRESULT(MAKE_DPNHRESULT_R + $550); // MAKE_DPNHRESULT( 0x550 )
  2327.   {$EXTERNALSYM DPNERR_NOTREGISTERED}
  2328.   DPNERR_OUTOFMEMORY             = E_OUTOFMEMORY;
  2329.   {$EXTERNALSYM DPNERR_OUTOFMEMORY}
  2330.   DPNERR_PENDING                 = DPNSUCCESS_PENDING;
  2331.   {$EXTERNALSYM DPNERR_PENDING}
  2332.   DPNERR_PLAYERALREADYINGROUP    = HRESULT(MAKE_DPNHRESULT_R + $560); // MAKE_DPNHRESULT( 0x560 )
  2333.   {$EXTERNALSYM DPNERR_PLAYERALREADYINGROUP}
  2334.   DPNERR_PLAYERLOST              = HRESULT(MAKE_DPNHRESULT_R + $570); // MAKE_DPNHRESULT( 0x570 )
  2335.   {$EXTERNALSYM DPNERR_PLAYERLOST}
  2336.   DPNERR_PLAYERNOTINGROUP        = HRESULT(MAKE_DPNHRESULT_R + $580); // MAKE_DPNHRESULT( 0x580 )
  2337.   {$EXTERNALSYM DPNERR_PLAYERNOTINGROUP}
  2338.   DPNERR_PLAYERNOTREACHABLE      = HRESULT(MAKE_DPNHRESULT_R + $590); // MAKE_DPNHRESULT( 0x590 )
  2339.   {$EXTERNALSYM DPNERR_PLAYERNOTREACHABLE}
  2340.   DPNERR_SENDTOOLARGE            = HRESULT(MAKE_DPNHRESULT_R + $600); // MAKE_DPNHRESULT( 0x600 )
  2341.   {$EXTERNALSYM DPNERR_SENDTOOLARGE}
  2342.   DPNERR_SESSIONFULL             = HRESULT(MAKE_DPNHRESULT_R + $610); // MAKE_DPNHRESULT( 0x610 )
  2343.   {$EXTERNALSYM DPNERR_SESSIONFULL}
  2344.   DPNERR_TABLEFULL               = HRESULT(MAKE_DPNHRESULT_R + $620); // MAKE_DPNHRESULT( 0x620 )
  2345.   {$EXTERNALSYM DPNERR_TABLEFULL}
  2346.   DPNERR_TIMEDOUT                = HRESULT(MAKE_DPNHRESULT_R + $630); // MAKE_DPNHRESULT( 0x630 )
  2347.   {$EXTERNALSYM DPNERR_TIMEDOUT}
  2348.   DPNERR_UNINITIALIZED           = HRESULT(MAKE_DPNHRESULT_R + $640); // MAKE_DPNHRESULT( 0x640 )
  2349.   {$EXTERNALSYM DPNERR_UNINITIALIZED}
  2350.   DPNERR_UNSUPPORTED             = E_NOTIMPL;
  2351.   {$EXTERNALSYM DPNERR_UNSUPPORTED}
  2352.   DPNERR_USERCANCEL              = HRESULT(MAKE_DPNHRESULT_R + $650); // MAKE_DPNHRESULT( 0x650 )
  2353.   {$EXTERNALSYM DPNERR_USERCANCEL}
  2354.  
  2355.  
  2356.  
  2357.  
  2358. (*==========================================================================;
  2359.  *
  2360.  *  Copyright (C) 1999 Microsoft Corporation.  All Rights Reserved.
  2361.  *
  2362.  *  File:       dpvoice.h
  2363.  *  Content:    DirectPlayVoice include file
  2364.  ***************************************************************************)
  2365.  
  2366.  
  2367. const
  2368. (****************************************************************************
  2369.  *
  2370.  * DirectPlayVoice CLSIDs
  2371.  *
  2372.  ****************************************************************************)
  2373.  
  2374.  
  2375.   // {B9F3EB85-B781-4ac1-8D90-93A05EE37D7D}
  2376.   CLSID_DirectPlayVoiceClient: TGUID = '{b9f3eb85-b781-4ac1-8d90-93a05ee37d7d}';
  2377.   {$EXTERNALSYM CLSID_DirectPlayVoiceClient}
  2378.  
  2379.   // {D3F5B8E6-9B78-4a4c-94EA-CA2397B663D3}
  2380.   CLSID_DirectPlayVoiceServer: TGUID = '{d3f5b8e6-9b78-4a4c-94ea-ca2397b663d3}';
  2381.   {$EXTERNALSYM CLSID_DirectPlayVoiceServer}
  2382.  
  2383.   // {0F0F094B-B01C-4091-A14D-DD0CD807711A}
  2384.   CLSID_DirectPlayVoiceTest: TGUID = '{0f0f094b-b01c-4091-a14d-dd0cd807711a}';
  2385.   {$EXTERNALSYM CLSID_DirectPlayVoiceTest}
  2386.  
  2387. (****************************************************************************
  2388.  *
  2389.  * DirectPlayVoice Compression Type GUIDs
  2390.  *
  2391.  ****************************************************************************)
  2392.  
  2393.   // MS-ADPCM 32.8 kbit/s
  2394.   //
  2395.   // {699B52C1-A885-46a8-A308-97172419ADC7}
  2396.   DPVCTGUID_ADPCM: TGUID = '{699b52c1-a885-46a8-a308-97172419adc7}';
  2397.   {$EXTERNALSYM DPVCTGUID_ADPCM}
  2398.  
  2399.   // Microsoft GSM 6.10 13 kbit/s
  2400.   //
  2401.   // {24768C60-5A0D-11d3-9BE4-525400D985E7}
  2402.   DPVCTGUID_GSM: TGUID = '{24768c60-5a0d-11d3-9be4-525400d985e7}';
  2403.   {$EXTERNALSYM DPVCTGUID_GSM}
  2404.  
  2405.   // MS-PCM 64 kbit/s
  2406.   //
  2407.   // {8DE12FD4-7CB3-48ce-A7E8-9C47A22E8AC5}
  2408.   DPVCTGUID_NONE: TGUID = '{8de12fd4-7cb3-48ce-a7e8-9c47a22e8ac5}';
  2409.   {$EXTERNALSYM DPVCTGUID_NONE}
  2410.  
  2411.   // Voxware SC03 3.2kbit/s
  2412.   //
  2413.   // {7D82A29B-2242-4f82-8F39-5D1153DF3E41}
  2414.   DPVCTGUID_SC03: TGUID = '{7d82a29b-2242-4f82-8f39-5d1153df3e41}';
  2415.   {$EXTERNALSYM DPVCTGUID_SC03}
  2416.  
  2417.   // Voxware SC06 6.4kbit/s
  2418.   //
  2419.   // {53DEF900-7168-4633-B47F-D143916A13C7}
  2420.   DPVCTGUID_SC06: TGUID = '{53def900-7168-4633-b47f-d143916a13c7}';
  2421.   {$EXTERNALSYM DPVCTGUID_SC06}
  2422.  
  2423.   // TrueSpeech(TM) 8.6 kbit/s
  2424.   //
  2425.   // {D7954361-5A0B-11d3-9BE4-525400D985E7}
  2426.   DPVCTGUID_TRUESPEECH: TGUID = '{d7954361-5a0b-11d3-9be4-525400d985e7}';
  2427.   {$EXTERNALSYM DPVCTGUID_TRUESPEECH}
  2428.  
  2429.   // Voxware VR12 1.4kbit/s
  2430.   //
  2431.   // {FE44A9FE-8ED4-48bf-9D66-1B1ADFF9FF6D}
  2432.   DPVCTGUID_VR12: TGUID = '{fe44a9fe-8ed4-48bf-9d66-1b1adff9ff6d}';
  2433.   {$EXTERNALSYM DPVCTGUID_VR12}
  2434.  
  2435.   // Define the default compression type
  2436.   DPVCTGUID_DEFAULT: TGUID = '{7d82a29b-2242-4f82-8f39-5d1153df3e41}'; // DPVCTGUID_SC03;
  2437.   {$EXTERNALSYM DPVCTGUID_DEFAULT}
  2438.  
  2439. (****************************************************************************
  2440.  *
  2441.  * DirectPlayVoice Callback Functions
  2442.  *
  2443.  ****************************************************************************)
  2444.  
  2445. type
  2446.   TDVMessageHandler = function(pvUserContext: Pointer; dwMessageType: DWORD; lpMessage: Pointer): HResult; stdcall;
  2447.   {$NODEFINE TDVMessageHandler}
  2448.   {$HPPEMIT 'typedef PDVMESSAGEHANDLER TDVMessageHandler;'}
  2449.  
  2450. (****************************************************************************
  2451.  *
  2452.  * DirectPlayVoice Datatypes (Non-Structure / Non-Message)
  2453.  *
  2454.  ****************************************************************************)
  2455.  
  2456.   PDVID = ^DVID;
  2457.   DVID = DWORD;
  2458.   {$EXTERNALSYM DVID}
  2459.   TDVID = DVID;
  2460.  
  2461. (****************************************************************************
  2462.  *
  2463.  * DirectPlayVoice Message Types
  2464.  *
  2465.  ****************************************************************************)
  2466.  
  2467. const
  2468.   DVMSGID_BASE                        = $0000;
  2469.   {$EXTERNALSYM DVMSGID_BASE}
  2470.  
  2471.   DVMSGID_CREATEVOICEPLAYER           = (DVMSGID_BASE+$0001);
  2472.   {$EXTERNALSYM DVMSGID_CREATEVOICEPLAYER}
  2473.   DVMSGID_DELETEVOICEPLAYER           = (DVMSGID_BASE+$0002);
  2474.   {$EXTERNALSYM DVMSGID_DELETEVOICEPLAYER}
  2475.   DVMSGID_SESSIONLOST                 = (DVMSGID_BASE+$0003);
  2476.   {$EXTERNALSYM DVMSGID_SESSIONLOST}
  2477.   DVMSGID_PLAYERVOICESTART            = (DVMSGID_BASE+$0004);
  2478.   {$EXTERNALSYM DVMSGID_PLAYERVOICESTART}
  2479.   DVMSGID_PLAYERVOICESTOP             = (DVMSGID_BASE+$0005);
  2480.   {$EXTERNALSYM DVMSGID_PLAYERVOICESTOP}
  2481.   DVMSGID_RECORDSTART                 = (DVMSGID_BASE+$0006);
  2482.   {$EXTERNALSYM DVMSGID_RECORDSTART}
  2483.   DVMSGID_RECORDSTOP                  = (DVMSGID_BASE+$0007);
  2484.   {$EXTERNALSYM DVMSGID_RECORDSTOP}
  2485.   DVMSGID_CONNECTRESULT               = (DVMSGID_BASE+$0008);
  2486.   {$EXTERNALSYM DVMSGID_CONNECTRESULT}
  2487.   DVMSGID_DISCONNECTRESULT            = (DVMSGID_BASE+$0009);
  2488.   {$EXTERNALSYM DVMSGID_DISCONNECTRESULT}
  2489.   DVMSGID_INPUTLEVEL                  = (DVMSGID_BASE+$000A);
  2490.   {$EXTERNALSYM DVMSGID_INPUTLEVEL}
  2491.   DVMSGID_OUTPUTLEVEL                 = (DVMSGID_BASE+$000B);
  2492.   {$EXTERNALSYM DVMSGID_OUTPUTLEVEL}
  2493.   DVMSGID_HOSTMIGRATED                = (DVMSGID_BASE+$000C);
  2494.   {$EXTERNALSYM DVMSGID_HOSTMIGRATED}
  2495.   DVMSGID_SETTARGETS                  = (DVMSGID_BASE+$000D);
  2496.   {$EXTERNALSYM DVMSGID_SETTARGETS}
  2497.   DVMSGID_PLAYEROUTPUTLEVEL           = (DVMSGID_BASE+$000E);
  2498.   {$EXTERNALSYM DVMSGID_PLAYEROUTPUTLEVEL}
  2499.   DVMSGID_LOSTFOCUS                   = (DVMSGID_BASE+$0010);
  2500.   {$EXTERNALSYM DVMSGID_LOSTFOCUS}
  2501.   DVMSGID_GAINFOCUS                   = (DVMSGID_BASE+$0011);
  2502.   {$EXTERNALSYM DVMSGID_GAINFOCUS}
  2503.   DVMSGID_LOCALHOSTSETUP              = (DVMSGID_BASE+$0012);
  2504.   {$EXTERNALSYM DVMSGID_LOCALHOSTSETUP}
  2505.   DVMSGID_MAXBASE                     = (DVMSGID_LOCALHOSTSETUP);
  2506.   {$EXTERNALSYM DVMSGID_MAXBASE}
  2507.   DVMSGID_MINBASE                     = (DVMSGID_CREATEVOICEPLAYER);
  2508.   {$EXTERNALSYM DVMSGID_MINBASE}
  2509.  
  2510. (****************************************************************************
  2511.  *
  2512.  * DirectPlayVoice Constants
  2513.  *
  2514.  ****************************************************************************)
  2515.  
  2516.   //
  2517.   // Buffer Aggresiveness Value Ranges
  2518.   //
  2519.   DVBUFFERAGGRESSIVENESS_MIN          = $00000001;
  2520.   {$EXTERNALSYM DVBUFFERAGGRESSIVENESS_MIN}
  2521.   DVBUFFERAGGRESSIVENESS_MAX          = $00000064;
  2522.   {$EXTERNALSYM DVBUFFERAGGRESSIVENESS_MAX}
  2523.   DVBUFFERAGGRESSIVENESS_DEFAULT      = $00000000;
  2524.   {$EXTERNALSYM DVBUFFERAGGRESSIVENESS_DEFAULT}
  2525.  
  2526.   //
  2527.   // Buffer Quality Value Ranges
  2528.   //
  2529.   DVBUFFERQUALITY_MIN                 = $00000001;
  2530.   {$EXTERNALSYM DVBUFFERQUALITY_MIN}
  2531.   DVBUFFERQUALITY_MAX                 = $00000064;
  2532.   {$EXTERNALSYM DVBUFFERQUALITY_MAX}
  2533.   DVBUFFERQUALITY_DEFAULT             = $00000000;
  2534.   {$EXTERNALSYM DVBUFFERQUALITY_DEFAULT}
  2535.  
  2536.   DVID_SYS                = 0;
  2537.   {$EXTERNALSYM DVID_SYS}
  2538.  
  2539.   //
  2540.   // Used to identify the session host in client/server
  2541.   //
  2542.   DVID_SERVERPLAYER       = 1;
  2543.   {$EXTERNALSYM DVID_SERVERPLAYER}
  2544.  
  2545.   //
  2546.   // Used to target all players
  2547.   //
  2548.   DVID_ALLPLAYERS         = 0;
  2549.   {$EXTERNALSYM DVID_ALLPLAYERS}
  2550.  
  2551.   //
  2552.   // Used to identify the main buffer
  2553.   //
  2554.   DVID_REMAINING          = $FFFFFFFF;
  2555.   {$EXTERNALSYM DVID_REMAINING}
  2556.  
  2557.   //
  2558.   // Input level range
  2559.   //
  2560.   DVINPUTLEVEL_MIN                    = $00000000;
  2561.   {$EXTERNALSYM DVINPUTLEVEL_MIN}
  2562.   DVINPUTLEVEL_MAX                    = $00000063; // 99 decimal
  2563.   {$EXTERNALSYM DVINPUTLEVEL_MAX}
  2564.  
  2565.   DVNOTIFYPERIOD_MINPERIOD            = 20;
  2566.   {$EXTERNALSYM DVNOTIFYPERIOD_MINPERIOD}
  2567.  
  2568.  
  2569.   DVPLAYBACKVOLUME_DEFAULT            = DSBVOLUME_MAX;
  2570.   {$EXTERNALSYM DVPLAYBACKVOLUME_DEFAULT}
  2571.  
  2572.   DVRECORDVOLUME_LAST                 = $00000001;
  2573.   {$EXTERNALSYM DVRECORDVOLUME_LAST}
  2574.  
  2575.  
  2576.   //
  2577.   // Use the default value
  2578.   //
  2579.   DVTHRESHOLD_DEFAULT               = $FFFFFFFF;
  2580.   {$EXTERNALSYM DVTHRESHOLD_DEFAULT}
  2581.  
  2582.   //
  2583.   // Threshold Ranges
  2584.   //
  2585.   DVTHRESHOLD_MIN                   = $00000000;
  2586.   {$EXTERNALSYM DVTHRESHOLD_MIN}
  2587.   DVTHRESHOLD_MAX                   = $00000063;    // 99 decimal
  2588.   {$EXTERNALSYM DVTHRESHOLD_MAX}
  2589.  
  2590.   //
  2591.   // Threshold field is not used
  2592.   //
  2593.   DVTHRESHOLD_UNUSED                = $FFFFFFFE;
  2594.   {$EXTERNALSYM DVTHRESHOLD_UNUSED}
  2595.  
  2596.   //
  2597.   // Session Types
  2598.   //
  2599.   DVSESSIONTYPE_PEER                  = $00000001;
  2600.   {$EXTERNALSYM DVSESSIONTYPE_PEER}
  2601.   DVSESSIONTYPE_MIXING                = $00000002;
  2602.   {$EXTERNALSYM DVSESSIONTYPE_MIXING}
  2603.   DVSESSIONTYPE_FORWARDING            = $00000003;
  2604.   {$EXTERNALSYM DVSESSIONTYPE_FORWARDING}
  2605.   DVSESSIONTYPE_ECHO                  = $00000004;
  2606.   {$EXTERNALSYM DVSESSIONTYPE_ECHO}
  2607.  
  2608. (****************************************************************************
  2609.  *
  2610.  * DirectPlayVoice Flags
  2611.  *
  2612.  ****************************************************************************)
  2613.  
  2614.  
  2615.   //
  2616.   // Enable automatic adjustment of the recording volume
  2617.   //
  2618.   DVCLIENTCONFIG_AUTORECORDVOLUME     = $00000008;
  2619.   {$EXTERNALSYM DVCLIENTCONFIG_AUTORECORDVOLUME}
  2620.  
  2621.   //
  2622.   // Enable automatic voice activation
  2623.   //
  2624.   DVCLIENTCONFIG_AUTOVOICEACTIVATED   = $00000020;
  2625.   {$EXTERNALSYM DVCLIENTCONFIG_AUTOVOICEACTIVATED}
  2626.  
  2627.   //
  2628.   // Enable echo suppression
  2629.   //
  2630.   DVCLIENTCONFIG_ECHOSUPPRESSION      = $08000000;
  2631.   {$EXTERNALSYM DVCLIENTCONFIG_ECHOSUPPRESSION}
  2632.  
  2633.   //
  2634.   // Voice Activation manual mode
  2635.   //
  2636.   DVCLIENTCONFIG_MANUALVOICEACTIVATED = $00000004;
  2637.   {$EXTERNALSYM DVCLIENTCONFIG_MANUALVOICEACTIVATED}
  2638.  
  2639.   //
  2640.   // Only playback voices that have buffers created for them
  2641.   //
  2642.   DVCLIENTCONFIG_MUTEGLOBAL           = $00000010;
  2643.   {$EXTERNALSYM DVCLIENTCONFIG_MUTEGLOBAL}
  2644.  
  2645.   //
  2646.   // Mute the playback
  2647.   //
  2648.   DVCLIENTCONFIG_PLAYBACKMUTE         = $00000002;
  2649.   {$EXTERNALSYM DVCLIENTCONFIG_PLAYBACKMUTE}
  2650.  
  2651.   //
  2652.   // Mute the recording
  2653.   //
  2654.   DVCLIENTCONFIG_RECORDMUTE           = $00000001;
  2655.   {$EXTERNALSYM DVCLIENTCONFIG_RECORDMUTE}
  2656.  
  2657.   //
  2658.   // Complete the operation before returning
  2659.   //
  2660.   DVFLAGS_SYNC                        = $00000001;
  2661.   {$EXTERNALSYM DVFLAGS_SYNC}
  2662.  
  2663.   //
  2664.   // Just check to see if wizard has been run, and if so what it's results were
  2665.   //
  2666.   DVFLAGS_QUERYONLY                   = $00000002;
  2667.   {$EXTERNALSYM DVFLAGS_QUERYONLY}
  2668.  
  2669.   //
  2670.   // Shutdown the voice session without migrating the host
  2671.   //
  2672.   DVFLAGS_NOHOSTMIGRATE               = $00000008;
  2673.   {$EXTERNALSYM DVFLAGS_NOHOSTMIGRATE}
  2674.  
  2675.   //
  2676.   // Allow the back button to be enabled in the wizard
  2677.   //
  2678.   DVFLAGS_ALLOWBACK                   = $00000010;
  2679.   {$EXTERNALSYM DVFLAGS_ALLOWBACK}
  2680.  
  2681.   //
  2682.   // Disable host migration in the voice session
  2683.   //
  2684.   DVSESSION_NOHOSTMIGRATION           = $00000001;
  2685.   {$EXTERNALSYM DVSESSION_NOHOSTMIGRATION}
  2686.  
  2687.   //
  2688.   // Server controlled targetting
  2689.   //
  2690.   DVSESSION_SERVERCONTROLTARGET       = $00000002;
  2691.   {$EXTERNALSYM DVSESSION_SERVERCONTROLTARGET}
  2692.  
  2693.   //
  2694.   // Use DirectSound Normal Mode instead of priority
  2695.   //
  2696.   DVSOUNDCONFIG_NORMALMODE            = $00000001;
  2697.   {$EXTERNALSYM DVSOUNDCONFIG_NORMALMODE}
  2698.  
  2699.   //
  2700.   // Automatically select the microphone
  2701.   //
  2702.   DVSOUNDCONFIG_AUTOSELECT            = $00000002;
  2703.   {$EXTERNALSYM DVSOUNDCONFIG_AUTOSELECT}
  2704.  
  2705.   //
  2706.   // Run in half duplex mode
  2707.   //
  2708.   DVSOUNDCONFIG_HALFDUPLEX            = $00000004;
  2709.   {$EXTERNALSYM DVSOUNDCONFIG_HALFDUPLEX}
  2710.  
  2711.   //
  2712.   // No volume controls are available for the recording device
  2713.   //
  2714.   DVSOUNDCONFIG_NORECVOLAVAILABLE     = $00000010;
  2715.   {$EXTERNALSYM DVSOUNDCONFIG_NORECVOLAVAILABLE}
  2716.  
  2717.   //
  2718.   // Disable capture sharing
  2719.   //
  2720.   DVSOUNDCONFIG_NOFOCUS               = $20000000;
  2721.   {$EXTERNALSYM DVSOUNDCONFIG_NOFOCUS}
  2722.  
  2723.   //
  2724.   // Set system conversion quality to high
  2725.   //
  2726.   DVSOUNDCONFIG_SETCONVERSIONQUALITY    = $00000008;
  2727.   {$EXTERNALSYM DVSOUNDCONFIG_SETCONVERSIONQUALITY}
  2728.  
  2729.   //
  2730.   // Enable strict focus mode
  2731.   //
  2732.   DVSOUNDCONFIG_STRICTFOCUS           = $40000000;
  2733.   {$EXTERNALSYM DVSOUNDCONFIG_STRICTFOCUS}
  2734.  
  2735.   //
  2736.   // Player is in half duplex mode
  2737.   //
  2738.   DVPLAYERCAPS_HALFDUPLEX             = $00000001;
  2739.   {$EXTERNALSYM DVPLAYERCAPS_HALFDUPLEX}
  2740.  
  2741.   //
  2742.   // Specifies that player is the local player
  2743.   //
  2744.   DVPLAYERCAPS_LOCAL                  = $00000002;
  2745.   {$EXTERNALSYM DVPLAYERCAPS_LOCAL}
  2746.  
  2747.  
  2748. type
  2749. (****************************************************************************
  2750.  *
  2751.  * DirectPlayVoice Interface Pointer definitions
  2752.  *
  2753.  ****************************************************************************)
  2754.  
  2755.   IDirectPlayVoiceServer = interface;
  2756.  
  2757. (****************************************************************************
  2758.  *
  2759.  * DirectPlayVoice Structures (Non-Message)
  2760.  *
  2761.  ****************************************************************************)
  2762.  
  2763.  
  2764.   //
  2765.   // DirectPlayVoice Caps
  2766.   // (GetCaps / SetCaps)
  2767.   //
  2768.   PDVCaps = ^TDVCaps;
  2769.   DVCAPS = packed record
  2770.     dwSize:   DWORD;                 // Size of this structure
  2771.     dwFlags:   DWORD;                // Caps flags
  2772.   end;
  2773.   {$EXTERNALSYM DVCAPS}
  2774.   TDVCaps = DVCAPS;
  2775.  
  2776.   //
  2777.   // DirectPlayVoice Client Configuration
  2778.   // (Connect / GetClientConfig)
  2779.   //
  2780.   PDVClientConfig = ^TDVClientConfig;
  2781.   DVCLIENTCONFIG = packed record
  2782.     dwSize: DWORD;                 // Size of this structure
  2783.     dwFlags: DWORD;                // Flags for client config (DVCLIENTCONFIG_...)
  2784.     lRecordVolume: Longint;        // Recording volume
  2785.     lPlaybackVolume: Longint;      // Playback volume
  2786.     dwThreshold: DWORD;            // Voice Activation Threshold
  2787.     dwBufferQuality: DWORD;        // Buffer quality
  2788.     dwBufferAggressiveness: DWORD; // Buffer aggressiveness
  2789.     dwNotifyPeriod: DWORD;         // Period of notification messages (ms)
  2790.   end;
  2791.   {$EXTERNALSYM DVCLIENTCONFIG}
  2792.   TDVClientConfig = DVCLIENTCONFIG;
  2793.  
  2794.   //
  2795.   // DirectPlayVoice Compression Type Information
  2796.   // (GetCompressionTypes)
  2797.   //
  2798.   PDVCompressionInfo = ^TDVCompressionInfo;
  2799.   DVCOMPRESSIONINFO = packed record
  2800.     dwSize: DWORD;                 // Size of this structure
  2801.     guidType: TGUID;               // GUID that identifies this compression type
  2802.     lpszName: PWideChar;           // String name of this compression type
  2803.     lpszDescription: PWideChar;    // Description for this compression type
  2804.     dwFlags: DWORD;                // Flags for this compression type
  2805.     dwMaxBitsPerSecond: DWORD;     // Maximum # of bit/s this compression type uses
  2806.   end;
  2807.   {$EXTERNALSYM DVCOMPRESSIONINFO}
  2808.   TDVCompressionInfo = DVCOMPRESSIONINFO;
  2809.  
  2810.   //
  2811.   // DirectPlayVoice Session Description
  2812.   // (Host / GetSessionDesc)
  2813.   //
  2814.   PDVSessionDesc = ^TDVSessionDesc;
  2815.   DVSESSIONDESC = packed record
  2816.     dwSize: DWORD;                 // Size of this structure
  2817.     dwFlags: DWORD;                // Session flags (DVSESSION_...)
  2818.     dwSessionType: DWORD;          // Session type (DVSESSIONTYPE_...)
  2819.     guidCT: TGUID;                 // Compression Type to use
  2820.     dwBufferQuality: DWORD;        // Buffer quality
  2821.     dwBufferAggressiveness: DWORD; // Buffer aggresiveness
  2822.   end;
  2823.   {$EXTERNALSYM DVSESSIONDESC}
  2824.   TDVSessionDesc = DVSESSIONDESC;
  2825.  
  2826.   //
  2827.   // DirectPlayVoice Client Sound Device Configuration
  2828.   // (Connect / GetSoundDeviceConfig)
  2829.   //
  2830.   PDVSoundDeviceConfig = ^TDVSoundDeviceConfig;
  2831.   DVSOUNDDEVICECONFIG = packed record
  2832.     dwSize: DWORD;                 // Size of this structure
  2833.     dwFlags: DWORD;                // Flags for sound config (DVSOUNDCONFIG_...)
  2834.     guidPlaybackDevice: TGUID;     // GUID of the playback device to use
  2835.     lpdsPlaybackDevice: IDirectSound; // DirectSound Object to use (optional)
  2836.     guidCaptureDevice: TGUID;      // GUID of the capture device to use
  2837.     lpdsCaptureDevice: IDirectSoundCapture; // DirectSoundCapture Object to use (optional)
  2838.     hwndAppWindow: HWND;           // HWND of your application's top-level window
  2839.     lpdsMainBuffer: IDirectSoundBuffer; // DirectSoundBuffer to use for playback (optional)
  2840.     dwMainBufferFlags: DWORD;      // Flags to pass to Play() on the main buffer
  2841.     dwMainBufferPriority: DWORD;   // Priority to set when calling Play() on the main buffer
  2842.   end;
  2843.   {$EXTERNALSYM DVSOUNDDEVICECONFIG}
  2844.   TDVSoundDeviceConfig = DVSOUNDDEVICECONFIG;
  2845.  
  2846. (****************************************************************************
  2847.  *
  2848.  * DirectPlayVoice message handler call back structures
  2849.  *
  2850.  ****************************************************************************)
  2851.  
  2852.   //
  2853.   // Result of the Connect() call.  (If it wasn't called Async)
  2854.   // (DVMSGID_CONNECTRESULT)
  2855.   //
  2856.   PDVMsgConnectResult = ^TDVMsgConnectResult;
  2857.   DVMSG_CONNECTRESULT = packed record
  2858.     dwSize: DWORD;                         // Size of this structure
  2859.     hrResult: HRESULT;                     // Result of the Connect() call
  2860.   end;
  2861.   {$EXTERNALSYM DVMSG_CONNECTRESULT}
  2862.   TDVMsgConnectResult = DVMSG_CONNECTRESULT;
  2863.  
  2864.   //
  2865.   // A new player has entered the voice session
  2866.   // (DVMSGID_CREATEVOICEPLAYER)
  2867.   //
  2868.   PDVMsgCreateVoicePlayer = ^TDVMsgCreateVoicePlayer;
  2869.   DVMSG_CREATEVOICEPLAYER = packed record
  2870.     dwSize: DWORD;                         // Size of this structure
  2871.     dvidPlayer: TDVID;                     // DVID of the player who joined
  2872.     dwFlags: DWORD;                        // Player flags (DVPLAYERCAPS_...)
  2873.     pvPlayerContext: Pointer;              // Context value for this player (user set)
  2874.   end;
  2875.   {$EXTERNALSYM DVMSG_CREATEVOICEPLAYER}
  2876.   TDVMsgCreateVoicePlayer = DVMSG_CREATEVOICEPLAYER;
  2877.  
  2878.   //
  2879.   // A player has left the voice session
  2880.   // (DVMSGID_DELETEVOICEPLAYER)
  2881.   //
  2882.   PDVMsgDeleteVoicePlayer = ^TDVMsgDeleteVoicePlayer;
  2883.   DVMSG_DELETEVOICEPLAYER = packed record
  2884.     dwSize: DWORD;                         // Size of this structure
  2885.     dvidPlayer: TDVID;                     // DVID of the player who left
  2886.     pvPlayerContext: Pointer;              // Context value for the player
  2887.   end;
  2888.   {$EXTERNALSYM DVMSG_DELETEVOICEPLAYER}
  2889.   TDVMsgDeleteVoicePlayer = DVMSG_DELETEVOICEPLAYER;
  2890.  
  2891.   //
  2892.   // Result of the Disconnect() call.  (If it wasn't called Async)
  2893.   // (DVMSGID_DISCONNECTRESULT)
  2894.   //
  2895.   PDVMsgDisconnectResult = ^TDVMsgDisconnectResult;
  2896.   DVMSG_DISCONNECTRESULT = packed record
  2897.     dwSize: DWORD;                         // Size of this structure
  2898.     hrResult: HRESULT;                     // Result of the Disconnect() call
  2899.   end;
  2900.   {$EXTERNALSYM DVMSG_DISCONNECTRESULT}
  2901.   TDVMsgDisconnectResult = DVMSG_DISCONNECTRESULT;
  2902.  
  2903.   //
  2904.   // The voice session host has migrated.
  2905.   // (DVMSGID_HOSTMIGRATED)
  2906.   //
  2907.   PDVMsgHostMigrated = ^TDVMsgHostMigrated;
  2908.   DVMSG_HOSTMIGRATED = packed record
  2909.     dwSize: DWORD;         // Size of this structure
  2910.     dvidNewHostID: TDVID;  // DVID of the player who is now the host
  2911.     pdvServerInterface: IDirectPlayVoiceServer; // Pointer to the new host object (if local player is now host)
  2912.   end;
  2913.   {$EXTERNALSYM DVMSG_HOSTMIGRATED}
  2914.   TDVMsgHostMigrated = DVMSG_HOSTMIGRATED;
  2915.  
  2916.   //
  2917.   // The current input level / recording volume on the local machine
  2918.   // (DVMSGID_INPUTLEVEL)
  2919.   //
  2920.   PDVMsgInputlevel = ^TDVMsgInputlevel;
  2921.   DVMSG_INPUTLEVEL = packed record
  2922.     dwSize: DWORD;                         // Size of this structure
  2923.     dwPeakLevel: DWORD;                    // Current peak level of the audio
  2924.     lRecordVolume: Longint;                // Current recording volume
  2925.     pvLocalPlayerContext: Pointer;         // Context value for the local player
  2926.   end;
  2927.   {$EXTERNALSYM DVMSG_INPUTLEVEL}
  2928.   TDVMsgInputlevel = DVMSG_INPUTLEVEL;
  2929.  
  2930.   //
  2931.   // The local client is about to become the new host
  2932.   // (DVMSGID_LOCALHOSTSETUP)
  2933.   //
  2934.   PDVMsgLocalHostSetup = ^TDVMsgLocalHostSetup;
  2935.   DVMSG_LOCALHOSTSETUP = packed record
  2936.     dwSize: DWORD;             // Size of this structure
  2937.     pvContext: Pointer;        // Context value to be passed to Initialize() of new host object
  2938.     pMessageHandler: TDVMessageHandler; // Message handler to be used by new host object
  2939.   end;
  2940.   {$EXTERNALSYM DVMSG_LOCALHOSTSETUP}
  2941.   TDVMsgLocalHostSetup = DVMSG_LOCALHOSTSETUP;
  2942.  
  2943.   //
  2944.   // The current output level for the combined output of all incoming streams.
  2945.   // (DVMSGID_OUTPUTLEVEL)
  2946.   //
  2947.   PDVMsgOutputLevel = ^TDVMsgOutputLevel;
  2948.   DVMSG_OUTPUTLEVEL = packed record
  2949.     dwSize: DWORD;                         // Size of this structure
  2950.     dwPeakLevel: DWORD;                    // Current peak level of the output
  2951.     lOutputVolume: Longint;                // Current playback volume
  2952.     pvLocalPlayerContext: Pointer;         // Context value for the local player
  2953.   end;
  2954.   {$EXTERNALSYM DVMSG_OUTPUTLEVEL}
  2955.   TDVMsgOutputLevel = DVMSG_OUTPUTLEVEL;
  2956.  
  2957.   //
  2958.   // The current peak level of an individual player's incoming audio stream as it is
  2959.   // being played back.
  2960.   // (DVMSGID_PLAYEROUTPUTLEVEL)
  2961.   //
  2962.   PDVMsgPlayerOutputLevel = ^TDVMsgPlayerOutputLevel;
  2963.   DVMSG_PLAYEROUTPUTLEVEL = packed record
  2964.     dwSize: DWORD;                         // Size of this structure
  2965.     dvidSourcePlayerID: TDVID;             // DVID of the player
  2966.     dwPeakLevel: DWORD;                    // Peak level of the player's stream
  2967.     pvPlayerContext: Pointer;              // Context value for the player
  2968.   end;
  2969.   {$EXTERNALSYM DVMSG_PLAYEROUTPUTLEVEL}
  2970.   TDVMsgPlayerOutputLevel = DVMSG_PLAYEROUTPUTLEVEL;
  2971.  
  2972.   //
  2973.   // An audio stream from the specified player has started playing back on the local client.
  2974.   // (DVMSGID_PLAYERVOICESTART).
  2975.   //
  2976.   PDVMsgPlayerVoiceStart = ^TDVMsgPlayerVoiceStart;
  2977.   DVMSG_PLAYERVOICESTART = packed record
  2978.     dwSize: DWORD;                         // Size of this structure
  2979.     dvidSourcePlayerID: TDVID;             // DVID of the Player
  2980.     pvPlayerContext: Pointer;              // Context value for this player
  2981.   end;
  2982.   {$EXTERNALSYM DVMSG_PLAYERVOICESTART}
  2983.   TDVMsgPlayerVoiceStart = DVMSG_PLAYERVOICESTART;
  2984.  
  2985.   //
  2986.   // The audio stream from the specified player has stopped playing back on the local client.
  2987.   // (DVMSGID_PLAYERVOICESTOP)
  2988.   //
  2989.   PDVMsgPlayerVoiceStop = ^TDVMsgPlayerVoiceStop;
  2990.   DVMSG_PLAYERVOICESTOP = packed record
  2991.     dwSize:   DWORD;                         // Size of this structure
  2992.     dvidSourcePlayerID:    DVID;             // DVID of the player
  2993.     pvPlayerContext:    Pointer;                // Context value for this player
  2994.   end;
  2995.   {$EXTERNALSYM DVMSG_PLAYERVOICESTOP}
  2996.   TDVMsgPlayerVoiceStop = DVMSG_PLAYERVOICESTOP;
  2997.  
  2998.   //
  2999.   // Transmission has started on the local machine
  3000.   // (DVMSGID_RECORDSTART)
  3001.   //
  3002.   PDVMsgRecordStart = ^TDVMsgRecordStart;
  3003.   DVMSG_RECORDSTART = packed record
  3004.     dwSize:   DWORD;                         // Size of this structure
  3005.     dwPeakLevel:   DWORD;                    // Peak level that caused transmission to start
  3006.     pvLocalPlayerContext:    Pointer;           // Context value for the local player
  3007.   end;
  3008.   {$EXTERNALSYM DVMSG_RECORDSTART}
  3009.   TDVMsgRecordStart = DVMSG_RECORDSTART;
  3010.  
  3011.   //
  3012.   // Transmission has stopped on the local machine
  3013.   // (DVMSGID_RECORDSTOP)
  3014.   //
  3015.   PDVMsgRecordStop = ^TDVMsgRecordStop;
  3016.   DVMSG_RECORDSTOP = packed record
  3017.     dwSize: DWORD;                         // Size of this structure
  3018.     dwPeakLevel: DWORD;                    // Peak level that caused transmission to stop
  3019.     pvLocalPlayerContext: Pointer;         // Context value for the local player
  3020.   end;
  3021.   {$EXTERNALSYM DVMSG_RECORDSTOP}
  3022.   TDVMsgRecordStop = DVMSG_RECORDSTOP;
  3023.  
  3024.   //
  3025.   // The voice session has been lost
  3026.   // (DVMSGID_SESSIONLOST)
  3027.   //
  3028.   PDVMsgSessionLost = ^TDVMsgSessionLost;
  3029.   DVMSG_SESSIONLOST = packed record
  3030.     dwSize: DWORD;                         // Size of this structure
  3031.     hrResult: HRESULT;                     // Reason the session was disconnected
  3032.   end;
  3033.   {$EXTERNALSYM DVMSG_SESSIONLOST}
  3034.   TDVMsgSessionLost = DVMSG_SESSIONLOST;
  3035.  
  3036.   //
  3037.   // The target list has been updated for the local client
  3038.   // (DVMSGID_SETTARGETS)
  3039.   //
  3040.   PDVMsgSetTargets = ^TDVMsgSetTargets;
  3041.   DVMSG_SETTARGETS = packed record
  3042.     dwSize: DWORD;                         // Size of this structure
  3043.     dwNumTargets: DWORD;                   // # of targets
  3044.     pdvidTargets: PDVID;                   // An array of DVIDs specifying the current targets
  3045.   end;
  3046.   {$EXTERNALSYM DVMSG_SETTARGETS}
  3047.   TDVMsgSetTargets = DVMSG_SETTARGETS;
  3048.  
  3049.  
  3050. (****************************************************************************
  3051.  *
  3052.  * DirectPlayVoice Functions
  3053.  *
  3054.  ****************************************************************************)
  3055.  
  3056. (*
  3057.  *
  3058.  * This function is no longer supported.  It is recommended that CoCreateInstance be used to create
  3059.  * DirectPlay voice objects.
  3060.  *
  3061.  * extern HRESULT WINAPI DirectPlayVoiceCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown);
  3062.  *
  3063.  *)
  3064.  
  3065. (****************************************************************************
  3066.  *
  3067.  * DirectPlay8 Application Interfaces
  3068.  *
  3069.  ****************************************************************************)
  3070.  
  3071.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlayVoiceClient);'}
  3072.   {$EXTERNALSYM IDirectPlayVoiceClient}
  3073.   IDirectPlayVoiceClient = interface(IUnknown)
  3074.     ['{1dfdc8ea-bcf7-41d6-b295-ab64b3b23306}']
  3075.     (*** IDirectPlayVoiceClient methods ***)
  3076.     function Initialize(pVoid: IUnknown; pMessageHandler: TDVMessageHandler;
  3077.       pUserContext: Pointer; pdwMessageMask: PDWORD; dwMessageMaskElements: DWORD): HResult; stdcall;
  3078.     function Connect(const pSoundDeviceConfig: TDVSoundDeviceConfig;
  3079.       const pdvClientConfig: TDVClientConfig; dwFlags: DWORD): HResult; stdcall;
  3080.     function Disconnect(dwFlags: DWORD): HResult; stdcall;
  3081.     function GetSessionDesc(out pvSessionDesc: TDVSessionDesc): HResult; stdcall;
  3082.     function GetClientConfig(out pClientConfig: TDVClientConfig): HResult; stdcall;
  3083.     function SetClientConfig(const pClientConfig: TDVClientConfig): HResult; stdcall;
  3084.     function GetCaps(out pDVCaps: TDVCaps): HResult; stdcall;
  3085.     function GetCompressionTypes(pData: Pointer; var pdwDataSize: DWORD;
  3086.       out pdwNumElements: DWORD; dwFlags: DWORD): HResult; stdcall;
  3087.     function SetTransmitTargets(pdvIDTargets: PDVID; dwNumTargets, dwFlags: DWORD): HResult; stdcall;
  3088.     function GetTransmitTargets(pdvIDTargets: PDVID; var dwNumTargets: DWORD; dwFlags: DWORD): HResult; stdcall;
  3089.     function Create3DSoundBuffer(dvID: TDVID; lpdsSourceBuffer: IDirectSoundBuffer;
  3090.       dwPriority, dwFlags: DWORD; out lpUserBuffer: IDirectSound3DBuffer): HResult; stdcall;
  3091.     function Delete3DSoundBuffer(dvID: TDVID; lpUserBuffer: IDirectSound3DBuffer): HResult; stdcall;
  3092.     function SetNotifyMask(pdwMessageMask: PDWORD; dwMessageMaskElements: DWORD): HResult; stdcall;
  3093.     function GetSoundDeviceConfig(pSoundDeviceConfig: PDVSoundDeviceConfig; var pdwSize: DWORD): HResult; stdcall;
  3094.   end;
  3095.  
  3096.  
  3097.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlayVoiceServer);'}
  3098.   {$EXTERNALSYM IDirectPlayVoiceServer}
  3099.   IDirectPlayVoiceServer = interface(IUnknown)
  3100.     ['{faa1c173-0468-43b6-8a2a-ea8a4f2076c9}']
  3101.     (*** IDirectPlayVoiceServer methods ***)
  3102.     function Initialize(pVoid: IUnknown; pMessageHandler: TDVMessageHandler;
  3103.       pUserContext: Pointer; pdwMessageMask: PDWORD; dwMessageMaskElements: DWORD): HResult; stdcall;
  3104.     function StartSession(const pSessionDesc: TDVSessionDesc; dwFlags: DWORD): HResult; stdcall;
  3105.     function StopSession(dwFlags: DWORD): HResult; stdcall;
  3106.     function GetSessionDesc(out pvSessionDesc: TDVSessionDesc): HResult; stdcall;
  3107.     function SetSessionDesc(const pvSessionDesc: TDVSessionDesc): HResult; stdcall;
  3108.     function GetCaps(out pDVCaps: TDVCaps): HResult; stdcall;
  3109.     function GetCompressionTypes(pData: Pointer; var pdwDataSize: DWORD;
  3110.       out pdwNumElements: DWORD; dwFlags: DWORD): HResult; stdcall;
  3111.     function SetTransmitTargets(dvSource: TDVID; pdvIDTargets: PDVID;
  3112.       dwNumTargets, dwFlags: DWORD): HResult; stdcall;
  3113.     function GetTransmitTargets(dvSource: TDVID; pdvIDTargets: PDVID;
  3114.       var dwNumTargets: DWORD; dwFlags: DWORD): HResult; stdcall;
  3115.     function SetNotifyMask(pdwMessageMask: PDWORD; dwMessageMaskElements: DWORD): HResult; stdcall;
  3116.   end;
  3117.  
  3118.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlayVoiceTest);'}
  3119.   {$EXTERNALSYM IDirectPlayVoiceTest}
  3120.   IDirectPlayVoiceTest = interface(IUnknown)
  3121.     ['{d26af734-208b-41da-8224-e0ce79810be1}']
  3122.     (*** IDirectPlayVoiceTest methods ***)
  3123.     function CheckAudioSetup(pguidPlaybackDevice, pguidCaptureDevice: PGUID;
  3124.       hwndParent: hWND; dwFlags: DWORD): HResult; stdcall;
  3125.   end;
  3126.  
  3127. (****************************************************************************
  3128.  *
  3129.  * DirectPlayVoice Interface IIDs
  3130.  *
  3131.  ****************************************************************************)
  3132.  
  3133.   // {1DFDC8EA-BCF7-41d6-B295-AB64B3B23306}
  3134.   IID_IDirectPlayVoiceClient = IDirectPlayVoiceClient;
  3135.   {$EXTERNALSYM IID_IDirectPlayVoiceClient}
  3136.  
  3137.   // {FAA1C173-0468-43b6-8A2A-EA8A4F2076C9}
  3138.   IID_IDirectPlayVoiceServer = IDirectPlayVoiceServer;
  3139.   {$EXTERNALSYM IID_IDirectPlayVoiceServer}
  3140.  
  3141.   // {D26AF734-208B-41da-8224-E0CE79810BE1}
  3142.   IID_IDirectPlayVoiceTest = IDirectPlayVoiceTest;
  3143.   {$EXTERNALSYM IID_IDirectPlayVoiceTest}
  3144.  
  3145.  
  3146. (****************************************************************************
  3147.  *
  3148.  * DIRECTPLAYVOICE ERRORS
  3149.  *
  3150.  * Errors are represented by negative values and cannot be combined.
  3151.  *
  3152.  ****************************************************************************)
  3153.  
  3154. const
  3155.   _FACDPV  = $15;
  3156.   {$EXTERNALSYM _FACDPV}
  3157.  
  3158. //#define MAKE_DVHRESULT( code )          MAKE_HRESULT( 1, _FACDPV, code )
  3159.  
  3160. (*
  3161. #define DV_FULLDUPLEX                   MAKE_HRESULT( 0, _FACDPV,  0x0005 )
  3162. #define DV_HALFDUPLEX                   MAKE_HRESULT( 0, _FACDPV,  0x000A )
  3163. #define DV_PENDING                        MAKE_HRESULT( 0, _FACDPV,  0x0010 )
  3164.  
  3165. #define DVERR_BUFFERTOOSMALL            MAKE_DVHRESULT(  0x001E )
  3166. #define DVERR_EXCEPTION                 MAKE_DVHRESULT(  0x004A )
  3167. #define DVERR_GENERIC                   E_FAIL
  3168. #define DVERR_INVALIDFLAGS              MAKE_DVHRESULT( 0x0078 )
  3169. #define DVERR_INVALIDOBJECT             MAKE_DVHRESULT( 0x0082 )
  3170. #define DVERR_INVALIDPARAM              E_INVALIDARG
  3171. #define DVERR_INVALIDPLAYER             MAKE_DVHRESULT( 0x0087 )
  3172. #define DVERR_INVALIDGROUP              MAKE_DVHRESULT( 0x0091 )
  3173. #define DVERR_INVALIDHANDLE             MAKE_DVHRESULT( 0x0096 )
  3174. #define DVERR_OUTOFMEMORY               E_OUTOFMEMORY
  3175. #define DVERR_PENDING                   DV_PENDING
  3176. #define DVERR_NOTSUPPORTED              E_NOTIMPL
  3177. #define DVERR_NOINTERFACE               E_NOINTERFACE
  3178. #define DVERR_SESSIONLOST               MAKE_DVHRESULT( 0x012C )
  3179. #define DVERR_NOVOICESESSION            MAKE_DVHRESULT( 0x012E )
  3180. #define DVERR_CONNECTIONLOST            MAKE_DVHRESULT( 0x0168 )
  3181. #define DVERR_NOTINITIALIZED            MAKE_DVHRESULT( 0x0169 )
  3182. #define DVERR_CONNECTED                 MAKE_DVHRESULT( 0x016A )
  3183. #define DVERR_NOTCONNECTED              MAKE_DVHRESULT( 0x016B )
  3184. #define DVERR_CONNECTABORTING           MAKE_DVHRESULT( 0x016E )
  3185. #define DVERR_NOTALLOWED                MAKE_DVHRESULT( 0x016F )
  3186. #define DVERR_INVALIDTARGET             MAKE_DVHRESULT( 0x0170 )
  3187. #define DVERR_TRANSPORTNOTHOST          MAKE_DVHRESULT( 0x0171 )
  3188. #define DVERR_COMPRESSIONNOTSUPPORTED   MAKE_DVHRESULT( 0x0172 )
  3189. #define DVERR_ALREADYPENDING            MAKE_DVHRESULT( 0x0173 )
  3190. #define DVERR_SOUNDINITFAILURE          MAKE_DVHRESULT( 0x0174 )
  3191. #define DVERR_TIMEOUT                   MAKE_DVHRESULT( 0x0175 )
  3192. #define DVERR_CONNECTABORTED            MAKE_DVHRESULT( 0x0176 )
  3193. #define DVERR_NO3DSOUND                 MAKE_DVHRESULT( 0x0177 )
  3194. #define DVERR_ALREADYBUFFERED            MAKE_DVHRESULT( 0x0178 )
  3195. #define DVERR_NOTBUFFERED               MAKE_DVHRESULT( 0x0179 )
  3196. #define DVERR_HOSTING                   MAKE_DVHRESULT( 0x017A )
  3197. #define DVERR_NOTHOSTING                MAKE_DVHRESULT( 0x017B )
  3198. #define DVERR_INVALIDDEVICE             MAKE_DVHRESULT( 0x017C )
  3199. #define DVERR_RECORDSYSTEMERROR         MAKE_DVHRESULT( 0x017D )
  3200. #define DVERR_PLAYBACKSYSTEMERROR       MAKE_DVHRESULT( 0x017E )
  3201. #define DVERR_SENDERROR                 MAKE_DVHRESULT( 0x017F )
  3202. #define DVERR_USERCANCEL                MAKE_DVHRESULT( 0x0180 )
  3203. #define DVERR_RUNSETUP                  MAKE_DVHRESULT( 0x0183 )
  3204. #define DVERR_INCOMPATIBLEVERSION       MAKE_DVHRESULT( 0x0184 )
  3205. #define DVERR_INITIALIZED               MAKE_DVHRESULT( 0x0187 )
  3206. #define DVERR_INVALIDPOINTER            E_POINTER
  3207. #define DVERR_NOTRANSPORT               MAKE_DVHRESULT( 0x0188 )
  3208. #define DVERR_NOCALLBACK                MAKE_DVHRESULT( 0x0189 )
  3209. #define DVERR_TRANSPORTNOTINIT          MAKE_DVHRESULT( 0x018A )
  3210. #define DVERR_TRANSPORTNOSESSION        MAKE_DVHRESULT( 0x018B )
  3211. #define DVERR_TRANSPORTNOPLAYER         MAKE_DVHRESULT( 0x018C )
  3212. #define DVERR_USERBACK                  MAKE_DVHRESULT( 0x018D )
  3213. #define DVERR_NORECVOLAVAILABLE         MAKE_DVHRESULT( 0x018E )
  3214. #define DVERR_INVALIDBUFFER                MAKE_DVHRESULT( 0x018F )
  3215. #define DVERR_LOCKEDBUFFER                MAKE_DVHRESULT( 0x0190 )
  3216. *)
  3217.  
  3218.   MAKE_DVHRESULT_R                = (1 shl 31) or (_FACDPV shl 16);
  3219.  
  3220.   DV_OK                           = S_OK;
  3221.   {$EXTERNALSYM DV_OK}
  3222.   DV_FULLDUPLEX                   = (0 shl 31) or (_FACDPV shl 16) or $0005;
  3223.   {$EXTERNALSYM DV_FULLDUPLEX}
  3224.   DV_HALFDUPLEX                   = (0 shl 31) or (_FACDPV shl 16) or $000A;
  3225.   {$EXTERNALSYM DV_HALFDUPLEX}
  3226.   DV_PENDING                    = (0 shl 31) or (_FACDPV shl 16) or $0010;
  3227.   {$EXTERNALSYM DV_PENDING}
  3228.  
  3229.   DVERR_BUFFERTOOSMALL            = MAKE_DVHRESULT_R + $001E ;
  3230.   {$EXTERNALSYM DVERR_BUFFERTOOSMALL}
  3231.   DVERR_EXCEPTION                 = MAKE_DVHRESULT_R + $004A ;
  3232.   {$EXTERNALSYM DVERR_EXCEPTION}
  3233.   DVERR_GENERIC                   = E_FAIL;
  3234.   {$EXTERNALSYM DVERR_GENERIC}
  3235.   DVERR_INVALIDFLAGS              = MAKE_DVHRESULT_R + $0078 ;
  3236.   {$EXTERNALSYM DVERR_INVALIDFLAGS}
  3237.   DVERR_INVALIDOBJECT             = MAKE_DVHRESULT_R + $0082 ;
  3238.   {$EXTERNALSYM DVERR_INVALIDOBJECT}
  3239.   DVERR_INVALIDPARAM              = E_INVALIDARG;
  3240.   {$EXTERNALSYM DVERR_INVALIDPARAM}
  3241.   DVERR_INVALIDPLAYER             = MAKE_DVHRESULT_R + $0087 ;
  3242.   {$EXTERNALSYM DVERR_INVALIDPLAYER}
  3243.   DVERR_INVALIDGROUP              = MAKE_DVHRESULT_R + $0091 ;
  3244.   {$EXTERNALSYM DVERR_INVALIDGROUP}
  3245.   DVERR_INVALIDHANDLE             = MAKE_DVHRESULT_R + $0096 ;
  3246.   {$EXTERNALSYM DVERR_INVALIDHANDLE}
  3247.   DVERR_OUTOFMEMORY               = E_OUTOFMEMORY;
  3248.   {$EXTERNALSYM DVERR_OUTOFMEMORY}
  3249.   DVERR_PENDING                   = DV_PENDING;
  3250.   {$EXTERNALSYM DVERR_PENDING}
  3251.   DVERR_NOTSUPPORTED              = E_NOTIMPL;
  3252.   {$EXTERNALSYM DVERR_NOTSUPPORTED}
  3253.   DVERR_NOINTERFACE               = E_NOINTERFACE;
  3254.   {$EXTERNALSYM DVERR_NOINTERFACE}
  3255.   DVERR_SESSIONLOST               = MAKE_DVHRESULT_R + $012C ;
  3256.   {$EXTERNALSYM DVERR_SESSIONLOST}
  3257.   DVERR_NOVOICESESSION            = MAKE_DVHRESULT_R + $012E ;
  3258.   {$EXTERNALSYM DVERR_NOVOICESESSION}
  3259.   DVERR_CONNECTIONLOST            = MAKE_DVHRESULT_R + $0168 ;
  3260.   {$EXTERNALSYM DVERR_CONNECTIONLOST}
  3261.   DVERR_NOTINITIALIZED            = MAKE_DVHRESULT_R + $0169 ;
  3262.   {$EXTERNALSYM DVERR_NOTINITIALIZED}
  3263.   DVERR_CONNECTED                 = MAKE_DVHRESULT_R + $016A ;
  3264.   {$EXTERNALSYM DVERR_CONNECTED}
  3265.   DVERR_NOTCONNECTED              = MAKE_DVHRESULT_R + $016B ;
  3266.   {$EXTERNALSYM DVERR_NOTCONNECTED}
  3267.   DVERR_CONNECTABORTING           = MAKE_DVHRESULT_R + $016E ;
  3268.   {$EXTERNALSYM DVERR_CONNECTABORTING}
  3269.   DVERR_NOTALLOWED                = MAKE_DVHRESULT_R + $016F ;
  3270.   {$EXTERNALSYM DVERR_NOTALLOWED}
  3271.   DVERR_INVALIDTARGET             = MAKE_DVHRESULT_R + $0170 ;
  3272.   {$EXTERNALSYM DVERR_INVALIDTARGET}
  3273.   DVERR_TRANSPORTNOTHOST          = MAKE_DVHRESULT_R + $0171 ;
  3274.   {$EXTERNALSYM DVERR_TRANSPORTNOTHOST}
  3275.   DVERR_COMPRESSIONNOTSUPPORTED   = MAKE_DVHRESULT_R + $0172 ;
  3276.   {$EXTERNALSYM DVERR_COMPRESSIONNOTSUPPORTED}
  3277.   DVERR_ALREADYPENDING            = MAKE_DVHRESULT_R + $0173 ;
  3278.   {$EXTERNALSYM DVERR_ALREADYPENDING}
  3279.   DVERR_SOUNDINITFAILURE          = MAKE_DVHRESULT_R + $0174 ;
  3280.   {$EXTERNALSYM DVERR_SOUNDINITFAILURE}
  3281.   DVERR_TIMEOUT                   = MAKE_DVHRESULT_R + $0175 ;
  3282.   {$EXTERNALSYM DVERR_TIMEOUT}
  3283.   DVERR_CONNECTABORTED            = MAKE_DVHRESULT_R + $0176 ;
  3284.   {$EXTERNALSYM DVERR_CONNECTABORTED}
  3285.   DVERR_NO3DSOUND                 = MAKE_DVHRESULT_R + $0177 ;
  3286.   {$EXTERNALSYM DVERR_NO3DSOUND}
  3287.   DVERR_ALREADYBUFFERED              = MAKE_DVHRESULT_R + $0178 ;
  3288.   {$EXTERNALSYM DVERR_ALREADYBUFFERED}
  3289.   DVERR_NOTBUFFERED               = MAKE_DVHRESULT_R + $0179 ;
  3290.   {$EXTERNALSYM DVERR_NOTBUFFERED}
  3291.   DVERR_HOSTING                   = MAKE_DVHRESULT_R + $017A ;
  3292.   {$EXTERNALSYM DVERR_HOSTING}
  3293.   DVERR_NOTHOSTING                = MAKE_DVHRESULT_R + $017B ;
  3294.   {$EXTERNALSYM DVERR_NOTHOSTING}
  3295.   DVERR_INVALIDDEVICE             = MAKE_DVHRESULT_R + $017C ;
  3296.   {$EXTERNALSYM DVERR_INVALIDDEVICE}
  3297.   DVERR_RECORDSYSTEMERROR         = MAKE_DVHRESULT_R + $017D ;
  3298.   {$EXTERNALSYM DVERR_RECORDSYSTEMERROR}
  3299.   DVERR_PLAYBACKSYSTEMERROR       = MAKE_DVHRESULT_R + $017E ;
  3300.   {$EXTERNALSYM DVERR_PLAYBACKSYSTEMERROR}
  3301.   DVERR_SENDERROR                 = MAKE_DVHRESULT_R + $017F ;
  3302.   {$EXTERNALSYM DVERR_SENDERROR}
  3303.   DVERR_USERCANCEL                = MAKE_DVHRESULT_R + $0180 ;
  3304.   {$EXTERNALSYM DVERR_USERCANCEL}
  3305.   DVERR_RUNSETUP                  = MAKE_DVHRESULT_R + $0183 ;
  3306.   {$EXTERNALSYM DVERR_RUNSETUP}
  3307.   DVERR_INCOMPATIBLEVERSION       = MAKE_DVHRESULT_R + $0184 ;
  3308.   {$EXTERNALSYM DVERR_INCOMPATIBLEVERSION}
  3309.   DVERR_INITIALIZED               = MAKE_DVHRESULT_R + $0187 ;
  3310.   {$EXTERNALSYM DVERR_INITIALIZED}
  3311.   DVERR_INVALIDPOINTER            = E_POINTER;
  3312.   {$EXTERNALSYM DVERR_INVALIDPOINTER}
  3313.   DVERR_NOTRANSPORT               = MAKE_DVHRESULT_R + $0188 ;
  3314.   {$EXTERNALSYM DVERR_NOTRANSPORT}
  3315.   DVERR_NOCALLBACK                = MAKE_DVHRESULT_R + $0189 ;
  3316.   {$EXTERNALSYM DVERR_NOCALLBACK}
  3317.   DVERR_TRANSPORTNOTINIT          = MAKE_DVHRESULT_R + $018A ;
  3318.   {$EXTERNALSYM DVERR_TRANSPORTNOTINIT}
  3319.   DVERR_TRANSPORTNOSESSION        = MAKE_DVHRESULT_R + $018B ;
  3320.   {$EXTERNALSYM DVERR_TRANSPORTNOSESSION}
  3321.   DVERR_TRANSPORTNOPLAYER         = MAKE_DVHRESULT_R + $018C ;
  3322.   {$EXTERNALSYM DVERR_TRANSPORTNOPLAYER}
  3323.   DVERR_USERBACK                  = MAKE_DVHRESULT_R + $018D ;
  3324.   {$EXTERNALSYM DVERR_USERBACK}
  3325.   DVERR_NORECVOLAVAILABLE         = MAKE_DVHRESULT_R + $018E ;
  3326.   {$EXTERNALSYM DVERR_NORECVOLAVAILABLE}
  3327.   DVERR_INVALIDBUFFER             = MAKE_DVHRESULT_R + $018F ;
  3328.   {$EXTERNALSYM DVERR_INVALIDBUFFER}
  3329.   DVERR_LOCKEDBUFFER              = MAKE_DVHRESULT_R + $0190 ;
  3330.   {$EXTERNALSYM DVERR_LOCKEDBUFFER}
  3331.  
  3332.  
  3333.  
  3334. ///////////////////////////////////////////////////////////////////////////////
  3335. ///////////////////////////////////////////////////////////////////////////////
  3336. // Compatibility types for non-Borland compliant translations of DirectPlay8 //
  3337. ///////////////////////////////////////////////////////////////////////////////
  3338. ///////////////////////////////////////////////////////////////////////////////
  3339.  
  3340. type
  3341.   PDvmsg_Connectresult = PDVMsgConnectResult;
  3342.   TDvmsg_Connectresult = TDVMsgConnectResult;
  3343.   PDvmsg_Createvoiceplayer = PDVMsgCreateVoicePlayer;
  3344.   TDvmsg_Createvoiceplayer = TDVMsgCreateVoicePlayer;
  3345.   PDvmsg_Deletevoiceplayer = PDVMsgDeleteVoicePlayer;
  3346.   TDvmsg_Deletevoiceplayer = TDVMsgDeleteVoicePlayer;
  3347.   PDvmsg_Disconnectresult = PDVMsgDisconnectResult;
  3348.   TDvmsg_Disconnectresult = TDVMsgDisconnectResult;
  3349.   PDvmsg_Hostmigrated = PDVMsgHostMigrated;
  3350.   TDvmsg_Hostmigrated = TDVMsgHostMigrated;
  3351.   PDvmsg_Inputlevel = PDVMsgInputlevel;
  3352.   TDvmsg_Inputlevel = TDVMsgInputlevel;
  3353.   PDvmsg_Localhostsetup = PDVMsgLocalHostSetup;
  3354.   TDvmsg_Localhostsetup = TDVMsgLocalHostSetup;
  3355.   PDvmsg_Outputlevel = PDVMsgOutputLevel;
  3356.   TDvmsg_Outputlevel = TDVMsgOutputLevel;
  3357.   PDvmsg_Playeroutputlevel = PDVMsgPlayerOutputLevel;
  3358.   TDvmsg_Playeroutputlevel = TDVMsgPlayerOutputLevel;
  3359.   PDvmsg_Playervoicestart = PDVMsgPlayerVoiceStart;
  3360.   TDvmsg_Playervoicestart = TDVMsgPlayerVoiceStart;
  3361.   PDvmsg_Playervoicestop = PDVMsgPlayerVoiceStop;
  3362.   TDvmsg_Playervoicestop = TDVMsgPlayerVoiceStop;
  3363.   PDvmsg_Recordstart = PDVMsgRecordStart;
  3364.   TDvmsg_Recordstart = TDVMsgRecordStart;
  3365.   PDvmsg_Recordstop = PDVMsgRecordStop;
  3366.   TDvmsg_Recordstop = TDVMsgRecordStop;
  3367.   PDvmsg_Sessionlost = PDVMsgSessionLost;
  3368.   TDvmsg_Sessionlost = TDVMsgSessionLost;
  3369.   PDvmsg_Settargets = PDVMsgSetTargets;
  3370.   TDvmsg_Settargets = TDVMsgSetTargets;
  3371.  
  3372.   PDPN_Application_Desc = PDPNApplicationDesc;
  3373.   TDPN_Application_Desc = TDPNApplicationDesc;
  3374.   PDPN_Caps = PDPNCaps;
  3375.   TDPN_Caps = TDPNCaps;
  3376.   PDPN_Caps_Ex = PDPNCapsEx;
  3377.   TDPN_Caps_Ex = TDPNCapsEx;
  3378.   PDPN_Connection_Info = PDPNConnectionInfo;
  3379.   TDPN_Connection_Info = TDPNConnectionInfo;
  3380.   PDPN_Group_Info = PDPNGroupInfo;
  3381.   TDPN_Group_Info = TDPNGroupInfo;
  3382.   PDPN_Player_Info = PDPNPlayerInfo;
  3383.   TDPN_Player_Info = TDPNPlayerInfo;
  3384.   PDPN_Security_Credentials = PDPNSecurityCredentials;
  3385.   TDPN_Security_Credentials = TDPNSecurityCredentials;
  3386.   PDPN_Security_Desc = PDPNSecurityDesc;
  3387.   TDPN_Security_Desc = TDPNSecurityDesc;
  3388.   PDPN_Service_Provider_Info = PDPNServiceProviderInfo;
  3389.   TDPN_Service_Provider_Info = TDPNServiceProviderInfo;
  3390.   PDPN_Sp_Caps = PDPNSpCaps;
  3391.   TDPN_Sp_Caps = TDPNSpCaps;
  3392.   PDPNMsg_Add_Player_To_Group = PDPNMsgAddPlayerToGroup;
  3393.   TDPNMsg_Add_Player_To_Group = TDPNMsgAddPlayerToGroup;
  3394.   PDPNMsg_Async_Op_Complete = PDPNMsgAsyncOpComplete;
  3395.   TDPNMsg_Async_Op_Complete = TDPNMsgAsyncOpComplete;
  3396.   PDPNMsg_Client_Info = PDPNMsgClientInfo;
  3397.   TDPNMsg_Client_Info = TDPNMsgClientInfo;
  3398.   PDPNMsg_Connect_Complete = PDPNMsgConnectComplete;
  3399.   TDPNMsg_Connect_Complete = TDPNMsgConnectComplete;
  3400.   PDPNMsg_Create_Group = PDPNMsgCreateGroup;
  3401.   TDPNMsg_Create_Group = TDPNMsgCreateGroup;
  3402.   PDPNMsg_Create_Player = PDPNMsgCreatePlayer;
  3403.   TDPNMsg_Create_Player = TDPNMsgCreatePlayer;
  3404.   PDPNMsg_Destroy_Group = PDPNMsgDestroyGroup;
  3405.   TDPNMsg_Destroy_Group = TDPNMsgDestroyGroup;
  3406.   PDPNMsg_Destroy_Player = PDPNMsgDestroyPlayer;
  3407.   TDPNMsg_Destroy_Player = TDPNMsgDestroyPlayer;
  3408.   PDPNMsg_Enum_Hosts_Query = PDPNMsgEnumHostsQuery;
  3409.   TDPNMsg_Enum_Hosts_Query = TDPNMsgEnumHostsQuery;
  3410.   PDPNMsg_Enum_Hosts_Response = PDPNMsgEnumHostsResponse;
  3411.   TDPNMsg_Enum_Hosts_Response = TDPNMsgEnumHostsResponse;
  3412.   PDPNMsg_Group_Info = PDPNMsgGroupInfo;
  3413.   TDPNMsg_Group_Info = TDPNMsgGroupInfo;
  3414.   PDPNMsg_Host_Migrate = PDPNMsgHostMigrate;
  3415.   TDPNMsg_Host_Migrate = TDPNMsgHostMigrate;
  3416.   PDPNMsg_Indicate_Connect = PDPNMsgIndicateConnect;
  3417.   TDPNMsg_Indicate_Connect = TDPNMsgIndicateConnect;
  3418.   PDPNMsg_Indicated_Connect_Aborted = PDPNMsgIndicatedConnectAborted;
  3419.   TDPNMsg_Indicated_Connect_Aborted = TDPNMsgIndicatedConnectAborted;
  3420.   PDPNMsg_Peer_Info = PDPNMsgPeerInfo;
  3421.   TDPNMsg_Peer_Info = TDPNMsgPeerInfo;
  3422.   PDPNMsg_Receive = PDPNMsgReceive;
  3423.   TDPNMsg_Receive = TDPNMsgReceive;
  3424.   PDPNMsg_Remove_Player_From_Group = PDPNMsgRemovePlayerFromGroup;
  3425.   TDPNMsg_Remove_Player_From_Group = TDPNMsgRemovePlayerFromGroup;
  3426.   PDPNMsg_Return_Buffer = PDPNMsgReturnBuffer;
  3427.   TDPNMsg_Return_Buffer = TDPNMsgReturnBuffer;
  3428.   PDPNMsg_Send_Complete = PDPNMsgSendComplete;
  3429.   TDPNMsg_Send_Complete = TDPNMsgSendComplete;
  3430.   PDPNMsg_Server_Info = PDPNMsgServerInfo;
  3431.   TDPNMsg_Server_Info = TDPNMsgServerInfo;
  3432.   PDPNMsg_Terminate_Session = PDPNMsgTerminateSession;
  3433.   TDPNMsg_Terminate_Session = TDPNMsgTerminateSession;
  3434.   PDPNMsg_Create_Thread = PDPNMsgCreateThread;
  3435.   TDPNMsg_Create_Thread = TDPNMsgCreateThread;
  3436.   PDPNMsg_Destroy_Thread = PDPNMsgDestroyThread;
  3437.   TDPNMsg_Destroy_Thread = TDPNMsgDestroyThread;
  3438.   PDPNMsg_Nat_Resolver_Query = PDPNMsgNatResolverQuery;
  3439.   TDPNMsg_Nat_Resolver_Query = TDPNMsgNatResolverQuery;
  3440.  
  3441.  
  3442. implementation
  3443.  
  3444. // #define MAKE_DPNHRESULT( code )  MAKE_HRESULT( 1, _DPN_FACILITY_CODE, ( code + _DPNHRESULT_BASE ) )
  3445. function MAKE_DPNHRESULT(Code: DWORD): DWORD;
  3446. begin
  3447.   Result:= DWord((1 shl 31) or (_DPN_FACILITY_CODE shl 16)) or (Code + _DPNHRESULT_BASE);
  3448. end;
  3449.  
  3450. end.
  3451.  
  3452.