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

Delphi控件源码

开发平台:

Delphi

  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. {$I DirectX.inc}
  43. unit DirectPlay8;
  44. interface
  45. (*$HPPEMIT '#include "dplay8.h"' *)
  46. (*$HPPEMIT '#include "dplobby8.h"' *)
  47. (*$HPPEMIT '#include "dvoice.h"' *)
  48. uses
  49.   Windows, WinSock, DirectSound;
  50. (*==========================================================================;
  51.  *
  52.  *  Copyright (C) 2000-2002 Microsoft Corporation.  All Rights Reserved.
  53.  *
  54.  *  File:       dpaddr.h
  55.  *  Content:   DirectPlayAddress include file
  56.  ***************************************************************************)
  57. const
  58. (****************************************************************************
  59.  *
  60.  * DirectPlay8Address CLSIDs
  61.  *
  62.  ****************************************************************************)
  63.   // {934A9523-A3CA-4bc5-ADA0-D6D95D979421}
  64.   CLSID_DirectPlay8Address: TGUID = '{934a9523-a3ca-4bc5-ada0-d6d95d979421}';
  65.   {$EXTERNALSYM CLSID_DirectPlay8Address}
  66.   
  67. (****************************************************************************
  68.  *
  69.  * DirectPlay8Address Interface IIDs
  70.  *
  71.  ****************************************************************************)
  72. type
  73.   DPNAREFIID = TGUID;
  74.   {$EXTERNALSYM DPNAREFIID}
  75.   TDPNARefIID = DPNAREFIID;
  76. (****************************************************************************
  77.  *
  78.  * DirectPlay8Address Constants
  79.  *
  80.  ****************************************************************************)
  81. const
  82.   //
  83.   // Asynchronous operation flags
  84.   //
  85.   DPNA_DATATYPE_STRING        = $00000001;
  86.   {$EXTERNALSYM DPNA_DATATYPE_STRING}
  87.   DPNA_DATATYPE_DWORD         = $00000002;
  88.   {$EXTERNALSYM DPNA_DATATYPE_DWORD}
  89.   DPNA_DATATYPE_GUID          = $00000003;
  90.   {$EXTERNALSYM DPNA_DATATYPE_GUID}
  91.   DPNA_DATATYPE_BINARY        = $00000004;
  92.   {$EXTERNALSYM DPNA_DATATYPE_BINARY}
  93.   DPNA_DATATYPE_STRING_ANSI   = $00000005;
  94.   {$EXTERNALSYM DPNA_DATATYPE_STRING_ANSI}
  95.   DPNA_DPNSVR_PORT            = 6073;
  96.   {$EXTERNALSYM DPNA_DPNSVR_PORT}
  97.   DPNA_INDEX_INVALID          = $FFFFFFFF;
  98.   {$EXTERNALSYM DPNA_INDEX_INVALID}
  99. (****************************************************************************
  100.  *
  101.  * DirectPlay8Address Address Elements
  102.  *
  103.  ****************************************************************************)
  104.   DPNA_SEPARATOR_KEYVALUE       = WideChar('=');
  105.   {$EXTERNALSYM DPNA_SEPARATOR_KEYVALUE}
  106.   DPNA_SEPARATOR_USERDATA       = WideChar('#');
  107.   {$EXTERNALSYM DPNA_SEPARATOR_USERDATA}
  108.   DPNA_SEPARATOR_COMPONENT      = WideChar(';');
  109.   {$EXTERNALSYM DPNA_SEPARATOR_COMPONENT}
  110.   DPNA_ESCAPECHAR               = WideChar('%');
  111.   {$EXTERNALSYM DPNA_ESCAPECHAR}
  112.   // Header
  113.   DPNA_HEADER                     = 'x-directplay:/';
  114.   {$EXTERNALSYM DPNA_HEADER}
  115.   // key names for address components
  116.   DPNA_KEY_NAT_RESOLVER     = 'natresolver';
  117.   {$EXTERNALSYM DPNA_KEY_NAT_RESOLVER}
  118.   DPNA_KEY_NAT_RESOLVER_USER_STRING = 'natresolveruserstring';
  119.   {$EXTERNALSYM DPNA_KEY_NAT_RESOLVER_USER_STRING}
  120.   DPNA_KEY_APPLICATION_INSTANCE = 'applicationinstance';
  121.   {$EXTERNALSYM DPNA_KEY_APPLICATION_INSTANCE}
  122.   DPNA_KEY_DEVICE           = 'device';
  123.   {$EXTERNALSYM DPNA_KEY_DEVICE}
  124.   DPNA_KEY_HOSTNAME         = 'hostname';
  125.   {$EXTERNALSYM DPNA_KEY_HOSTNAME}
  126.   DPNA_KEY_PORT             = 'port';
  127.   {$EXTERNALSYM DPNA_KEY_PORT}
  128.   DPNA_KEY_NAMEINFO         = 'nameinfo';
  129.   {$EXTERNALSYM DPNA_KEY_NAMEINFO}
  130.   DPNA_KEY_PROCESSOR        = 'processor';
  131.   {$EXTERNALSYM DPNA_KEY_PROCESSOR}
  132.   DPNA_KEY_PROGRAM          = 'program';
  133.   {$EXTERNALSYM DPNA_KEY_PROGRAM}
  134.   DPNA_KEY_PROVIDER         = 'provider';
  135.   {$EXTERNALSYM DPNA_KEY_PROVIDER}
  136.   DPNA_KEY_SCOPE            = 'scope';
  137.   {$EXTERNALSYM DPNA_KEY_SCOPE}
  138.   DPNA_KEY_TRAVERSALMODE    = 'traversalmode';
  139.   {$EXTERNALSYM DPNA_KEY_TRAVERSALMODE}
  140.   DPNA_KEY_BAUD             = 'baud';
  141.   {$EXTERNALSYM DPNA_KEY_BAUD}
  142.   DPNA_KEY_FLOWCONTROL      = 'flowcontrol';
  143.   {$EXTERNALSYM DPNA_KEY_FLOWCONTROL}
  144.   DPNA_KEY_PARITY           = 'parity';
  145.   {$EXTERNALSYM DPNA_KEY_PARITY}
  146.   DPNA_KEY_PHONENUMBER      = 'phonenumber';
  147.   {$EXTERNALSYM DPNA_KEY_PHONENUMBER}
  148.   DPNA_KEY_STOPBITS         = 'stopbits';
  149.   {$EXTERNALSYM DPNA_KEY_STOPBITS}
  150.   // values for baud rate
  151.   DPNA_BAUD_RATE_9600         = 9600;
  152.   {$EXTERNALSYM DPNA_BAUD_RATE_9600}
  153.   DPNA_BAUD_RATE_14400        = 14400;
  154.   {$EXTERNALSYM DPNA_BAUD_RATE_14400}
  155.   DPNA_BAUD_RATE_19200        = 19200;
  156.   {$EXTERNALSYM DPNA_BAUD_RATE_19200}
  157.   DPNA_BAUD_RATE_38400        = 38400;
  158.   {$EXTERNALSYM DPNA_BAUD_RATE_38400}
  159.   DPNA_BAUD_RATE_56000        = 56000;
  160.   {$EXTERNALSYM DPNA_BAUD_RATE_56000}
  161.   DPNA_BAUD_RATE_57600        = 57600;
  162.   {$EXTERNALSYM DPNA_BAUD_RATE_57600}
  163.   DPNA_BAUD_RATE_115200       = 115200;
  164.   {$EXTERNALSYM DPNA_BAUD_RATE_115200}
  165.   // values for stop bits
  166.   DPNA_STOP_BITS_ONE          = '1';
  167.   {$EXTERNALSYM DPNA_STOP_BITS_ONE}
  168.   DPNA_STOP_BITS_ONE_FIVE     = '1.5';
  169.   {$EXTERNALSYM DPNA_STOP_BITS_ONE_FIVE}
  170.   DPNA_STOP_BITS_TWO          = '2';
  171.   {$EXTERNALSYM DPNA_STOP_BITS_TWO}
  172.   // values for parity
  173.   DPNA_PARITY_NONE = 'NONE';
  174.   {$EXTERNALSYM DPNA_PARITY_NONE}
  175.   DPNA_PARITY_EVEN = 'EVEN';
  176.   {$EXTERNALSYM DPNA_PARITY_EVEN}
  177.   DPNA_PARITY_ODD = 'ODD';
  178.   {$EXTERNALSYM DPNA_PARITY_ODD}
  179.   DPNA_PARITY_MARK = 'MARK';
  180.   {$EXTERNALSYM DPNA_PARITY_MARK}
  181.   DPNA_PARITY_SPACE = 'SPACE';
  182.   {$EXTERNALSYM DPNA_PARITY_SPACE}
  183.   // values for flow control
  184.   DPNA_FLOW_CONTROL_NONE = 'NONE';
  185.   {$EXTERNALSYM DPNA_FLOW_CONTROL_NONE}
  186.   DPNA_FLOW_CONTROL_XONXOFF = 'XONXOFF';
  187.   {$EXTERNALSYM DPNA_FLOW_CONTROL_XONXOFF}
  188.   DPNA_FLOW_CONTROL_RTS = 'RTS';
  189.   {$EXTERNALSYM DPNA_FLOW_CONTROL_RTS}
  190.   DPNA_FLOW_CONTROL_DTR = 'DTR';
  191.   {$EXTERNALSYM DPNA_FLOW_CONTROL_DTR}
  192.   DPNA_FLOW_CONTROL_RTSDTR = 'RTSDTR';
  193.   {$EXTERNALSYM DPNA_FLOW_CONTROL_RTSDTR}
  194.   // values for traversal mode
  195.   DPNA_TRAVERSALMODE_NONE             = 0;
  196.   {$EXTERNALSYM DPNA_TRAVERSALMODE_NONE}
  197.   DPNA_TRAVERSALMODE_PORTREQUIRED     = 1;
  198.   {$EXTERNALSYM DPNA_TRAVERSALMODE_PORTREQUIRED}
  199.   DPNA_TRAVERSALMODE_PORTRECOMMENDED  = 2;
  200.   {$EXTERNALSYM DPNA_TRAVERSALMODE_PORTRECOMMENDED}
  201.   // Shortcut values
  202.   //
  203.   // These can be used instead of the corresponding CLSID_DP8SP_XXXX guids
  204.   //
  205.   DPNA_VALUE_TCPIPPROVIDER            = 'IP';
  206.   {$EXTERNALSYM DPNA_VALUE_TCPIPPROVIDER}
  207.   DPNA_VALUE_IPXPROVIDER              = 'IPX';
  208.   {$EXTERNALSYM DPNA_VALUE_IPXPROVIDER}
  209.   DPNA_VALUE_MODEMPROVIDER            = 'MODEM';
  210.   {$EXTERNALSYM DPNA_VALUE_MODEMPROVIDER}
  211.   DPNA_VALUE_SERIALPROVIDER           = 'SERIAL';
  212.   {$EXTERNALSYM DPNA_VALUE_SERIALPROVIDER}
  213. //// ANSI DEFINITIONS
  214.   // Header
  215.   DPNA_HEADER_A       = 'x-directplay:/';
  216.   {$EXTERNALSYM DPNA_HEADER_A}
  217.   DPNA_SEPARATOR_KEYVALUE_A = '=';
  218.   {$EXTERNALSYM DPNA_SEPARATOR_KEYVALUE_A}
  219.   DPNA_SEPARATOR_USERDATA_A = '#';
  220.   {$EXTERNALSYM DPNA_SEPARATOR_USERDATA_A}
  221.   DPNA_SEPARATOR_COMPONENT_A = ';';
  222.   {$EXTERNALSYM DPNA_SEPARATOR_COMPONENT_A}
  223.   DPNA_ESCAPECHAR_A     = '%';
  224.   {$EXTERNALSYM DPNA_ESCAPECHAR_A}
  225.   // key names for address components
  226.   DPNA_KEY_NAT_RESOLVER_A = 'natresolver';
  227.   {$EXTERNALSYM DPNA_KEY_NAT_RESOLVER_A}
  228.   DPNA_KEY_NAT_RESOLVER_USER_STRING_A = 'natresolveruserstring';
  229.   {$EXTERNALSYM DPNA_KEY_NAT_RESOLVER_USER_STRING_A}
  230.   DPNA_KEY_APPLICATION_INSTANCE_A = 'applicationinstance';
  231.   {$EXTERNALSYM DPNA_KEY_APPLICATION_INSTANCE_A}
  232.   DPNA_KEY_DEVICE_A = 'device';
  233.   {$EXTERNALSYM DPNA_KEY_DEVICE_A}
  234.   DPNA_KEY_HOSTNAME_A = 'hostname';
  235.   {$EXTERNALSYM DPNA_KEY_HOSTNAME_A}
  236.   DPNA_KEY_PORT_A = 'port';
  237.   {$EXTERNALSYM DPNA_KEY_PORT_A}
  238.   DPNA_KEY_NAMEINFO_A = 'nameinfo';
  239.   {$EXTERNALSYM DPNA_KEY_NAMEINFO_A}
  240.   DPNA_KEY_PROCESSOR_A = 'processor';
  241.   {$EXTERNALSYM DPNA_KEY_PROCESSOR_A}
  242.   DPNA_KEY_PROGRAM_A = 'program';
  243.   {$EXTERNALSYM DPNA_KEY_PROGRAM_A}
  244.   DPNA_KEY_PROVIDER_A = 'provider';
  245.   {$EXTERNALSYM DPNA_KEY_PROVIDER_A}
  246.   DPNA_KEY_SCOPE_A = 'scope';
  247.   {$EXTERNALSYM DPNA_KEY_SCOPE_A}
  248.   DPNA_KEY_TRAVERSALMODE_A = 'traversalmode';
  249.   {$EXTERNALSYM DPNA_KEY_TRAVERSALMODE_A}
  250.   DPNA_KEY_BAUD_A = 'baud';
  251.   {$EXTERNALSYM DPNA_KEY_BAUD_A}
  252.   DPNA_KEY_FLOWCONTROL_A = 'flowcontrol';
  253.   {$EXTERNALSYM DPNA_KEY_FLOWCONTROL_A}
  254.   DPNA_KEY_PARITY_A = 'parity';
  255.   {$EXTERNALSYM DPNA_KEY_PARITY_A}
  256.   DPNA_KEY_PHONENUMBER_A = 'phonenumber';
  257.   {$EXTERNALSYM DPNA_KEY_PHONENUMBER_A}
  258.   DPNA_KEY_STOPBITS_A = 'stopbits';
  259.   {$EXTERNALSYM DPNA_KEY_STOPBITS_A}
  260.   // values for stop bits
  261.   DPNA_STOP_BITS_ONE_A = '1';
  262.   {$EXTERNALSYM DPNA_STOP_BITS_ONE_A}
  263.   DPNA_STOP_BITS_ONE_FIVE_A = '1.5';
  264.   {$EXTERNALSYM DPNA_STOP_BITS_ONE_FIVE_A}
  265.   DPNA_STOP_BITS_TWO_A = '2';
  266.   {$EXTERNALSYM DPNA_STOP_BITS_TWO_A}
  267.   // values for parity
  268.   DPNA_PARITY_NONE_A = 'NONE';
  269.   {$EXTERNALSYM DPNA_PARITY_NONE_A}
  270.   DPNA_PARITY_EVEN_A = 'EVEN';
  271.   {$EXTERNALSYM DPNA_PARITY_EVEN_A}
  272.   DPNA_PARITY_ODD_A           = 'ODD';
  273.   {$EXTERNALSYM DPNA_PARITY_ODD_A}
  274.   DPNA_PARITY_MARK_A = 'MARK';
  275.   {$EXTERNALSYM DPNA_PARITY_MARK_A}
  276.   DPNA_PARITY_SPACE_A = 'SPACE';
  277.   {$EXTERNALSYM DPNA_PARITY_SPACE_A}
  278.   // values for flow control
  279.   DPNA_FLOW_CONTROL_NONE_A = 'NONE';
  280.   {$EXTERNALSYM DPNA_FLOW_CONTROL_NONE_A}
  281.   DPNA_FLOW_CONTROL_XONXOFF_A   = 'XONXOFF';
  282.   {$EXTERNALSYM DPNA_FLOW_CONTROL_XONXOFF_A}
  283.   DPNA_FLOW_CONTROL_RTS_A = 'RTS';
  284.   {$EXTERNALSYM DPNA_FLOW_CONTROL_RTS_A}
  285.   DPNA_FLOW_CONTROL_DTR_A = 'DTR';
  286.   {$EXTERNALSYM DPNA_FLOW_CONTROL_DTR_A}
  287.   DPNA_FLOW_CONTROL_RTSDTR_A = 'RTSDTR';
  288.   {$EXTERNALSYM DPNA_FLOW_CONTROL_RTSDTR_A}
  289.   // Shortcut values
  290.   //
  291.   // These can be used instead of the corresponding CLSID_DP8SP_XXXX guids
  292.   //
  293.   DPNA_VALUE_TCPIPPROVIDER_A          = 'IP';
  294.   {$EXTERNALSYM DPNA_VALUE_TCPIPPROVIDER_A}
  295.   DPNA_VALUE_IPXPROVIDER_A            = 'IPX';
  296.   {$EXTERNALSYM DPNA_VALUE_IPXPROVIDER_A}
  297.   DPNA_VALUE_MODEMPROVIDER_A          = 'MODEM';
  298.   {$EXTERNALSYM DPNA_VALUE_MODEMPROVIDER_A}
  299.   DPNA_VALUE_SERIALPROVIDER_A         = 'SERIAL';
  300.   {$EXTERNALSYM DPNA_VALUE_SERIALPROVIDER_A}
  301. type
  302. (****************************************************************************
  303.  *
  304.  * DirectPlay8Address Forward Declarations For External Types
  305.  *
  306.  ****************************************************************************)
  307.   SOCKADDR = TSockAddr;
  308.   {$EXTERNALSYM SOCKADDR}
  309. (****************************************************************************
  310.  *
  311.  * DirectPlay8Address Functions
  312.  *
  313.  ****************************************************************************)
  314. (*
  315.  *
  316.  * This function is no longer supported.  It is recommended that CoCreateInstance be used to create
  317.  * DirectPlay8 address objects.
  318.  *
  319.  * HRESULT WINAPI DirectPlay8AddressCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown);
  320.  *
  321.  *)
  322. (****************************************************************************
  323.  *
  324.  * DirectPlay8Address Application Interfaces
  325.  *
  326.  ****************************************************************************)
  327.   //
  328.   // COM definition for IDirectPlay8Address Generic Interface
  329.   //
  330.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8Address);'}
  331.   {$EXTERNALSYM IDirectPlay8Address}
  332.   IDirectPlay8Address = interface(IUnknown)
  333.     ['{83783300-4063-4c8a-9db3-82830a7feb31}']
  334.     (*** IDirectPlay8Address methods ***)
  335.     function BuildFromURLW(pwszSourceURL: PWideChar): HResult; stdcall;
  336.     function BuildFromURLA(pszSourceURL: PAnsiChar): HResult; stdcall;
  337.     function Duplicate(out ppdpaNewAddress: IDirectPlay8Address): HResult; stdcall;
  338.     function SetEqual(pdpaAddress: IDirectPlay8Address): HResult; stdcall;
  339.     function IsEqual(pdpaAddress: IDirectPlay8Address): HResult; stdcall;
  340.     function Clear: HResult; stdcall;
  341.     function GetURLW(pwszURL: PWideChar; var pdwNumChars: DWORD): HResult; stdcall;
  342.     function GetURLA(pszURL: PAnsiChar; var pdwNumChars: DWORD): HResult; stdcall;
  343.     function GetSP(out pguidSP: TGUID): HResult; stdcall;
  344.     function GetUserData(pvUserData: Pointer; var pdwBufferSize: DWORD): HResult; stdcall;
  345.     function SetSP(const pguidSP: TGUID): HResult; stdcall;
  346.     function SetUserData(pvUserData: Pointer; dwDataSize: DWORD): HResult; stdcall;
  347.     function GetNumComponents(out pdwNumComponents: DWORD): HResult; stdcall;
  348.     function GetComponentByName(pwszName: PWideChar; pvBuffer: Pointer; var pdwBufferSize: DWORD; out pdwDataType: DWORD): HResult; stdcall;
  349.     function GetComponentByIndex(dwComponentID: DWORD; pwszName: PWideChar; var pdwNameLen: DWORD; pvBuffer: Pointer; var pdwBufferSize: DWORD; out pdwDataType: DWORD): HResult; stdcall;
  350.     function AddComponent(pwszName: PWideChar; lpvData: Pointer; dwDataSize, dwDataType: DWORD): HResult; stdcall;
  351.     function GetDevice(out pguidDevice: TGUID): HResult; stdcall;
  352.     function SetDevice(const pguidDevice: TGUID): HResult; stdcall;
  353.     function BuildFromDPADDRESS(pvAddress: Pointer; dwDataSize: DWORD): HResult; stdcall;
  354.   end;
  355.   {$NODEFINE PIDirectPlay8Address}
  356.   {$HPPEMIT 'typedef _di_IDirectPlay8Address *PIDirectPlay8Address;'}
  357.   PIDirectPlay8Address = ^IDirectPlay8Address;
  358.   //
  359.   // COM definition for IDirectPlay8AddressIP Generic Interface
  360.   //
  361.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8AddressIP);'}
  362.   {$EXTERNALSYM IDirectPlay8AddressIP}
  363.   IDirectPlay8AddressIP = interface(IUnknown)
  364.     ['{e5a0e990-2bad-430b-87da-a142cf75de58}']
  365.     (*** IDirectPlay8AddressIP methods ***)
  366.     // Constructs a IDirectPlay8 TCP Address from a SOCKADDR structure
  367.     function BuildFromSockAddr(const pSockAddr: TSockAddr): HResult; stdcall;
  368.     // Constructs a TCP Address from a string (hostname) and port
  369.     function BuildAddress(wszAddress: PWideChar; usPort: Word): HResult; stdcall;
  370.     // Builds a local TCP Address
  371.     function BuildLocalAddress(const pguidAdapter: TGUID; usPort: Word): HResult; stdcall;
  372.     // Gets the address from the structure in SOCKADR format
  373.     function GetSockAddress(psockAddress: PSockAddr; var pdwAddressBufferSize: DWORD): HResult; stdcall;
  374.     // Gets the local afddress
  375.     function GetLocalAddress(out pguidAdapter: TGUID; out pusPort: Word): HResult; stdcall;
  376.     // Gets the remote address
  377.     function GetAddress(wszAddress: PWideChar; var pdwAddressLength: DWORD; out psPort: Word): HResult; stdcall;
  378.   end;
  379. (****************************************************************************
  380.  *
  381.  * DirectPlay8Address Interface IIDs
  382.  *
  383.  ****************************************************************************)
  384. type
  385.   // {83783300-4063-4c8a-9DB3-82830A7FEB31}
  386.   IID_IDirectPlay8Address = IDirectPlay8Address;
  387.   {$EXTERNALSYM IID_IDirectPlay8Address}
  388.   // {E5A0E990-2BAD-430b-87DA-A142CF75DE58}
  389.   IID_IDirectPlay8AddressIP = IDirectPlay8AddressIP; 
  390.   {$EXTERNALSYM IID_IDirectPlay8AddressIP}
  391. (*==========================================================================;
  392.  *
  393.  *  Copyright (C) 1998-2002 Microsoft Corporation.  All Rights Reserved.
  394.  *
  395.  *  File:   DPlay8.h
  396.  *  Content: DirectPlay8 include file
  397.  *
  398.  ***************************************************************************)
  399. const
  400. (****************************************************************************
  401.  *
  402.  * DirectPlay8 CLSIDs
  403.  *
  404.  ****************************************************************************)
  405.   // {743F1DC6-5ABA-429f-8BDF-C54D03253DC2}
  406.   CLSID_DirectPlay8Client: TGUID = '{743f1dc6-5aba-429f-8bdf-c54d03253dc2}';
  407.   {$EXTERNALSYM CLSID_DirectPlay8Client}
  408.   // {DA825E1B-6830-43d7-835D-0B5AD82956A2}
  409.   CLSID_DirectPlay8Server: TGUID = '{da825e1b-6830-43d7-835d-0b5ad82956a2}';
  410.   {$EXTERNALSYM CLSID_DirectPlay8Server}
  411.   // {286F484D-375E-4458-A272-B138E2F80A6A}
  412.   CLSID_DirectPlay8Peer: TGUID = '{286f484d-375e-4458-a272-b138e2f80a6a}';
  413.   {$EXTERNALSYM CLSID_DirectPlay8Peer}
  414.   // CLSIDs added for DirectX 9
  415.   // {FC47060E-6153-4b34-B975-8E4121EB7F3C}
  416.   CLSID_DirectPlay8ThreadPool: TGUID = '{fc47060e-6153-4b34-b975-8e4121eb7f3c}';
  417.   {$EXTERNALSYM CLSID_DirectPlay8ThreadPool}
  418.   // {E4C1D9A2-CBF7-48bd-9A69-34A55E0D8941}
  419.   CLSID_DirectPlay8NATResolver: TGUID = '{e4c1d9a2-cbf7-48bd-9a69-34a55e0d8941}';
  420.   {$EXTERNALSYM CLSID_DirectPlay8NATResolver}
  421. (****************************************************************************
  422.  *
  423.  * DirectPlay8 Service Provider GUIDs
  424.  *
  425.  ****************************************************************************)
  426.   // {53934290-628D-11D2-AE0F-006097B01411}
  427.   CLSID_DP8SP_IPX: TGUID = '{53934290-628d-11d2-ae0f-006097b01411}';
  428.   {$EXTERNALSYM CLSID_DP8SP_IPX}
  429.   // {6D4A3650-628D-11D2-AE0F-006097B01411}
  430.   CLSID_DP8SP_MODEM: TGUID = '{6d4a3650-628d-11d2-ae0f-006097b01411}';
  431.   {$EXTERNALSYM CLSID_DP8SP_MODEM}
  432.   // {743B5D60-628D-11D2-AE0F-006097B01411}
  433.   CLSID_DP8SP_SERIAL: TGUID = '{743b5d60-628d-11d2-ae0f-006097b01411}';
  434.   {$EXTERNALSYM CLSID_DP8SP_SERIAL}
  435.   // {EBFE7BA0-628D-11D2-AE0F-006097B01411}
  436.   CLSID_DP8SP_TCPIP: TGUID = '{ebfe7ba0-628d-11d2-ae0f-006097b01411}';
  437.   {$EXTERNALSYM CLSID_DP8SP_TCPIP}
  438.   // Service providers added for DirectX 9
  439.   // {995513AF-3027-4b9a-956E-C772B3F78006}
  440.   CLSID_DP8SP_BLUETOOTH: TGUID = '{995513af-3027-4b9a-956e-c772b3f78006}';
  441.   {$EXTERNALSYM CLSID_DP8SP_BLUETOOTH}
  442. type
  443. (****************************************************************************
  444.  *
  445.  * DirectPlay8 Callback Functions
  446.  *
  447.  ****************************************************************************)
  448.   //
  449.   // Callback Function Type Definition
  450.   //
  451.   TFNDPNMessageHandler = function (pvUserContext: Pointer; dwMessageType: DWORD; pMessage: Pointer): HRESULT; stdcall;
  452.   {$NODEFINE TFNDPNMessageHandler}
  453.   {$HPPEMIT 'typedef PFNDPNMESSAGEHANDLER TFNDPNMessageHandler;'}
  454. (****************************************************************************
  455.  *
  456.  * DirectPlay8 Datatypes (Non-Structure / Non-Message)
  457.  *
  458.  ****************************************************************************)
  459.   //
  460.   // Player IDs.  Used to uniquely identify a player in a session
  461.   //
  462.   PDPNID = ^DPNID;
  463.   {$EXTERNALSYM PDPNID}
  464.   DPNID = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWORD;
  465.   {$EXTERNALSYM DPNID}
  466.   TDPNID = DPNID;
  467.   //
  468.   // Used as identifiers for operations
  469.   //
  470.   PDPNHandle = ^TDPNHandle;
  471.   DPNHANDLE = {$IFDEF TYPE_IDENTITY}type {$ENDIF}DWORD;
  472.   {$EXTERNALSYM DPNHANDLE}
  473.   TDPNHandle = DPNHANDLE;
  474. (****************************************************************************
  475.  *
  476.  * DirectPlay8 Message Identifiers
  477.  *
  478.  ****************************************************************************)
  479. const
  480.   DPN_MSGID_OFFSET                    = $FFFF0000;
  481.   {$EXTERNALSYM DPN_MSGID_OFFSET}
  482.   DPN_MSGID_ADD_PLAYER_TO_GROUP       = (DPN_MSGID_OFFSET or $0001);
  483.   {$EXTERNALSYM DPN_MSGID_ADD_PLAYER_TO_GROUP}
  484.   DPN_MSGID_APPLICATION_DESC          = (DPN_MSGID_OFFSET or $0002);
  485.   {$EXTERNALSYM DPN_MSGID_APPLICATION_DESC}
  486.   DPN_MSGID_ASYNC_OP_COMPLETE         = (DPN_MSGID_OFFSET or $0003);
  487.   {$EXTERNALSYM DPN_MSGID_ASYNC_OP_COMPLETE}
  488.   DPN_MSGID_CLIENT_INFO               = (DPN_MSGID_OFFSET or $0004);
  489.   {$EXTERNALSYM DPN_MSGID_CLIENT_INFO}
  490.   DPN_MSGID_CONNECT_COMPLETE          = (DPN_MSGID_OFFSET or $0005);
  491.   {$EXTERNALSYM DPN_MSGID_CONNECT_COMPLETE}
  492.   DPN_MSGID_CREATE_GROUP              = (DPN_MSGID_OFFSET or $0006);
  493.   {$EXTERNALSYM DPN_MSGID_CREATE_GROUP}
  494.   DPN_MSGID_CREATE_PLAYER             = (DPN_MSGID_OFFSET or $0007);
  495.   {$EXTERNALSYM DPN_MSGID_CREATE_PLAYER}
  496.   DPN_MSGID_DESTROY_GROUP             = (DPN_MSGID_OFFSET or $0008);
  497.   {$EXTERNALSYM DPN_MSGID_DESTROY_GROUP}
  498.   DPN_MSGID_DESTROY_PLAYER            = (DPN_MSGID_OFFSET or $0009);
  499.   {$EXTERNALSYM DPN_MSGID_DESTROY_PLAYER}
  500.   DPN_MSGID_ENUM_HOSTS_QUERY          = (DPN_MSGID_OFFSET or $000a);
  501.   {$EXTERNALSYM DPN_MSGID_ENUM_HOSTS_QUERY}
  502.   DPN_MSGID_ENUM_HOSTS_RESPONSE       = (DPN_MSGID_OFFSET or $000b);
  503.   {$EXTERNALSYM DPN_MSGID_ENUM_HOSTS_RESPONSE}
  504.   DPN_MSGID_GROUP_INFO                = (DPN_MSGID_OFFSET or $000c);
  505.   {$EXTERNALSYM DPN_MSGID_GROUP_INFO}
  506.   DPN_MSGID_HOST_MIGRATE              = (DPN_MSGID_OFFSET or $000d);
  507.   {$EXTERNALSYM DPN_MSGID_HOST_MIGRATE}
  508.   DPN_MSGID_INDICATE_CONNECT          = (DPN_MSGID_OFFSET or $000e);
  509.   {$EXTERNALSYM DPN_MSGID_INDICATE_CONNECT}
  510.   DPN_MSGID_INDICATED_CONNECT_ABORTED = (DPN_MSGID_OFFSET or $000f);
  511.   {$EXTERNALSYM DPN_MSGID_INDICATED_CONNECT_ABORTED}
  512.   DPN_MSGID_PEER_INFO                 = (DPN_MSGID_OFFSET or $0010);
  513.   {$EXTERNALSYM DPN_MSGID_PEER_INFO}
  514.   DPN_MSGID_RECEIVE                   = (DPN_MSGID_OFFSET or $0011);
  515.   {$EXTERNALSYM DPN_MSGID_RECEIVE}
  516.   DPN_MSGID_REMOVE_PLAYER_FROM_GROUP  = (DPN_MSGID_OFFSET or $0012);
  517.   {$EXTERNALSYM DPN_MSGID_REMOVE_PLAYER_FROM_GROUP}
  518.   DPN_MSGID_RETURN_BUFFER             = (DPN_MSGID_OFFSET or $0013);
  519.   {$EXTERNALSYM DPN_MSGID_RETURN_BUFFER}
  520.   DPN_MSGID_SEND_COMPLETE             = (DPN_MSGID_OFFSET or $0014);
  521.   {$EXTERNALSYM DPN_MSGID_SEND_COMPLETE}
  522.   DPN_MSGID_SERVER_INFO               = (DPN_MSGID_OFFSET or $0015);
  523.   {$EXTERNALSYM DPN_MSGID_SERVER_INFO}
  524.   DPN_MSGID_TERMINATE_SESSION         = (DPN_MSGID_OFFSET or $0016);
  525.   {$EXTERNALSYM DPN_MSGID_TERMINATE_SESSION}
  526.   // Messages added for DirectX 9
  527.   DPN_MSGID_CREATE_THREAD             = (DPN_MSGID_OFFSET or $0017);
  528.   {$EXTERNALSYM DPN_MSGID_CREATE_THREAD}
  529.   DPN_MSGID_DESTROY_THREAD            = (DPN_MSGID_OFFSET or $0018);
  530.   {$EXTERNALSYM DPN_MSGID_DESTROY_THREAD}
  531.   DPN_MSGID_NAT_RESOLVER_QUERY        = (DPN_MSGID_OFFSET or $0101);
  532.   {$EXTERNALSYM DPN_MSGID_NAT_RESOLVER_QUERY}
  533. (****************************************************************************
  534.  *
  535.  * DirectPlay8 Constants
  536.  *
  537.  ****************************************************************************)
  538.   DPNID_ALL_PLAYERS_GROUP                 = 0;
  539.   {$EXTERNALSYM DPNID_ALL_PLAYERS_GROUP}
  540.   //
  541.   // DESTROY_GROUP reasons
  542.   //
  543.   DPNDESTROYGROUPREASON_NORMAL            = $0001;
  544.   {$EXTERNALSYM DPNDESTROYGROUPREASON_NORMAL}
  545.   DPNDESTROYGROUPREASON_AUTODESTRUCTED    = $0002;
  546.   {$EXTERNALSYM DPNDESTROYGROUPREASON_AUTODESTRUCTED}
  547.   DPNDESTROYGROUPREASON_SESSIONTERMINATED = $0003;
  548.   {$EXTERNALSYM DPNDESTROYGROUPREASON_SESSIONTERMINATED}
  549.   //
  550.   // DESTROY_PLAYER reasons
  551.   //
  552.   DPNDESTROYPLAYERREASON_NORMAL              = $0001;
  553.   {$EXTERNALSYM DPNDESTROYPLAYERREASON_NORMAL}
  554.   DPNDESTROYPLAYERREASON_CONNECTIONLOST      = $0002;
  555.   {$EXTERNALSYM DPNDESTROYPLAYERREASON_CONNECTIONLOST}
  556.   DPNDESTROYPLAYERREASON_SESSIONTERMINATED   = $0003;
  557.   {$EXTERNALSYM DPNDESTROYPLAYERREASON_SESSIONTERMINATED}
  558.   DPNDESTROYPLAYERREASON_HOSTDESTROYEDPLAYER = $0004;
  559.   {$EXTERNALSYM DPNDESTROYPLAYERREASON_HOSTDESTROYEDPLAYER}
  560.   DPN_MAX_APPDESC_RESERVEDDATA_SIZE          = 64;
  561.   {$EXTERNALSYM DPN_MAX_APPDESC_RESERVEDDATA_SIZE}
  562. (****************************************************************************
  563.  *
  564.  * DirectPlay8 Flags
  565.  *
  566.  ****************************************************************************)
  567.   //
  568.   // Asynchronous operation flags (For Async Ops)
  569.   //
  570.   DPNOP_SYNC                   = $80000000;
  571.   {$EXTERNALSYM DPNOP_SYNC}
  572.   //
  573.   // Add player to group flags (For AddPlayerToGroup)
  574.   //
  575.   DPNADDPLAYERTOGROUP_SYNC     = DPNOP_SYNC;
  576.   {$EXTERNALSYM DPNADDPLAYERTOGROUP_SYNC}
  577.   //
  578.   // Cancel flags
  579.   //
  580.   DPNCANCEL_CONNECT           = $0001;
  581.   {$EXTERNALSYM DPNCANCEL_CONNECT}
  582.   DPNCANCEL_ENUM              = $0002;
  583.   {$EXTERNALSYM DPNCANCEL_ENUM}
  584.   DPNCANCEL_SEND              = $0004;
  585.   {$EXTERNALSYM DPNCANCEL_SEND}
  586.   DPNCANCEL_ALL_OPERATIONS    = $8000;
  587.   {$EXTERNALSYM DPNCANCEL_ALL_OPERATIONS}
  588.   // Flags added for DirectX 9
  589.   DPNCANCEL_PLAYER_SENDS = $80000000;
  590.   {$EXTERNALSYM DPNCANCEL_PLAYER_SENDS}
  591.   DPNCANCEL_PLAYER_SENDS_PRIORITY_HIGH = (DPNCANCEL_PLAYER_SENDS or $00010000);
  592.   {$EXTERNALSYM DPNCANCEL_PLAYER_SENDS_PRIORITY_HIGH}
  593.   DPNCANCEL_PLAYER_SENDS_PRIORITY_NORMAL = (DPNCANCEL_PLAYER_SENDS or $00020000);
  594.   {$EXTERNALSYM DPNCANCEL_PLAYER_SENDS_PRIORITY_NORMAL}
  595.   DPNCANCEL_PLAYER_SENDS_PRIORITY_LOW = (DPNCANCEL_PLAYER_SENDS or $00040000);
  596.   {$EXTERNALSYM DPNCANCEL_PLAYER_SENDS_PRIORITY_LOW}
  597.   //
  598.   // Close flags (for Close, added for DirectX 9)
  599.   //
  600.   DPNCLOSE_IMMEDIATE = $00000001;
  601.   {$EXTERNALSYM DPNCLOSE_IMMEDIATE}
  602.   //
  603.   // Connect flags (For Connect)
  604.   //
  605.   DPNCONNECT_SYNC              = DPNOP_SYNC;
  606.   {$EXTERNALSYM DPNCONNECT_SYNC}
  607.   DPNCONNECT_OKTOQUERYFORADDRESSING = $0001;
  608.   {$EXTERNALSYM DPNCONNECT_OKTOQUERYFORADDRESSING}
  609.   //
  610.   // Create group flags (For CreateGroup)
  611.   //
  612.   DPNCREATEGROUP_SYNC          = DPNOP_SYNC;
  613.   {$EXTERNALSYM DPNCREATEGROUP_SYNC}
  614.   //
  615.   // Destroy group flags (For DestroyGroup)
  616.   //
  617.   DPNDESTROYGROUP_SYNC         = DPNOP_SYNC;
  618.   {$EXTERNALSYM DPNDESTROYGROUP_SYNC}
  619.   //
  620.   // Enumerate clients and groups flags (For EnumPlayersAndGroups)
  621.   //
  622.   DPNENUM_PLAYERS              = $0001;
  623.   {$EXTERNALSYM DPNENUM_PLAYERS}
  624.   DPNENUM_GROUPS               = $0010;
  625.   {$EXTERNALSYM DPNENUM_GROUPS}
  626.   //
  627.   // Enum hosts flags (For EnumHosts)
  628.   //
  629.   DPNENUMHOSTS_SYNC                   = DPNOP_SYNC;
  630.   {$EXTERNALSYM DPNENUMHOSTS_SYNC}
  631.   DPNENUMHOSTS_OKTOQUERYFORADDRESSING = $0001;
  632.   {$EXTERNALSYM DPNENUMHOSTS_OKTOQUERYFORADDRESSING}
  633.   DPNENUMHOSTS_NOBROADCASTFALLBACK    = $0002;
  634.   {$EXTERNALSYM DPNENUMHOSTS_NOBROADCASTFALLBACK}
  635.   //
  636.   // Enum service provider flags (For EnumSP)
  637.   //
  638.   DPNENUMSERVICEPROVIDERS_ALL         = $0001;
  639.   {$EXTERNALSYM DPNENUMSERVICEPROVIDERS_ALL}
  640.   //
  641.   // GetLocalHostAddresses flags (added for DirectX 9)
  642.   //
  643.   DPNGETLOCALHOSTADDRESSES_COMBINED   = $0001;
  644.   {$EXTERNALSYM DPNGETLOCALHOSTADDRESSES_COMBINED}
  645.   //
  646.   // Get send queue info flags (For GetSendQueueInfo)
  647.   //
  648.   DPNGETSENDQUEUEINFO_PRIORITY_NORMAL = $0001;
  649.   {$EXTERNALSYM DPNGETSENDQUEUEINFO_PRIORITY_NORMAL}
  650.   DPNGETSENDQUEUEINFO_PRIORITY_HIGH   = $0002;
  651.   {$EXTERNALSYM DPNGETSENDQUEUEINFO_PRIORITY_HIGH}
  652.   DPNGETSENDQUEUEINFO_PRIORITY_LOW    = $0004;
  653.   {$EXTERNALSYM DPNGETSENDQUEUEINFO_PRIORITY_LOW}
  654.   //
  655.   // Group information flags (For Group Info)
  656.   //
  657.   DPNGROUP_AUTODESTRUCT               = $0001;
  658.   {$EXTERNALSYM DPNGROUP_AUTODESTRUCT}
  659.   //
  660.   // Host flags (For Host)
  661.   //
  662.   DPNHOST_OKTOQUERYFORADDRESSING      = $0001;
  663.   {$EXTERNALSYM DPNHOST_OKTOQUERYFORADDRESSING}
  664.   //
  665.   // Set info
  666.   //
  667.   DPNINFO_NAME                        = $0001;
  668.   {$EXTERNALSYM DPNINFO_NAME}
  669.   DPNINFO_DATA                        = $0002;
  670.   {$EXTERNALSYM DPNINFO_DATA}
  671.   //
  672.   // Initialize flags (For Initialize)
  673.   //
  674.   DPNINITIALIZE_DISABLEPARAMVAL       = $0001;
  675.   {$EXTERNALSYM DPNINITIALIZE_DISABLEPARAMVAL}
  676.   // Flags added for DirectX 9
  677.   DPNINITIALIZE_HINT_LANSESSION       = $0002;
  678.   {$EXTERNALSYM DPNINITIALIZE_HINT_LANSESSION}
  679.   DPNINITIALIZE_DISABLELINKTUNING     = $0004;
  680.   {$EXTERNALSYM DPNINITIALIZE_DISABLELINKTUNING}
  681.   //
  682.   // Register Lobby flags
  683.   //
  684.   DPNLOBBY_REGISTER                   = $0001;
  685.   {$EXTERNALSYM DPNLOBBY_REGISTER}
  686.   DPNLOBBY_UNREGISTER                 = $0002;
  687.   {$EXTERNALSYM DPNLOBBY_UNREGISTER}
  688.   //
  689.   // Player information flags (For Player Info / Player Messages)
  690.   //
  691.   DPNPLAYER_LOCAL       = $0002;
  692.   {$EXTERNALSYM DPNPLAYER_LOCAL}
  693.   DPNPLAYER_HOST        = $0004;
  694.   {$EXTERNALSYM DPNPLAYER_HOST}
  695.   //
  696.   // Receive indication flags (added for DirectX 9)
  697.   //
  698.   DPNRECEIVE_GUARANTEED       = $0001;
  699.   {$EXTERNALSYM DPNRECEIVE_GUARANTEED}
  700.   DPNRECEIVE_COALESCED        = $0002;
  701.   {$EXTERNALSYM DPNRECEIVE_COALESCED}
  702.   //
  703.   // Remove player from group flags (For RemovePlayerFromGroup)
  704.   //
  705.   DPNREMOVEPLAYERFROMGROUP_SYN = DPNOP_SYNC;
  706.   {$EXTERNALSYM DPNREMOVEPLAYERFROMGROUP_SYN}
  707.   //
  708.   // Send flags (For Send/SendTo)
  709.   //
  710.   DPNSEND_SYNC                = DPNOP_SYNC;
  711.   {$EXTERNALSYM DPNSEND_SYNC}
  712.   DPNSEND_NOCOPY              = $0001;
  713.   {$EXTERNALSYM DPNSEND_NOCOPY}
  714.   DPNSEND_NOCOMPLETE          = $0002;
  715.   {$EXTERNALSYM DPNSEND_NOCOMPLETE}
  716.   DPNSEND_COMPLETEONPROCESS   = $0004;
  717.   {$EXTERNALSYM DPNSEND_COMPLETEONPROCESS}
  718.   DPNSEND_GUARANTEED          = $0008;
  719.   {$EXTERNALSYM DPNSEND_GUARANTEED}
  720.   DPNSEND_NONSEQUENTIAL       = $0010;
  721.   {$EXTERNALSYM DPNSEND_NONSEQUENTIAL}
  722.   DPNSEND_NOLOOPBACK          = $0020;
  723.   {$EXTERNALSYM DPNSEND_NOLOOPBACK}
  724.   DPNSEND_PRIORITY_LOW        = $0040;
  725.   {$EXTERNALSYM DPNSEND_PRIORITY_LOW}
  726.   DPNSEND_PRIORITY_HIGH       = $0080;
  727.   {$EXTERNALSYM DPNSEND_PRIORITY_HIGH}
  728.   // Flag added for DirectX 9
  729.   DPNSEND_COALESCE = $0100;
  730.   {$EXTERNALSYM DPNSEND_COALESCE}
  731.   //
  732.   // Send complete indication flags (added for DirectX 9)
  733.   //
  734.   DPNSENDCOMPLETE_GUARANTEED = $0001;
  735.   {$EXTERNALSYM DPNSENDCOMPLETE_GUARANTEED}
  736.   DPNSENDCOMPLETE_COALESCED = $0002;
  737.   {$EXTERNALSYM DPNSENDCOMPLETE_COALESCED}
  738.   //
  739.   // Session Flags (for DPN_APPLICATION_DESC)
  740.   //
  741.   DPNSESSION_CLIENT_SERVER    = $0001;
  742.   {$EXTERNALSYM DPNSESSION_CLIENT_SERVER}
  743.   DPNSESSION_MIGRATE_HOST     = $0004;
  744.   {$EXTERNALSYM DPNSESSION_MIGRATE_HOST}
  745.   DPNSESSION_NODPNSVR         = $0040;
  746.   {$EXTERNALSYM DPNSESSION_NODPNSVR}
  747.   DPNSESSION_REQUIREPASSWORD  = $0080;
  748.   {$EXTERNALSYM DPNSESSION_REQUIREPASSWORD}
  749.   // Flag added for DirectX 9
  750.   DPNSESSION_NOENUMS = $0100;
  751.   {$EXTERNALSYM DPNSESSION_NOENUMS}
  752.   DPNSESSION_FAST_SIGNED = $0200;
  753.   {$EXTERNALSYM DPNSESSION_FAST_SIGNED}
  754.   DPNSESSION_FULL_SIGNED = $0400;
  755.   {$EXTERNALSYM DPNSESSION_FULL_SIGNED}
  756.   //
  757.   // Set client info flags (For SetClientInfo)
  758.   //
  759.   DPNSETCLIENTINFO_SYNC       = DPNOP_SYNC;
  760.   {$EXTERNALSYM DPNSETCLIENTINFO_SYNC}
  761.   //
  762.   // Set group info flags (For SetGroupInfo)
  763.   //
  764.   DPNSETGROUPINFO_SYNC        = DPNOP_SYNC;
  765.   {$EXTERNALSYM DPNSETGROUPINFO_SYNC}
  766.   //
  767.   // Set peer info flags (For SetPeerInfo)
  768.   //
  769.   DPNSETPEERINFO_SYNC         = DPNOP_SYNC;
  770.   {$EXTERNALSYM DPNSETPEERINFO_SYNC}
  771.   //
  772.   // Set server info flags (For SetServerInfo)
  773.   //
  774.   DPNSETSERVERINFO_SYNC       = DPNOP_SYNC;
  775.   {$EXTERNALSYM DPNSETSERVERINFO_SYNC}
  776.   //
  777.   // SP capabilities flags
  778.   //
  779.   DPNSPCAPS_SUPPORTSDPNSVR      = $0001;
  780.   {$EXTERNALSYM DPNSPCAPS_SUPPORTSDPNSVR}
  781.   DPNSPCAPS_SUPPORTSDPNSRV      = DPNSPCAPS_SUPPORTSDPNSVR;
  782.   {$EXTERNALSYM DPNSPCAPS_SUPPORTSDPNSRV}
  783.   DPNSPCAPS_SUPPORTSBROADCAST   = $0002;
  784.   {$EXTERNALSYM DPNSPCAPS_SUPPORTSBROADCAST}
  785.   DPNSPCAPS_SUPPORTSALLADAPTERS = $0004;
  786.   {$EXTERNALSYM DPNSPCAPS_SUPPORTSALLADAPTERS}
  787.   // Flags added for DirectX 9
  788.   DPNSPCAPS_SUPPORTSTHREADPOOL = $0008;
  789.   {$EXTERNALSYM DPNSPCAPS_SUPPORTSTHREADPOOL}
  790.   DPNSPCAPS_NETWORKSIMULATOR = $0010;
  791.   {$EXTERNALSYM DPNSPCAPS_NETWORKSIMULATOR}
  792.   //
  793.   // SP information flags (added for DirectX 9)
  794.   //
  795.   DPNSPINFO_NETWORKSIMULATORDEVICE = $0001;
  796.   {$EXTERNALSYM DPNSPINFO_NETWORKSIMULATORDEVICE}
  797. (****************************************************************************
  798.  *
  799.  * DirectPlay8 Structures (Non-Message)
  800.  *
  801.  ****************************************************************************)
  802. type
  803.   //
  804.   // Application description
  805.   //
  806.   PDPNApplicationDesc = ^TDPNApplicationDesc;
  807.   _DPN_APPLICATION_DESC = packed record
  808.     dwSize: DWORD;                    // Size of this structure
  809.     dwFlags: DWORD;                   // Flags (DPNSESSION_...)
  810.     guidInstance: TGUID;              // Instance GUID
  811.     guidApplication: TGUID;           // Application GUID
  812.     dwMaxPlayers: DWORD;              // Maximum # of players allowed (0=no limit)
  813.     dwCurrentPlayers: DWORD;          // Current # of players allowed
  814.     pwszSessionName: PWideChar;       // Name of the session
  815.     pwszPassword: PWideChar;          // Password for the session
  816.     pvReservedData: Pointer;
  817.     dwReservedDataSize: DWORD;
  818.     pvApplicationReservedData: Pointer;
  819.     dwApplicationReservedDataSize: DWORD;
  820.   end;
  821.   {$EXTERNALSYM _DPN_APPLICATION_DESC}
  822.   DPN_APPLICATION_DESC = _DPN_APPLICATION_DESC;
  823.   {$EXTERNALSYM DPN_APPLICATION_DESC}
  824.   TDPNApplicationDesc = _DPN_APPLICATION_DESC;
  825.   //
  826.   // Generic Buffer Description
  827.   //
  828.   PBufferDesc = ^TBufferDesc;
  829.   _BUFFERDESC = packed record
  830.     wBufferSize:DWORD;
  831.     pBufferData: PByte;
  832.   end;
  833.   {$EXTERNALSYM _BUFFERDESC}
  834.   BUFFERDESC = _BUFFERDESC;
  835.   {$EXTERNALSYM BUFFERDESC}
  836.   TBufferDesc = _BUFFERDESC;
  837.   PDPNBufferDesc = ^TDPNBufferDesc;
  838.   DPN_BUFFER_DESC = _BUFFERDESC;
  839.   {$EXTERNALSYM DPN_BUFFER_DESC}
  840.   TDPNBufferDesc = DPN_BUFFER_DESC;
  841.   //
  842.   // DirectPlay8 capabilities
  843.   //
  844.   PDPNCaps = ^TDPNCaps;
  845.   _DPN_CAPS = packed record
  846.     dwSize: DWORD; // Size of this structure
  847.     dwFlags: DWORD; // Flags
  848.     dwConnectTimeout: DWORD; // ms before a connect request times out
  849.     dwConnectRetries: DWORD; // # of times to attempt the connection
  850.     dwTimeoutUntilKeepAlive: DWORD; // ms of inactivity before a keep alive is sent
  851.   end;
  852.   {$EXTERNALSYM _DPN_CAPS}
  853.   DPN_CAPS = _DPN_CAPS;
  854.   {$EXTERNALSYM DPN_CAPS}
  855.   TDPNCaps = _DPN_CAPS;
  856.   //
  857.   // Extended capabilities structures (added for DirectX 9)
  858.   //
  859.   PDPNCapsEx = ^TDPNCapsEx;
  860.   _DPN_CAPS_EX = packed record
  861.     dwSize: DWORD; // Size of this structure
  862.     dwFlags: DWORD; // Flags
  863.     dwConnectTimeout: DWORD; // ms before a connect request times out
  864.     dwConnectRetries: DWORD; // # of times to attempt the connection
  865.     dwTimeoutUntilKeepAlive: DWORD; // ms of inactivity before a keep alive is sent
  866.     dwMaxRecvMsgSize: DWORD; // maximum size in bytes of message that can be received
  867.     dwNumSendRetries: DWORD; // maximum number of send retries before link is considered dead
  868.     dwMaxSendRetryInterval: DWORD; // maximum period in msec between send retries
  869.     dwDropThresholdRate: DWORD; // percentage of dropped packets before throttling
  870.     dwThrottleRate: DWORD; // percentage amount to reduce send window when throttling
  871.     dwNumHardDisconnectSends: DWORD; // number of hard disconnect frames to send when close immediate flag is specified
  872.     dwMaxHardDisconnectPeriod: DWORD; // maximum period between hard disconnect sends
  873.   end;
  874.   {$EXTERNALSYM _DPN_CAPS_EX}
  875.   DPN_CAPS_EX = _DPN_CAPS_EX;
  876.   {$EXTERNALSYM DPN_CAPS_EX}
  877.   TDPNCapsEx = _DPN_CAPS_EX;
  878.   // Connection Statistics information
  879.   PDPNConnectionInfo = ^TDPNConnectionInfo;
  880.   _DPN_CONNECTION_INFO = packed record
  881.     dwSize: DWORD;
  882.     dwRoundTripLatencyMS: DWORD;
  883.     dwThroughputBPS: DWORD;
  884.     dwPeakThroughputBPS: DWORD;
  885.     dwBytesSentGuaranteed: DWORD;
  886.     dwPacketsSentGuaranteed: DWORD;
  887.     dwBytesSentNonGuaranteed: DWORD;
  888.     dwPacketsSentNonGuaranteed: DWORD;
  889.     dwBytesRetried: DWORD;    // Guaranteed only
  890.     dwPacketsRetried: DWORD;  // Guaranteed only
  891.     dwBytesDropped: DWORD;    // Non Guaranteed only
  892.     dwPacketsDropped: DWORD;  // Non Guaranteed only
  893.     dwMessagesTransmittedHighPriority: DWORD;
  894.     dwMessagesTimedOutHighPriority: DWORD;
  895.     dwMessagesTransmittedNormalPriority: DWORD;
  896.     dwMessagesTimedOutNormalPriority: DWORD;
  897.     dwMessagesTransmittedLowPriority: DWORD;
  898.     dwMessagesTimedOutLowPriority: DWORD;
  899.     dwBytesReceivedGuaranteed: DWORD;
  900.     dwPacketsReceivedGuaranteed: DWORD;
  901.     dwBytesReceivedNonGuaranteed: DWORD;
  902.     dwPacketsReceivedNonGuaranteed: DWORD;
  903.     dwMessagesReceived: DWORD;
  904.   end;
  905.   {$EXTERNALSYM _DPN_CONNECTION_INFO}
  906.   DPN_CONNECTION_INFO = _DPN_CONNECTION_INFO;
  907.   {$EXTERNALSYM DPN_CONNECTION_INFO}
  908.   TDPNConnectionInfo = _DPN_CONNECTION_INFO;
  909.   //
  910.   // Group information strucutre
  911.   //
  912.   PDPNGroupInfo = ^TDPNGroupInfo;
  913.   _DPN_GROUP_INFO = packed record
  914.     dwSize: DWORD;          // size of this structure
  915.     dwInfoFlags: DWORD;     // information contained
  916.     pwszName: PWideChar;    // Unicode Name
  917.     pvData: Pointer;        // data block
  918.     dwDataSize: DWORD;      // size in BYTES of data block
  919.     dwGroupFlags: DWORD;    // group flags (DPNGROUP_...)
  920.   end;
  921.   {$EXTERNALSYM _DPN_GROUP_INFO}
  922.   DPN_GROUP_INFO = _DPN_GROUP_INFO;
  923.   {$EXTERNALSYM DPN_GROUP_INFO}
  924.   TDPNGroupInfo = _DPN_GROUP_INFO;
  925.   //
  926.   // Player information structure
  927.   //
  928.   PDPNPlayerInfo = ^TDPNPlayerInfo;
  929.   _DPN_PLAYER_INFO = packed record
  930.     dwSize: DWORD;          // size of this structure
  931.     dwInfoFlags: DWORD;     // information contained
  932.     pwszName: PWideChar;    // Unicode Name
  933.     pvData: Pointer;        // data block
  934.     dwDataSize: DWORD;      // size in BYTES of data block
  935.     dwPlayerFlags: DWORD;   // player flags (DPNPLAYER_...)
  936.   end;
  937.   {$EXTERNALSYM _DPN_PLAYER_INFO}
  938.   DPN_PLAYER_INFO = _DPN_PLAYER_INFO;
  939.   {$EXTERNALSYM DPN_PLAYER_INFO}
  940.   TDPNPlayerInfo = _DPN_PLAYER_INFO;
  941.   PDPNSecurityCredentials = ^TDPNSecurityCredentials;
  942.   _DPN_SECURITY_CREDENTIALS = record
  943.   end;
  944.   {$EXTERNALSYM _DPN_SECURITY_CREDENTIALS}
  945.   DPN_SECURITY_CREDENTIALS = _DPN_SECURITY_CREDENTIALS;
  946.   {$EXTERNALSYM DPN_SECURITY_CREDENTIALS}
  947.   TDPNSecurityCredentials = _DPN_SECURITY_CREDENTIALS;
  948.   PDPNSecurityDesc = ^TDPNSecurityDesc;
  949.   _DPN_SECURITY_DESC = record
  950.   end;
  951.   {$EXTERNALSYM _DPN_SECURITY_DESC}
  952.   DPN_SECURITY_DESC = _DPN_SECURITY_DESC;
  953.   {$EXTERNALSYM DPN_SECURITY_DESC}
  954.   TDPNSecurityDesc = _DPN_SECURITY_DESC;
  955.   //
  956.   // Service provider & adapter enumeration structure
  957.   //
  958.   PDPNServiceProviderInfo = ^TDPNServiceProviderInfo;
  959.   _DPN_SERVICE_PROVIDER_INFO = packed record
  960.      dwFlags: DWORD;
  961.      guid: TGUID;            // SP Guid
  962.      pwszName: PWideChar;    // Friendly Name
  963.      pvReserved: Pointer;
  964.      dwReserved: DWORD;
  965.   end;
  966.   {$EXTERNALSYM _DPN_SERVICE_PROVIDER_INFO}
  967.   DPN_SERVICE_PROVIDER_INFO = _DPN_SERVICE_PROVIDER_INFO;
  968.   {$EXTERNALSYM DPN_SERVICE_PROVIDER_INFO}
  969.   TDPNServiceProviderInfo = _DPN_SERVICE_PROVIDER_INFO;
  970.   //
  971.   // Service provider caps structure
  972.   //
  973.   PDPNSpCaps = ^TDPNSpCaps;
  974.   _DPN_SP_CAPS = packed record
  975.     dwSize: DWORD;                   // Size of this structure
  976.     dwFlags: DWORD;                  // Flags ((DPNSPCAPS_...)
  977.     dwNumThreads: DWORD;             // # of worker threads to use
  978.     dwDefaultEnumCount: DWORD;       // default # of enum requests
  979.     dwDefaultEnumRetryInterval: DWORD; // default ms between enum requests
  980.     dwDefaultEnumTimeout: DWORD;     // default enum timeout
  981.     dwMaxEnumPayloadSize: DWORD;     // maximum size in bytes for enum payload data
  982.     dwBuffersPerThread: DWORD;       // number of receive buffers per thread
  983.     dwSystemBufferSize: DWORD;       // amount of buffering to do in addition to posted receive buffers
  984.   end;
  985.   {$EXTERNALSYM _DPN_SP_CAPS}
  986.   DPN_SP_CAPS = _DPN_SP_CAPS;
  987.   {$EXTERNALSYM DPN_SP_CAPS}
  988.   TDPNSpCaps = _DPN_SP_CAPS;
  989. (****************************************************************************
  990.  *
  991.  * IDirectPlay8 message handler call back structures
  992.  *
  993.  ****************************************************************************)
  994.   //
  995.   // Add player to group strucutre for message handler
  996.   // (DPN_MSGID_ADD_PLAYER_TO_GROUP)
  997.   //
  998.   PDPNMsgAddPlayerToGroup = ^TDPNMsgAddPlayerToGroup;
  999.   _DPNMSG_ADD_PLAYER_TO_GROUP = packed record
  1000.     dwSize: DWORD;            // Size of this structure
  1001.     dpnidGroup: TDPNID;       // DPNID of group
  1002.     pvGroupContext: Pointer;  // Group context value
  1003.     dpnidPlayer: TDPNID;      // DPNID of added player
  1004.     pvPlayerContext: Pointer; // Player context value
  1005.   end;
  1006.   {$EXTERNALSYM _DPNMSG_ADD_PLAYER_TO_GROUP}
  1007.   DPNMSG_ADD_PLAYER_TO_GROUP = _DPNMSG_ADD_PLAYER_TO_GROUP;
  1008.   {$EXTERNALSYM DPNMSG_ADD_PLAYER_TO_GROUP}
  1009.   TDPNMsgAddPlayerToGroup = _DPNMSG_ADD_PLAYER_TO_GROUP;
  1010.   //
  1011.   // Async operation completion structure for message handler
  1012.   // (DPN_MSGID_ASYNC_OP_COMPLETE)
  1013.   //
  1014.   PDPNMsgAsyncOpComplete = ^TDPNMsgAsyncOpComplete;
  1015.   _DPNMSG_ASYNC_OP_COMPLETE = packed record
  1016.     dwSize: DWORD;          // Size of this structure
  1017.     hAsyncOp: TDPNHandle;   // DirectPlay8 async operation handle
  1018.     pvUserContext: Pointer; // User context supplied
  1019.     hResultCode: HRESULT;   // HRESULT of operation
  1020.   end;
  1021.   {$EXTERNALSYM _DPNMSG_ASYNC_OP_COMPLETE}
  1022.   DPNMSG_ASYNC_OP_COMPLETE = _DPNMSG_ASYNC_OP_COMPLETE;
  1023.   {$EXTERNALSYM DPNMSG_ASYNC_OP_COMPLETE}
  1024.   TDPNMsgAsyncOpComplete = _DPNMSG_ASYNC_OP_COMPLETE;
  1025.   //
  1026.   // Client info structure for message handler
  1027.   // (DPN_MSGID_CLIENT_INFO)
  1028.   //
  1029.   PDPNMsgClientInfo = ^TDPNMsgClientInfo;
  1030.   _DPNMSG_CLIENT_INFO = packed record
  1031.     dwSize: DWORD;            // Size of this structure
  1032.     dpnidClient: TDPNID;      // DPNID of client
  1033.     pvPlayerContext: Pointer; // Player context value
  1034.   end;
  1035.   {$EXTERNALSYM _DPNMSG_CLIENT_INFO}
  1036.   DPNMSG_CLIENT_INFO = _DPNMSG_CLIENT_INFO;
  1037.   {$EXTERNALSYM DPNMSG_CLIENT_INFO}
  1038.   TDPNMsgClientInfo = _DPNMSG_CLIENT_INFO;
  1039.   //
  1040.   // Connect complete structure for message handler
  1041.   // (DPN_MSGID_CONNECT_COMPLETE)
  1042.   //
  1043.   PDPNMsgConnectComplete = ^TDPNMsgConnectComplete;
  1044.   _DPNMSG_CONNECT_COMPLETE = packed record
  1045.     dwSize: DWORD;                     // Size of this structure
  1046.     hAsyncOp: TDPNHandle;              // DirectPlay8 Async operation handle
  1047.     pvUserContext: Pointer;            // User context supplied at Connect
  1048.     hResultCode: HRESULT;              // HRESULT of connection attempt
  1049.     pvApplicationReplyData: Pointer;   // Connection reply data from Host/Server
  1050.     dwApplicationReplyDataSize: DWORD; // Size (in bytes) of pvApplicationReplyData
  1051.     // Fields added for DirectX 9
  1052.     dpnidLocal: TDPNID;                // DPNID of local player
  1053.   end;
  1054.   {$EXTERNALSYM _DPNMSG_CONNECT_COMPLETE}
  1055.   DPNMSG_CONNECT_COMPLETE = _DPNMSG_CONNECT_COMPLETE;
  1056.   {$EXTERNALSYM DPNMSG_CONNECT_COMPLETE}
  1057.   TDPNMsgConnectComplete = _DPNMSG_CONNECT_COMPLETE;
  1058.   //
  1059.   // Create group structure for message handler
  1060.   // (DPN_MSGID_CREATE_GROUP)
  1061.   //
  1062.   PDPNMsgCreateGroup = ^TDPNMsgCreateGroup;
  1063.   _DPNMSG_CREATE_GROUP = packed record
  1064.     dwSize: DWORD;           // Size of this structure
  1065.     dpnidGroup: TDPNID;      // DPNID of new group
  1066.     dpnidOwner: TDPNID;      // Owner of newgroup
  1067.     pvGroupContext: Pointer; // Group context value
  1068.     // Fields added for DirectX 9
  1069.     pvOwnerContext: Pointer; // Owner context value
  1070.   end;
  1071.   {$EXTERNALSYM _DPNMSG_CREATE_GROUP}
  1072.   DPNMSG_CREATE_GROUP = _DPNMSG_CREATE_GROUP;
  1073.   {$EXTERNALSYM DPNMSG_CREATE_GROUP}
  1074.   TDPNMsgCreateGroup = _DPNMSG_CREATE_GROUP;
  1075.   //
  1076.   // Create player structure for message handler
  1077.   // (DPN_MSGID_CREATE_PLAYER)
  1078.   //
  1079.   PDPNMsgCreatePlayer = ^TDPNMsgCreatePlayer;
  1080.   _DPNMSG_CREATE_PLAYER = packed record
  1081.     dwSize: DWORD;            // Size of this structure
  1082.     dpnidPlayer: DPNID;       // DPNID of new player
  1083.     pvPlayerContext: Pointer; // Player context value
  1084.   end;
  1085.   {$EXTERNALSYM _DPNMSG_CREATE_PLAYER}
  1086.   DPNMSG_CREATE_PLAYER = _DPNMSG_CREATE_PLAYER;
  1087.   {$EXTERNALSYM DPNMSG_CREATE_PLAYER}
  1088.   TDPNMsgCreatePlayer = _DPNMSG_CREATE_PLAYER;
  1089.   //
  1090.   // Destroy group structure for message handler
  1091.   // (DPN_MSGID_DESTROY_GROUP)
  1092.   //
  1093.   PDPNMsgDestroyGroup = ^TDPNMsgDestroyGroup;
  1094.   _DPNMSG_DESTROY_GROUP = packed record
  1095.     dwSize: DWORD;           // Size of this structure
  1096.     dpnidGroup: TDPNID;      // DPNID of destroyed group
  1097.     pvGroupContext: Pointer; // Group context value
  1098.     dwReason: DWORD;         // Information only
  1099.   end;
  1100.   {$EXTERNALSYM _DPNMSG_DESTROY_GROUP}
  1101.   DPNMSG_DESTROY_GROUP = _DPNMSG_DESTROY_GROUP;
  1102.   {$EXTERNALSYM DPNMSG_DESTROY_GROUP}
  1103.   TDPNMsgDestroyGroup = _DPNMSG_DESTROY_GROUP;
  1104.   //
  1105.   // Destroy player structure for message handler
  1106.   // (DPN_MSGID_DESTROY_PLAYER)
  1107.   //
  1108.   PDPNMsgDestroyPlayer = ^TDPNMsgDestroyPlayer;
  1109.   _DPNMSG_DESTROY_PLAYER = packed record
  1110.     dwSize: DWORD;            // Size of this structure
  1111.     dpnidPlayer: TDPNID;      // DPNID of leaving player
  1112.     pvPlayerContext: Pointer; // Player context value
  1113.     dwReason: DWORD;          // Information only
  1114.   end;
  1115.   {$EXTERNALSYM _DPNMSG_DESTROY_PLAYER}
  1116.   DPNMSG_DESTROY_PLAYER = _DPNMSG_DESTROY_PLAYER;
  1117.   {$EXTERNALSYM DPNMSG_DESTROY_PLAYER}
  1118.   TDPNMsgDestroyPlayer = _DPNMSG_DESTROY_PLAYER;
  1119.   //
  1120.   // Enumeration request received structure for message handler
  1121.   // (DPN_MSGID_ENUM_HOSTS_QUERY)
  1122.   //
  1123.   PDPNMsgEnumHostsQuery = ^TDPNMsgEnumHostsQuery;
  1124.   _DPNMSG_ENUM_HOSTS_QUERY = packed record
  1125.     dwSize: DWORD;                        // Size of this structure.
  1126.     pAddressSender: IDirectPlay8Address;  // Address of client who sent the request
  1127.     pAddressDevice: IDirectPlay8Address;  // Address of device request was received on
  1128.     pvReceivedData: Pointer;              // Request data (set on client)
  1129.     dwReceivedDataSize: DWORD;            // Request data size (set on client)
  1130.     dwMaxResponseDataSize: DWORD;         // Max allowable size of enum response
  1131.     pvResponseData: Pointer;              // Optional query repsonse (user set)
  1132.     dwResponseDataSize: DWORD;            // Optional query response size (user set)
  1133.     pvResponseContext: Pointer;           // Optional query response context (user set)
  1134.   end;
  1135.   {$EXTERNALSYM _DPNMSG_ENUM_HOSTS_QUERY}
  1136.   DPNMSG_ENUM_HOSTS_QUERY = _DPNMSG_ENUM_HOSTS_QUERY;
  1137.   {$EXTERNALSYM DPNMSG_ENUM_HOSTS_QUERY}
  1138.   TDPNMsgEnumHostsQuery = _DPNMSG_ENUM_HOSTS_QUERY;
  1139.   //
  1140.   // Enumeration response received structure for message handler
  1141.   // (DPN_MSGID_ENUM_HOSTS_RESPONSE)
  1142.   //
  1143.   PDPNMsgEnumHostsResponse = ^TDPNMsgEnumHostsResponse;
  1144.   _DPNMSG_ENUM_HOSTS_RESPONSE = packed record
  1145.     dwSize: DWORD;                                // Size of this structure
  1146.     pAddressSender: IDirectPlay8Address;          // Address of host who responded
  1147.     pAddressDevice: IDirectPlay8Address;          // Device response was received on
  1148.     pApplicationDescription: PDPNApplicationDesc; // Application description for the session
  1149.     pvResponseData: Pointer;                      // Optional response data (set on host)
  1150.     dwResponseDataSize: DWORD;                    // Optional response data size (set on host)
  1151.     pvUserContext: Pointer;                       // Context value supplied for enumeration
  1152.     dwRoundTripLatencyMS: DWORD;                  // Round trip latency in MS
  1153.   end;
  1154.   {$EXTERNALSYM _DPNMSG_ENUM_HOSTS_RESPONSE}
  1155.   DPNMSG_ENUM_HOSTS_RESPONSE = _DPNMSG_ENUM_HOSTS_RESPONSE;
  1156.   {$EXTERNALSYM DPNMSG_ENUM_HOSTS_RESPONSE}
  1157.   TDPNMsgEnumHostsResponse = _DPNMSG_ENUM_HOSTS_RESPONSE;
  1158.   //
  1159.   // Group info structure for message handler
  1160.   // (DPN_MSGID_GROUP_INFO)
  1161.   //
  1162.   PDPNMsgGroupInfo = ^TDPNMsgGroupInfo;
  1163.   _DPNMSG_GROUP_INFO = packed record
  1164.     dwSize: DWORD;              // Size of this structure
  1165.     dpnidGroup: TDPNID;         // DPNID of group
  1166.     pvGroupContext: Pointer;    // Group context value
  1167.   end;
  1168.   {$EXTERNALSYM _DPNMSG_GROUP_INFO}
  1169.   DPNMSG_GROUP_INFO = _DPNMSG_GROUP_INFO;
  1170.   {$EXTERNALSYM DPNMSG_GROUP_INFO}
  1171.   TDPNMsgGroupInfo = _DPNMSG_GROUP_INFO;
  1172.   //
  1173.   // Migrate host structure for message handler
  1174.   // (DPN_MSGID_HOST_MIGRATE)
  1175.   //
  1176.   PDPNMsgHostMigrate = ^TDPNMsgHostMigrate;
  1177.   _DPNMSG_HOST_MIGRATE = packed record
  1178.     dwSize: DWORD;             // Size of this structure
  1179.     dpnidNewHost: TDPNID;      // DPNID of new Host player
  1180.     pvPlayerContext: Pointer;  // Player context value
  1181.   end;
  1182.   {$EXTERNALSYM _DPNMSG_HOST_MIGRATE}
  1183.   DPNMSG_HOST_MIGRATE = _DPNMSG_HOST_MIGRATE;
  1184.   {$EXTERNALSYM DPNMSG_HOST_MIGRATE}
  1185.   TDPNMsgHostMigrate = _DPNMSG_HOST_MIGRATE;
  1186.   //
  1187.   // Indicate connect structure for message handler
  1188.   // (DPN_MSGID_INDICATE_CONNECT)
  1189.   //
  1190.   PDPNMsgIndicateConnect = ^TDPNMsgIndicateConnect;
  1191.   _DPNMSG_INDICATE_CONNECT = packed record
  1192.     dwSize: DWORD;                        // Size of this structure
  1193.     pvUserConnectData: Pointer;           // Connecting player data
  1194.     dwUserConnectDataSize: DWORD;         // Size (in bytes) of pvUserConnectData
  1195.     pvReplyData: Pointer;                 // Connection reply data
  1196.     dwReplyDataSize: DWORD;               // Size (in bytes) of pvReplyData
  1197.     pvReplyContext: Pointer;              // Buffer context for pvReplyData
  1198.     pvPlayerContext: Pointer;             // Player context preset
  1199.     pAddressPlayer: IDirectPlay8Address;  // Address of connecting player
  1200.     pAddressDevice: IDirectPlay8Address;  // Address of device receiving connect attempt
  1201.   end;
  1202.   {$EXTERNALSYM _DPNMSG_INDICATE_CONNECT}
  1203.   DPNMSG_INDICATE_CONNECT = _DPNMSG_INDICATE_CONNECT;
  1204.   {$EXTERNALSYM DPNMSG_INDICATE_CONNECT}
  1205.   TDPNMsgIndicateConnect = _DPNMSG_INDICATE_CONNECT;
  1206.   //
  1207.   // Indicated connect aborted structure for message handler
  1208.   // (DPN_MSGID_INDICATED_CONNECT_ABORTED)
  1209.   //
  1210.   PDPNMsgIndicatedConnectAborted = ^TDPNMsgIndicatedConnectAborted;
  1211.   _DPNMSG_INDICATED_CONNECT_ABORTED = packed record
  1212.     dwSize: DWORD;            // Size of this structure
  1213.     pvPlayerContext: Pointer; // Player context preset from DPNMSG_INDICATE_CONNECT
  1214.   end;
  1215.   {$EXTERNALSYM _DPNMSG_INDICATED_CONNECT_ABORTED}
  1216.   DPNMSG_INDICATED_CONNECT_ABORTED = _DPNMSG_INDICATED_CONNECT_ABORTED;
  1217.   {$EXTERNALSYM DPNMSG_INDICATED_CONNECT_ABORTED}
  1218.   TDPNMsgIndicatedConnectAborted = _DPNMSG_INDICATED_CONNECT_ABORTED;
  1219.   //
  1220.   // Peer info structure for message handler
  1221.   // (DPN_MSGID_PEER_INFO)
  1222.   //
  1223.   PDPNMsgPeerInfo = ^TDPNMsgPeerInfo;
  1224.   _DPNMSG_PEER_INFO = packed record
  1225.     dwSize: DWORD;              // Size of this structure
  1226.     dpnidPeer: TDPNID;          // DPNID of peer
  1227.     pvPlayerContext: Pointer;   // Player context value
  1228.   end;
  1229.   {$EXTERNALSYM _DPNMSG_PEER_INFO}
  1230.   DPNMSG_PEER_INFO = _DPNMSG_PEER_INFO;
  1231.   {$EXTERNALSYM DPNMSG_PEER_INFO}
  1232.   TDPNMsgPeerInfo = _DPNMSG_PEER_INFO;
  1233.   //
  1234.   // Receive structure for message handler
  1235.   // (DPN_MSGID_RECEIVE)
  1236.   //
  1237.   PDPNMsgReceive = ^TDPNMsgReceive;
  1238.   _DPNMSG_RECEIVE = packed record
  1239.     dwSize: DWORD;             // Size of this structure
  1240.     dpnidSender: TDPNID;       // DPNID of sending player
  1241.     pvPlayerContext: Pointer;  // Player context value of sending player
  1242.     pReceiveData: PByte;       // Received data
  1243.     dwReceiveDataSize: DWORD;  // Size (in bytes) of pReceiveData
  1244.     hBufferHandle: TDPNHandle; // Buffer handle for pReceiveData
  1245.     // Fields added for DirectX 9
  1246.     dwReceiveFlags: DWORD;     // Flags describing how message was received
  1247.   end;
  1248.   {$EXTERNALSYM _DPNMSG_RECEIVE}
  1249.   DPNMSG_RECEIVE = _DPNMSG_RECEIVE;
  1250.   {$EXTERNALSYM DPNMSG_RECEIVE}
  1251.   TDPNMsgReceive = _DPNMSG_RECEIVE;
  1252.   //
  1253.   // Remove player from group structure for message handler
  1254.   // (DPN_MSGID_REMOVE_PLAYER_FROM_GROUP)
  1255.   //
  1256.   PDPNMsgRemovePlayerFromGroup = ^TDPNMsgRemovePlayerFromGroup;
  1257.   _DPNMSG_REMOVE_PLAYER_FROM_GROUP = packed record
  1258.     dwSize: DWORD;               // Size of this structure
  1259.     dpnidGroup: TDPNID;          // DPNID of group
  1260.     pvGroupContext: Pointer;     // Group context value
  1261.     dpnidPlayer: TDPNID;         // DPNID of deleted player
  1262.     pvPlayerContext: Pointer;    // Player context value
  1263.   end;
  1264.   {$EXTERNALSYM _DPNMSG_REMOVE_PLAYER_FROM_GROUP}
  1265.   DPNMSG_REMOVE_PLAYER_FROM_GROUP = _DPNMSG_REMOVE_PLAYER_FROM_GROUP;
  1266.   {$EXTERNALSYM DPNMSG_REMOVE_PLAYER_FROM_GROUP}
  1267.   TDPNMsgRemovePlayerFromGroup = _DPNMSG_REMOVE_PLAYER_FROM_GROUP;
  1268.   //
  1269.   // Returned buffer structure for message handler
  1270.   // (DPN_MSGID_RETURN_BUFFER)
  1271.   //
  1272.   PDPNMsgReturnBuffer = ^TDPNMsgReturnBuffer;
  1273.   _DPNMSG_RETURN_BUFFER = packed record
  1274.     dwSize: DWORD;          // Size of this structure
  1275.     hResultCode: HRESULT;   // Return value of operation
  1276.     pvBuffer: Pointer;      // Buffer being returned
  1277.     pvUserContext: Pointer; // Context associated with buffer
  1278.   end;
  1279.   {$EXTERNALSYM _DPNMSG_RETURN_BUFFER}
  1280.   DPNMSG_RETURN_BUFFER = _DPNMSG_RETURN_BUFFER;
  1281.   {$EXTERNALSYM DPNMSG_RETURN_BUFFER}
  1282.   TDPNMsgReturnBuffer = _DPNMSG_RETURN_BUFFER;
  1283.   //
  1284.   // Send complete structure for message handler
  1285.   // (DPN_MSGID_SEND_COMPLETE)
  1286.   //
  1287.   PDPNMsgSendComplete = ^TDPNMsgSendComplete;
  1288.   _DPNMSG_SEND_COMPLETE = packed record
  1289.     dwSize: DWORD;          // Size of this structure
  1290.     hAsyncOp: TDPNHandle;   // DirectPlay8 Async operation handle
  1291.     pvUserContext: Pointer; // User context supplied at Send/SendTo
  1292.     hResultCode: HRESULT;   // HRESULT of send
  1293.     dwSendTime: DWORD;      // Send time in ms
  1294.     // Fields added for DirectX 9
  1295.     dwFirstFrameRTT: DWORD; // RTT of the first frame in the message
  1296.     dwFirstFrameRetryCount: DWORD; // Retry count of the first frame
  1297.     dwSendCompleteFlags: DWORD; // Flags describing how message was sent
  1298.     pBuffers: PDPNBufferDesc; // Pointer to array of buffers sent, if DirectPlay did not make a copy
  1299.     dwNumBuffers: DWORD; // Number of buffers in previous array
  1300.   end;
  1301.   {$EXTERNALSYM _DPNMSG_SEND_COMPLETE}
  1302.   DPNMSG_SEND_COMPLETE = _DPNMSG_SEND_COMPLETE;
  1303.   {$EXTERNALSYM DPNMSG_SEND_COMPLETE}
  1304.   TDPNMsgSendComplete = _DPNMSG_SEND_COMPLETE;
  1305.   //
  1306.   // Server info structure for message handler
  1307.   // (DPN_MSGID_SERVER_INFO)
  1308.   //
  1309.   PDPNMsgServerInfo = ^TDPNMsgServerInfo;
  1310.   _DPNMSG_SERVER_INFO = packed record
  1311.     dwSize: DWORD;              // Size of this structure
  1312.     dpnidServer: TDPNID;        // DPNID of server
  1313.     pvPlayerContext: Pointer;   // Player context value
  1314.   end;
  1315.   {$EXTERNALSYM _DPNMSG_SERVER_INFO}
  1316.   DPNMSG_SERVER_INFO = _DPNMSG_SERVER_INFO;
  1317.   {$EXTERNALSYM DPNMSG_SERVER_INFO}
  1318.   TDPNMsgServerInfo = _DPNMSG_SERVER_INFO;
  1319.   //
  1320.   // Terminated session structure for message handler
  1321.   // (DPN_MSGID_TERMINATE_SESSION)
  1322.   //
  1323.   PDPNMsgTerminateSession = ^TDPNMsgTerminateSession;
  1324.   _DPNMSG_TERMINATE_SESSION = packed record
  1325.     dwSize: DWORD;              // Size of this structure
  1326.     hResultCode: HRESULT;       // Reason
  1327.     pvTerminateData: Pointer;   // Data passed from Host/Server
  1328.     dwTerminateDataSize: DWORD; // Size (in bytes) of pvTerminateData
  1329.   end;
  1330.   {$EXTERNALSYM _DPNMSG_TERMINATE_SESSION}
  1331.   DPNMSG_TERMINATE_SESSION = _DPNMSG_TERMINATE_SESSION;
  1332.   {$EXTERNALSYM DPNMSG_TERMINATE_SESSION}
  1333.   TDPNMsgTerminateSession = _DPNMSG_TERMINATE_SESSION;
  1334.   //
  1335.   // Message structures added for DirectX 9
  1336.   //
  1337.   //
  1338.   // Create thread info structure for message handler
  1339.   // (DPN_MSGID_CREATE_THREAD)
  1340.   //
  1341.   PDPNMsgCreateThread = ^TDPNMsgCreateThread;
  1342.   _DPNMSG_CREATE_THREAD = packed record
  1343.     dwSize: DWORD; // Size of this structure
  1344.     dwFlags: DWORD; // Flags describing this thread
  1345.     dwProcessorNum: DWORD; // Index of processor to which thread is bound
  1346.     pvUserContext: Pointer; // Thread context value
  1347.   end;
  1348.   {$EXTERNALSYM _DPNMSG_CREATE_THREAD}
  1349.   DPNMSG_CREATE_THREAD = _DPNMSG_CREATE_THREAD;
  1350.   {$EXTERNALSYM DPNMSG_CREATE_THREAD}
  1351.   TDPNMsgCreateThread = _DPNMSG_CREATE_THREAD;
  1352.   //
  1353.   // Destroy thread info structure for message handler
  1354.   // (DPN_MSGID_DESTROY_THREAD)
  1355.   //
  1356.   PDPNMsgDestroyThread = ^TDPNMsgDestroyThread;
  1357.   _DPNMSG_DESTROY_THREAD = packed record
  1358.     dwSize: DWORD; // Size of this structure
  1359.     dwProcessorNum: DWORD; // Index of processor to which thread was bound
  1360.     pvUserContext: Pointer; // Thread context value
  1361.   end;
  1362.   {$EXTERNALSYM _DPNMSG_DESTROY_THREAD}
  1363.   DPNMSG_DESTROY_THREAD = _DPNMSG_DESTROY_THREAD;
  1364.   {$EXTERNALSYM DPNMSG_DESTROY_THREAD}
  1365.   TDPNMsgDestroyThread = _DPNMSG_DESTROY_THREAD;
  1366.   //
  1367.   // Query-to-resolve-NAT-address structure for message handler
  1368.   // (DPN_MSGID_NAT_RESOLVER_QUERY)
  1369.   //
  1370.   PDPNMsgNatResolverQuery = ^TDPNMsgNatResolverQuery;
  1371.   _DPNMSG_NAT_RESOLVER_QUERY = packed record
  1372.     dwSize: DWORD; // Size of this structure.
  1373.     pAddressSender: IDirectPlay8Address; // Address of client that sent the query
  1374.     pAddressDevice: IDirectPlay8Address; // Address of device on which query was received
  1375.     pwszUserString: PWideChar; // User specified string, or NULL if none
  1376.   end;
  1377.   {$EXTERNALSYM _DPNMSG_NAT_RESOLVER_QUERY}
  1378.   DPNMSG_NAT_RESOLVER_QUERY = _DPNMSG_NAT_RESOLVER_QUERY;
  1379.   {$EXTERNALSYM DPNMSG_NAT_RESOLVER_QUERY}
  1380.   TDPNMsgNatResolverQuery = _DPNMSG_NAT_RESOLVER_QUERY;
  1381. (****************************************************************************
  1382.  *
  1383.  * DirectPlay8 Functions
  1384.  *
  1385.  ****************************************************************************)
  1386. (*
  1387.  * This function is no longer supported.  It is recommended that CoCreateInstance be used to create
  1388.  * DirectPlay8 objects.
  1389.  *
  1390.  * extern HRESULT WINAPI DirectPlay8Create( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown);
  1391.  *
  1392.  *)
  1393.  
  1394. (****************************************************************************
  1395.  *
  1396.  * DirectPlay8Lobby Interface Pointer
  1397.  *
  1398.  ****************************************************************************)
  1399.   IDirectPlay8LobbiedApplication = interface;
  1400. (****************************************************************************
  1401.  *
  1402.  * DirectPlay8 Application Interfaces
  1403.  *
  1404.  ****************************************************************************)
  1405.   //
  1406.   // COM definition for DirectPlay8 Client interface
  1407.   //
  1408.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8Client);'}
  1409.   {$EXTERNALSYM IDirectPlay8Client}
  1410.   IDirectPlay8Client = interface(IUnknown)
  1411.     ['{5102dacd-241b-11d3-aea7-006097b01411}']
  1412.     (*** IDirectPlay8Client methods ***)
  1413.     function Initialize(pvUserContext: Pointer; pfn: TFNDPNMessageHandler; dwFlags: DWORD): HResult; stdcall;
  1414.     function EnumServiceProviders(pguidServiceProvider, pguidApplication: PGUID;
  1415.       pSPInfoBuffer: PDPNServiceProviderInfo; out pcbEnumData, pcReturned: DWORD;
  1416.       dwFlags: DWORD): HResult; stdcall;
  1417.     function EnumHosts(const pApplicationDesc: TDPNApplicationDesc;
  1418.       pAddrHost, pDeviceInfo: IDirectPlay8Address; pUserEnumData: Pointer;
  1419.       dwUserEnumDataSize, dwEnumCount, dwRetryInterval, dwTimeOut: DWORD;
  1420.       pvUserContext: Pointer; pAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1421.     function CancelAsyncOperation(hAsyncHandle: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1422.     function Connect(const pdnAppDesc: TDPNApplicationDesc;
  1423.       pHostAddr: IDirectPlay8Address; pDeviceInfo: IDirectPlay8Address;
  1424.       pdnSecurity: PDPNSecurityDesc; pdnCredentials: PDPNSecurityCredentials;
  1425.       pvUserConnectData: Pointer; dwUserConnectDataSize: DWORD; pvAsyncContext: Pointer;
  1426.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1427.     function Send(const prgBufferDesc: TDPNBufferDesc; cBufferDesc, dwTimeOut: DWORD;
  1428.       pvAsyncContext: Pointer; phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1429.     function GetSendQueueInfo(pdwNumMsgs, pdwNumBytes: PDWORD; dwFlags: DWORD): HResult; stdcall;
  1430.     function GetApplicationDesc(pAppDescBuffer: PDPNApplicationDesc; var pcbDataSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  1431.     function SetClientInfo(const pdpnPlayerInfo: TDPNPlayerInfo; pvAsyncContext: Pointer;
  1432.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1433.     function GetServerInfo(pdpnPlayerInfo: PDPNPlayerInfo; var pdwSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  1434.     function GetServerAddress(out pAddress: IDirectPlay8Address; dwFlags: DWORD): HResult; stdcall;
  1435.     function Close(dwFlags: DWORD): HResult; stdcall;
  1436.     function ReturnBuffer(hBufferHandle: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1437.     function GetCaps(pdpCaps: PDPNCaps; dwFlags: DWORD): HResult; stdcall; //Translator: pdpCaps can be either PDPNCaps or PDPNCapsEx
  1438.     function SetCaps(pdpCaps: PDPNCaps; dwFlags: DWORD): HResult; stdcall; //Translator: pdpCaps can be either PDPNCaps or PDPNCapsEx
  1439.     function SetSPCaps(const pguidSP: TGUID; const pdpspCaps: TDPNSpCaps; dwFlags: DWORD): HResult; stdcall;
  1440.     function GetSPCaps(const pguidSP: TGUID; var pdpspCaps: TDPNSpCaps; dwFlags: DWORD): HResult; stdcall;
  1441.     function GetConnectionInfo(var pdpConnectionInfo: TDPNConnectionInfo; dwFlags: DWORD): HResult; stdcall;
  1442.     function RegisterLobby(dpnHandle: TDPNHandle; pIDP8LobbiedApplication: IDirectPlay8LobbiedApplication; dwFlags: DWORD): HResult; stdcall;
  1443.   end;
  1444.   //
  1445.   // COM definition for DirectPlay8 Server interface
  1446.   //
  1447.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8Server);'}
  1448.   {$EXTERNALSYM IDirectPlay8Server}
  1449.   IDirectPlay8Server = interface(IUnknown)
  1450.     ['{5102dace-241b-11d3-aea7-006097b01411}']
  1451.     (*** IDirectPlay8Server methods ***)
  1452.     function Initialize(pvUserContext: Pointer; pfn: TFNDPNMessageHandler; dwFlags: DWORD): HResult; stdcall;
  1453.     function EnumServiceProviders(pguidServiceProvider, pguidApplication: PGUID;
  1454.       pSPInfoBuffer: PDPNServiceProviderInfo; out pcbEnumData, pcReturned: DWORD;
  1455.       dwFlags: DWORD): HResult; stdcall;
  1456.     function CancelAsyncOperation(hAsyncHandle: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1457.     function GetSendQueueInfo(dpnid: TDPNID; pdwNumMsgs, pdwNumBytes: PDWORD; dwFlags: DWORD): HResult; stdcall;
  1458.     function GetApplicationDesc(pAppDescBuffer: PDPNApplicationDesc; var pcbDataSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  1459.     function GetServerInfo(pdpnPlayerInfo: PDPNPlayerInfo; pvAsyncContext: Pointer; phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1460.     function GetClientInfo(dpnid: TDPNID; pdpnPlayerInfo: PDPNPlayerInfo; pdwSize: PDWORD; dwFlags: DWORD): HResult; stdcall;
  1461.     function GetClientAddress(dpnid: TDPNID; out pAddress: IDirectPlay8Address; dwFlags: DWORD): HResult; stdcall;
  1462.     function GetLocalHostAddresses(out prgpAddress: IDirectPlay8Address; var pcAddress: DWORD; dwFlags: DWORD): HResult; stdcall;
  1463.     function SetApplicationDesc(const pad: TDPNApplicationDesc; dwFlags: DWORD): HResult; stdcall;
  1464.     function Host(const pdnAppDesc: TDPNApplicationDesc; prgpDeviceInfo: PIDirectPlay8Address;
  1465.       cDeviceInfo: DWORD; pdnSecurity: PDPNSecurityDesc; pdnCredentials: PDPNSecurityCredentials;
  1466.       pvPlayerContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  1467.     function SendTo(dpnid: TDPNID; const prgBufferDesc: TDPNBufferDesc; cBufferDesc, dwTimeOut: DWORD;
  1468.       pvAsyncContext: Pointer; phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1469.     function CreateGroup(const pdpnGroupInfo: TDPNGroupInfo; pvGroupContext, pvAsyncContext: Pointer;
  1470.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1471.     function DestroyGroup(idGroup: TDPNID; pvAsyncContext: Pointer;
  1472.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1473.     function AddPlayerToGroup(idGroup, idClient: TDPNID; pvAsyncContext: Pointer;
  1474.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1475.     function RemovePlayerFromGroup(idGroup, idClient: TDPNID; pvAsyncContext: Pointer;
  1476.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1477.     function SetGroupInfo(dpnid: TDPNID; const pdpnGroupInfo: TDPNGroupInfo; pvAsyncContext: Pointer; phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1478.     function GetGroupInfo(dpnid: TDPNID; pdpnGroupInfo: PDPNGroupInfo; pdwSize: PDWORD; dwFlags: DWORD): HResult; stdcall; //todo: Changed
  1479.     function EnumPlayersAndGroups(prgdpnid: PDPNID; var pcdpnid: DWORD; dwFlags: DWORD): HResult; stdcall;
  1480.     function EnumGroupMembers(dpnid: TDPNID; prgdpnid: PDPNID; var pcdpnid: DWORD; dwFlags: DWORD): HResult; stdcall;
  1481.     function Close(dwFlags: DWORD): HResult; stdcall;
  1482.     function DestroyClient(dpnidClient: TDPNID; pvDestroyData: Pointer; dwDestroyDataSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  1483.     function ReturnBuffer(hBufferHandle: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1484.     function GetPlayerContext(dpnid: TDPNID; out ppvPlayerContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  1485.     function GetGroupContext(dpnid: TDPNID; out ppvGroupContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  1486.     function GetCaps(pdpCaps: PDPNCaps; dwFlags: DWORD): HResult; stdcall; //Translator: pdpCaps can be either PDPNCaps or PDPNCapsEx
  1487.     function SetCaps(pdpCaps: PDPNCaps; dwFlags: DWORD): HResult; stdcall; //Translator: pdpCaps can be either PDPNCaps or PDPNCapsEx
  1488.     function SetSPCaps(const pguidSP: TGUID; const pdpspCaps: TDPNSpCaps; dwFlags: DWORD): HResult; stdcall;
  1489.     function GetSPCaps(const pguidSP: TGUID; var pdpspCaps: TDPNSpCaps; dwFlags: DWORD): HResult; stdcall;
  1490.     function GetConnectionInfo(dpnid: TDPNID; var pdpConnectionInfo: TDPNConnectionInfo; dwFlags: DWORD): HResult; stdcall;
  1491.     function RegisterLobby(dpnHandle: TDPNHandle; pIDP8LobbiedApplication: IDirectPlay8LobbiedApplication; dwFlags: DWORD): HResult; stdcall;
  1492.   end;
  1493.   //
  1494.   // COM definition for DirectPlay8 Peer interface
  1495.   //
  1496.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8Peer);'}
  1497.   {$EXTERNALSYM IDirectPlay8Peer}
  1498.   IDirectPlay8Peer = interface(IUnknown)
  1499.     ['{5102dacf-241b-11d3-aea7-006097b01411}']
  1500.     (*** IDirectPlay8Peer methods ***)
  1501.     function Initialize(pvUserContext: Pointer; pfn: TFNDPNMessageHandler; dwFlags: DWORD): HResult; stdcall;
  1502.     function EnumServiceProviders(pguidServiceProvider, pguidApplication: PGUID;
  1503.       pSPInfoBuffer: PDPNServiceProviderInfo; out pcbEnumData, pcReturned: DWORD;
  1504.       dwFlags: DWORD): HResult; stdcall;
  1505.     function CancelAsyncOperation(hAsyncHandle: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1506.     function Connect(const pdnAppDesc: TDPNApplicationDesc;
  1507.       pHostAddr: IDirectPlay8Address; pDeviceInfo: IDirectPlay8Address;
  1508.       pdnSecurity: PDPNSecurityDesc; pdnCredentials: PDPNSecurityCredentials;
  1509.       pvUserConnectData: Pointer; dwUserConnectDataSize: DWORD;
  1510.       pvPlayerContext, pvAsyncContext: Pointer;
  1511.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1512.     function SendTo(dpnid: TDPNID; const prgBufferDesc: TDPNBufferDesc; cBufferDesc, dwTimeOut: DWORD;
  1513.       pvAsyncContext: Pointer; phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1514.     function GetSendQueueInfo(dpnid: TDPNID; pdwNumMsgs, pdwNumBytes: PDWORD; dwFlags: DWORD): HResult; stdcall;
  1515.     function Host(const pdnAppDesc: TDPNApplicationDesc; prgpDeviceInfo: PIDirectPlay8Address;
  1516.       cDeviceInfo: DWORD; pdnSecurity: PDPNSecurityDesc; pdnCredentials: PDPNSecurityCredentials;
  1517.       pvPlayerContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  1518.     function GetApplicationDesc(pAppDescBuffer: PDPNApplicationDesc; var pcbDataSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  1519.     function SetApplicationDesc(const pad: TDPNApplicationDesc; dwFlags: DWORD): HResult; stdcall;
  1520.     function CreateGroup(const pdpnGroupInfo: TDPNGroupInfo; pvGroupContext, pvAsyncContext: Pointer;
  1521.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1522.     function DestroyGroup(idGroup: TDPNID; pvAsyncContext: Pointer;
  1523.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1524.     function AddPlayerToGroup(idGroup, idClient: TDPNID; pvAsyncContext: Pointer;
  1525.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1526.     function RemovePlayerFromGroup(idGroup, idClient: TDPNID; pvAsyncContext: Pointer;
  1527.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1528.     function SetGroupInfo(dpnid: TDPNID; const pdpnGroupInfo: TDPNGroupInfo; pvAsyncContext: Pointer; phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1529.     function GetGroupInfo(dpnid: TDPNID; pdpnGroupInfo: PDPNGroupInfo; pdwSize: PDWORD; dwFlags: DWORD): HResult; stdcall; //todo: Changed
  1530.     function EnumPlayersAndGroups(prgdpnid: PDPNID; var pcdpnid: DWORD; dwFlags: DWORD): HResult; stdcall;
  1531.     function EnumGroupMembers(dpnid: TDPNID; prgdpnid: PDPNID; var pcdpnid: DWORD; dwFlags: DWORD): HResult; stdcall;
  1532.     function SetPeerInfo(const pdpnPlayerInfo: TDPNPlayerInfo; pvAsyncContext: Pointer;
  1533.       phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1534.     function GetPeerInfo(dpnid: TDPNID; var pdpnPlayerInfo: TDPNPlayerInfo; pdwSize: PDWORD; dwFlags: DWORD): HResult; stdcall; //todo: Changed
  1535.     function GetPeerAddress(dpnid: TDPNID; out pAddress: IDirectPlay8Address; dwFlags: DWORD): HResult; stdcall;
  1536.     function GetLocalHostAddresses(prgpAddress: PIDirectPlay8Address; var pcAddress: DWORD; dwFlags: DWORD): HResult; stdcall;
  1537.     function Close(dwFlags: DWORD): HResult; stdcall;
  1538.     function EnumHosts(const pApplicationDesc: TDPNApplicationDesc;
  1539.       pAddrHost, pDeviceInfo: IDirectPlay8Address; pUserEnumData: Pointer;
  1540.       dwUserEnumDataSize, dwEnumCount, dwRetryInterval, dwTimeOut: DWORD;
  1541.       pvUserContext: Pointer; pAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1542.     function DestroyPeer(dpnidClient: TDPNID; pvDestroyData: Pointer; dwDestroyDataSize, dwFlags: DWORD): HResult; stdcall;
  1543.     function ReturnBuffer(hBufferHandle: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
  1544.     function GetPlayerContext(dpnid: TDPNID; out ppvPlayerContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  1545.     function GetGroupContext(dpnid: TDPNID; out ppvGroupContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  1546.     function GetCaps(pdpCaps: PDPNCaps; dwFlags: DWORD): HResult; stdcall; //Translator: pdpCaps can be either PDPNCaps or PDPNCapsEx
  1547.     function SetCaps(pdpCaps: PDPNCaps; dwFlags: DWORD): HResult; stdcall; //Translator: pdpCaps can be either PDPNCaps or PDPNCapsEx
  1548.     function SetSPCaps(const pguidSP: TGUID; const pdpspCaps: TDPNSpCaps; dwFlags: DWORD): HResult; stdcall;
  1549.     function GetSPCaps(const pguidSP: TGUID; var pdpspCaps: TDPNSpCaps; dwFlags: DWORD): HResult; stdcall;
  1550.     function GetConnectionInfo(dpnid: TDPNID; var pdpConnectionInfo: TDPNConnectionInfo; dwFlags: DWORD): HResult; stdcall;
  1551.     function RegisterLobby(dpnHandle: TDPNHandle; pIDP8LobbiedApplication: IDirectPlay8LobbiedApplication; dwFlags: DWORD): HResult; stdcall; 
  1552.     function TerminateSession(pvTerminateData: Pointer; dwTerminateDataSize, dwFlags: DWORD): HResult; stdcall;
  1553.   end;