hxengin.h
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:64k
源码类别:

Symbian

开发平台:

Visual C++

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Source last modified: $Id: hxengin.h,v 1.4.2.3 2004/07/09 01:45:08 hubbe Exp $
  3.  * 
  4.  * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
  5.  * 
  6.  * The contents of this file, and the files included with this file,
  7.  * are subject to the current version of the RealNetworks Public
  8.  * Source License (the "RPSL") available at
  9.  * http://www.helixcommunity.org/content/rpsl unless you have licensed
  10.  * the file under the current version of the RealNetworks Community
  11.  * Source License (the "RCSL") available at
  12.  * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
  13.  * will apply. You may also obtain the license terms directly from
  14.  * RealNetworks.  You may not use this file except in compliance with
  15.  * the RPSL or, if you have a valid RCSL with RealNetworks applicable
  16.  * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
  17.  * the rights, obligations and limitations governing use of the
  18.  * contents of the file.
  19.  * 
  20.  * Alternatively, the contents of this file may be used under the
  21.  * terms of the GNU General Public License Version 2 or later (the
  22.  * "GPL") in which case the provisions of the GPL are applicable
  23.  * instead of those above. If you wish to allow use of your version of
  24.  * this file only under the terms of the GPL, and not to allow others
  25.  * to use your version of this file under the terms of either the RPSL
  26.  * or RCSL, indicate your decision by deleting the provisions above
  27.  * and replace them with the notice and other provisions required by
  28.  * the GPL. If you do not delete the provisions above, a recipient may
  29.  * use your version of this file under the terms of any one of the
  30.  * RPSL, the RCSL or the GPL.
  31.  * 
  32.  * This file is part of the Helix DNA Technology. RealNetworks is the
  33.  * developer of the Original Code and owns the copyrights in the
  34.  * portions it created.
  35.  * 
  36.  * This file, and the files included with this file, is distributed
  37.  * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
  38.  * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
  39.  * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
  40.  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
  41.  * ENJOYMENT OR NON-INFRINGEMENT.
  42.  * 
  43.  * Technology Compatibility Kit Test Suite(s) Location:
  44.  *    http://www.helixcommunity.org/content/tck
  45.  * 
  46.  * Contributor(s):
  47.  * 
  48.  * ***** END LICENSE BLOCK ***** */
  49. #ifndef _HXENGIN_H_
  50. #define _HXENGIN_H_
  51. #include "hxcom.h"
  52. /*
  53.  * Forward declarations of some interfaces used here-in.
  54.  */
  55. typedef _INTERFACE IHXBuffer IHXBuffer;
  56. typedef _INTERFACE IHXCallback IHXCallback;
  57. typedef _INTERFACE IHXScheduler IHXScheduler;
  58. typedef _INTERFACE IHXTCPResponse IHXTCPResponse;
  59. typedef _INTERFACE IHXLBoundTCPSocket IHXLBoundTCPSocket;
  60. typedef _INTERFACE IHXTCPSocket IHXTCPSocket;
  61. typedef _INTERFACE IHXListenResponse IHXListenResponse;
  62. typedef _INTERFACE IHXListenSocket IHXListenSocket;
  63. typedef _INTERFACE IHXNetworkServices IHXNetworkServices;
  64. typedef _INTERFACE IHXNetworkServices2 IHXNetworkServices2;
  65. typedef _INTERFACE IHXUDPResponse      IHXUDPResponse;
  66. typedef _INTERFACE IHXUDPSocket IHXUDPSocket;
  67. typedef _INTERFACE IHXResolver IHXResolver;
  68. typedef _INTERFACE IHXResolverResponse IHXResolverResponse;
  69. typedef _INTERFACE IHXInterruptSafe IHXInterruptSafe;
  70. typedef _INTERFACE IHXAsyncIOSelection IHXAsyncIOSelection;
  71. typedef _INTERFACE IHXUDPMulticastInit IHXUDPMulticastInit;
  72. typedef _INTERFACE IHXInterruptState IHXInterruptState;
  73. typedef _INTERFACE IHXOptimizedScheduler IHXOptimizedScheduler;
  74. // $Private:
  75. typedef _INTERFACE IHXThreadSafeScheduler IHXThreadSafeScheduler;
  76. typedef _INTERFACE IHXBufferedSocket IHXBufferedSocket;
  77. typedef _INTERFACE IHXNetInterfaces IHXNetInterfaces;
  78. typedef _INTERFACE IHXNetInterfacesAdviseSink IHXNetInterfacesAdviseSink;
  79. // $EndPrivate.
  80. typedef _INTERFACE IHXNetworkInterfaceEnumerator IHXNetworkInterfaceEnumerator;
  81. typedef _INTERFACE IHXUDPConnectedSocket           IHXUDPConnectedSocket;
  82. /*
  83.  * Address flags starting with PNR are depricated.
  84.  */
  85. #define HXR_INADDR_ANY (UINT32)0x00000000  //THIS FLAG IS DEPRICATED
  86. #define HX_INADDR_ANY (UINT32)0x00000000
  87. /*
  88.  * 255.255.255.254
  89.  *
  90.  * Bind to all ports in IPBindings list from
  91.  * server config.
  92.  */
  93. #define HXR_INADDR_IPBINDINGS (UINT32)0xfffffffe    //THIS FLAG IS DEPRICATED
  94. #define HX_INADDR_IPBINDINGS (UINT32)0xfffffffe
  95. /* Async IO Selection Type (Unix Only) */
  96. #define PNAIO_READ 1
  97. #define PNAIO_WRITE 2
  98. #define PNAIO_EXCEPTION 4
  99. /****************************************************************************
  100.  * 
  101.  *  Interface:
  102.  * 
  103.  * IHXCallback
  104.  * 
  105.  *  Purpose:
  106.  * 
  107.  * This interface defines a simple callback which will be used in
  108.  * various interfaces such as IHXScheduler.
  109.  * 
  110.  *  IID_IHXCallback:
  111.  * 
  112.  * {00000100-0901-11d1-8B06-00A024406D59}
  113.  * 
  114.  */
  115. DEFINE_GUID(IID_IHXCallback, 0x00000100, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  116. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  117. #undef  INTERFACE
  118. #define INTERFACE   IHXCallback
  119. DECLARE_INTERFACE_(IHXCallback, IUnknown)
  120. {
  121.     /*
  122.      *  IUnknown methods
  123.      */
  124.     STDMETHOD(QueryInterface) (THIS_
  125. REFIID riid,
  126. void** ppvObj) PURE;
  127.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  128.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  129.     /*
  130.      *  IHXCallback methods
  131.      */
  132.     /************************************************************************
  133.      * Method:
  134.      *     IHXCallback::Func
  135.      * Purpose:
  136.      *     This is the function that will be called when a callback is
  137.      *     to be executed.
  138.      */
  139.     STDMETHOD(Func) (THIS) PURE;
  140. };
  141. /****************************************************************************
  142.  * 
  143.  *  Interface:
  144.  * 
  145.  * IHXScheduler
  146.  * 
  147.  *  Purpose:
  148.  * 
  149.  * This interface provides the user with a way of scheduling callbacks
  150.  * that will be executed at some time in the future.
  151.  * 
  152.  *  IID_IHXScheduler:
  153.  * 
  154.  * {00000101-0901-11d1-8B06-00A024406D59}
  155.  * 
  156.  */
  157. DEFINE_GUID(IID_IHXScheduler, 0x00000101, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  158. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  159. #undef  INTERFACE
  160. #define INTERFACE   IHXScheduler
  161. typedef ULONG32 CallbackHandle;
  162. typedef struct _HXTimeval
  163. {
  164.     UINT32 tv_sec;
  165.     UINT32 tv_usec;
  166. } HXTimeval;
  167. DECLARE_INTERFACE_(IHXScheduler, IUnknown)
  168. {
  169.     /*
  170.      *  IUnknown methods
  171.      */
  172.     STDMETHOD(QueryInterface) (THIS_
  173. REFIID riid,
  174. void** ppvObj) PURE;
  175.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  176.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  177.     /*
  178.      * IHXScheduler methods
  179.      */
  180.     /************************************************************************
  181.      * Method:
  182.      *     IHXScheduler::RelativeEnter
  183.      * Purpose:
  184.      *     Schedule a callback to be executed "ms" milliseconds from now
  185.      *     This function is less percise then AbsoluteEnter and should only
  186.      *     be used when accurate timing is not critical.
  187.      */
  188.     STDMETHOD_(CallbackHandle,RelativeEnter) (THIS_
  189. IHXCallback* pCallback,
  190. UINT32 ms) PURE;
  191.     /************************************************************************
  192.      * Method:
  193.      *     IHXScheduler::AbsoluteEnter
  194.      * Purpose:
  195.      *     Schedule a callback to be executed at time "tVal".
  196.      */
  197.     STDMETHOD_(CallbackHandle,AbsoluteEnter) (THIS_
  198. IHXCallback* pCallback,
  199. HXTimeval tVal) PURE;
  200.     /************************************************************************
  201.      * Method:
  202.      *     IHXScheduler::Remove
  203.      * Purpose:
  204.      *     Remove a callback from the scheduler.
  205.      */
  206.     STDMETHOD(Remove) (THIS_
  207.      CallbackHandle Handle) PURE;
  208.     /************************************************************************
  209.      * Method:
  210.      *     IHXScheduler::GetCurrentSchedulerTime
  211.      * Purpose:
  212.      *     Gives the current time (in the timeline of the scheduler).
  213.      */
  214.     STDMETHOD_(HXTimeval,GetCurrentSchedulerTime) (THIS) PURE;
  215. };
  216. /****************************************************************************
  217.  * 
  218.  *  Interface:
  219.  * 
  220.  * IHXTCPResponse
  221.  * 
  222.  *  Purpose:
  223.  * 
  224.  * This is the response interface for the asynchronous TCP networking 
  225.  * interface.
  226.  * 
  227.  *  IID_IHXTCPResponse:
  228.  * 
  229.  * {00000102-0901-11d1-8B06-00A024406D59}
  230.  * 
  231.  */
  232. DEFINE_GUID(IID_IHXTCPResponse, 0x00000102, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  233. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  234. #undef  INTERFACE
  235. #define INTERFACE   IHXTCPResponse
  236. DECLARE_INTERFACE_(IHXTCPResponse, IUnknown)
  237. {
  238.     /*
  239.      *  IUnknown methods
  240.      */
  241.     STDMETHOD(QueryInterface) (THIS_
  242. REFIID riid,
  243. void** ppvObj) PURE;
  244.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  245.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  246.     /*
  247.      * IHXTCPResponse methods
  248.      */
  249.     /************************************************************************
  250.      * Method:
  251.      *     IHXTCPResponse::ConnectDone
  252.      * Purpose:
  253.      *     A Connect operation has been completed or an error has occurred.
  254.      */
  255.     STDMETHOD(ConnectDone) (THIS_
  256. HX_RESULT status) PURE;
  257.     /************************************************************************
  258.      * Method:
  259.      *     IHXTCPResponse::ReadDone
  260.      * Purpose:
  261.      *     A Read operation has been completed or an error has occurred.
  262.      *     The data is returned in the IHXBuffer.
  263.      */
  264.     STDMETHOD(ReadDone) (THIS_
  265. HX_RESULT status,
  266. IHXBuffer* pBuffer) PURE;
  267.     /************************************************************************
  268.      * Method:
  269.      *     IHXTCPResponse::WriteReady
  270.      * Purpose:
  271.      *     This is the response method for WantWrite.
  272.      *     If HX_RESULT is ok, then the TCP channel is ok to Write to.
  273.      */
  274.     STDMETHOD(WriteReady) (THIS_
  275.      HX_RESULT status) PURE;
  276.     /************************************************************************
  277.      * Method:
  278.      *     IHXTCPResponse::Closed
  279.      * Purpose:
  280.      *     This method is called to inform you that the TCP channel has
  281.      *     been closed by the peer or closed due to error.
  282.      */
  283.     STDMETHOD(Closed) (THIS_
  284. HX_RESULT status) PURE;
  285. };
  286. /****************************************************************************
  287.  * 
  288.  *  Interface:
  289.  * 
  290.  * IHXTCPSocket
  291.  * 
  292.  *  Purpose:
  293.  * 
  294.  * Provides the user with an asynchronous TCP networking interface.
  295.  * 
  296.  *  IID_IHXTCPSocket:
  297.  * 
  298.  * {00000103-0901-11d1-8B06-00A024406D59}
  299.  * 
  300.  */
  301. DEFINE_GUID(IID_IHXTCPSocket, 0x00000103, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  302. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  303. #undef  INTERFACE
  304. #define INTERFACE   IHXTCPSocket
  305. DECLARE_INTERFACE_(IHXTCPSocket, IUnknown)
  306. {
  307.     /*
  308.      *  IUnknown methods
  309.      */
  310.     STDMETHOD(QueryInterface) (THIS_
  311. REFIID riid,
  312. void** ppvObj) PURE;
  313.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  314.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  315.     /*
  316.      * IHXTCPSocket methods
  317.      *
  318.      *  Network addresses and ports are in native byte order
  319.      *  
  320.      */
  321.     STDMETHOD(Init) (THIS_
  322. IHXTCPResponse*    /*IN*/  pTCPResponse) PURE;
  323.     STDMETHOD(SetResponse) (THIS_
  324.      IHXTCPResponse*     pTCPResponse) PURE;
  325.     STDMETHOD(Bind) (THIS_
  326. UINT32     ulLocalAddr,
  327. UINT16      nPort) PURE;
  328.     /*
  329.      * pDestination is a string containing host name or dotted-ip notation
  330.      */
  331.     STDMETHOD(Connect) (THIS_
  332. const char*     pDestination,
  333. UINT16      nPort) PURE;
  334.     STDMETHOD(Read) (THIS_
  335. UINT16     Size) PURE;
  336.     STDMETHOD(Write) (THIS_
  337. IHXBuffer*     pBuffer) PURE;
  338.     /************************************************************************
  339.      * Method:
  340.      *     IHXTCPSocket::WantWrite
  341.      * Purpose:
  342.      *     This method is called when you wish to write a large amount of
  343.      *     data.  If you are only writing small amounts of data, you can
  344.      *     just call Write (all data not ready to be transmitted will be
  345.      *     buffered on your behalf).  When the TCP channel is ready to be
  346.      *     written to, the response interfaces WriteReady method will be 
  347.      *     called.
  348.      */
  349.     STDMETHOD(WantWrite) (THIS) PURE;
  350.     /************************************************************************
  351.      * Method:
  352.      *     IHXTCPSocket::GetForeignAddress
  353.      * Purpose:
  354.      *     Returns the address of the other end of the TCP socket as a
  355.      *     ULONG32 in local host order
  356.      */
  357.     STDMETHOD(GetForeignAddress) (THIS_
  358.      REF(ULONG32) lAddress) PURE;
  359.     STDMETHOD(GetLocalAddress) (THIS_
  360.      REF(ULONG32) lAddress) PURE;
  361.     /************************************************************************
  362.      * Method:
  363.      *     IHXTCPSocket::GetForeignPort
  364.      * Purpose:
  365.      *     Returns the port of the other end of the TCP socket in local
  366.      *      host order.
  367.      */
  368.     STDMETHOD(GetForeignPort) (THIS_
  369.      REF(UINT16) port) PURE;
  370.     STDMETHOD(GetLocalPort) (THIS_
  371.      REF(UINT16) port) PURE;
  372. };
  373. // $Private:
  374. /****************************************************************************
  375.  * 
  376.  *  Interface:
  377.  * 
  378.  * IHXTCPSecureSocket
  379.  * 
  380.  *  Purpose:
  381.  * 
  382.  * When an IHXTCPSocket also supports this interface,
  383.  * it allows you to say it's secure so it tries to use
  384.  * SSL.
  385.  * 
  386.  */
  387. DEFINE_GUID(IID_IHXTCPSecureSocket, 0x00000203, 0x911, 0x21d1, 0x8c, 0x4, 0x0, 
  388. 0xa0, 0x24, 0x40, 0x6d, 0x54);
  389. #undef  INTERFACE
  390. #define INTERFACE   IHXTCPSecureSocket
  391. DECLARE_INTERFACE_(IHXTCPSecureSocket, IUnknown)
  392. {
  393.     /*
  394.      *  IUnknown methods
  395.      */
  396.     STDMETHOD(QueryInterface) (THIS_
  397. REFIID riid,
  398. void** ppvObj) PURE;
  399.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  400.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  401.     /*
  402.      *  IHXTCPSecureSocket method
  403.      */
  404.     STDMETHOD(SetSecure) (THIS_
  405.      BOOL bSecure) PURE;
  406. };
  407. // $EndPrivate.
  408. // $Private:
  409. /****************************************************************************
  410.  * 
  411.  *  Interface:
  412.  * 
  413.  * IHXSSL
  414.  * 
  415.  *  Purpose:
  416.  * 
  417.  * This is the interface to an SSL library.
  418.  * 
  419.  */
  420. DEFINE_GUID(IID_IHXSSL, 0x34e171d4, 0xa8f0,
  421.            0x4832, 0xbc, 0x7d, 0x06, 0xdf, 0xe3, 0xae, 0x58, 0xfd);
  422. DECLARE_INTERFACE_(IHXSSL, IUnknown)
  423. {
  424. /*
  425.  * IUnknown methods
  426.  */
  427. STDMETHOD(QueryInterface) (THIS_
  428. REFIID riid,
  429. void** ppvObj) PURE;
  430. STDMETHOD_(ULONG32, AddRef) (THIS) PURE;
  431. STDMETHOD_(ULONG32, Release) (THIS) PURE;
  432. /*
  433.  *
  434.  */
  435. STDMETHOD(Initialize) (THIS) PURE;
  436. STDMETHOD(Shutdown) (THIS) PURE;
  437. STDMETHOD(PostConnect) (THIS_
  438. LONG32 nSocketNumber) PURE;
  439. STDMETHOD_(LONG32, Read) (THIS_
  440. LONG32 nSocketNumber,
  441. void* buff,
  442. LONG32 buffLen) PURE;
  443. STDMETHOD_(LONG32, Write) (THIS_
  444. LONG32 nSocketNumber,
  445. void* buff,
  446. LONG32 buffLen) PURE;
  447. STDMETHOD(Close) (THIS_
  448. LONG32 nSocketNumber) PURE;
  449. STDMETHOD(SetCallbacks) (THIS_
  450. void* readCallback,
  451. void* writeCallback,
  452. void* closeCallback) PURE;
  453. };
  454. // $EndPrivate.
  455. // $Private:
  456. /****************************************************************************
  457.  * 
  458.  *  Interface:
  459.  * 
  460.  * IHXBufferedSocket
  461.  * 
  462.  *  Purpose:
  463.  * 
  464.  * This provdies a method for doing for doing more optimal
  465.  *      TCP delivery using desired packet size and writev.  
  466.  * 
  467.  *  IID_IHXTCPSocket:
  468.  * 
  469.  * {00001402-0901-11d1-8B06-00A024406D59}
  470.  * 
  471.  */
  472. DEFINE_GUID(IID_IHXBufferedSocket, 
  473.     0x00001402, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
  474. #undef  INTERFACE
  475. #define INTERFACE   IHXBufferedSocket
  476. DECLARE_INTERFACE_(IHXBufferedSocket, IUnknown)
  477. {
  478.     /*
  479.      *  IUnknown methods
  480.      */
  481.     STDMETHOD(QueryInterface) (THIS_
  482. REFIID riid,
  483. void** ppvObj) PURE;
  484.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  485.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  486.     /*
  487.      * IHXTCPSocket methods
  488.      */
  489.     STDMETHOD(BufferedWrite) (THIS_
  490. IHXBuffer* pBuffer) PURE;
  491.     STDMETHOD(FlushWrite) (THIS) PURE;
  492.     STDMETHOD(SetDesiredPacketSize)     (THIS_
  493. UINT32 ulPacketSize) PURE;
  494. };
  495. // $EndPrivate.
  496. /****************************************************************************
  497.  * 
  498.  *  Interface:
  499.  * 
  500.  * IHXListenResponse
  501.  * 
  502.  *  Purpose:
  503.  * 
  504.  * This is the response interface for the asynchronous TCP listening
  505.  * socket interface.
  506.  * 
  507.  *  IID_IHXListenResponse:
  508.  * 
  509.  * {00000104-0901-11d1-8B06-00A024406D59}
  510.  * 
  511.  */
  512. DEFINE_GUID(IID_IHXListenResponse, 0x00000104, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  513. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  514. #undef  INTERFACE
  515. #define INTERFACE   IHXListenResponse
  516. DECLARE_INTERFACE_(IHXListenResponse, IUnknown)
  517. {
  518.     /*
  519.      *  IUnknown methods
  520.      */
  521.     STDMETHOD(QueryInterface) (THIS_
  522. REFIID riid,
  523. void** ppvObj) PURE;
  524.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  525.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  526.     /*
  527.      * IHXListenResponse methods
  528.      */
  529.     STDMETHOD(NewConnection) (THIS_
  530. HX_RESULT status,
  531. IHXTCPSocket* pTCPSocket) PURE;
  532. };
  533. /****************************************************************************
  534.  * 
  535.  *  Interface:
  536.  * 
  537.  * IHXListenSocket
  538.  * 
  539.  *  Purpose:
  540.  * 
  541.  * This interfaces allows you to asynchronously listen on a port for
  542.  * TCP connections.
  543.  * 
  544.  *  IID_IHXListenSocket:
  545.  * 
  546.  * {00000105-0901-11d1-8B06-00A024406D59}
  547.  * 
  548.  */
  549. DEFINE_GUID(IID_IHXListenSocket, 0x00000105, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  550. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  551. #undef  INTERFACE
  552. #define INTERFACE   IHXListenSocket
  553. DECLARE_INTERFACE_(IHXListenSocket, IUnknown)
  554. {
  555.     /*
  556.      *  IUnknown methods
  557.      */
  558.     STDMETHOD(QueryInterface) (THIS_
  559. REFIID riid,
  560. void** ppvObj) PURE;
  561.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  562.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  563.     /*
  564.      * IHXListenSocket methods
  565.      */
  566.     STDMETHOD(Init) (THIS_
  567. UINT32 ulLocalAddr,
  568. UINT16 port,
  569. IHXListenResponse*    /*IN*/ pListenResponse
  570. ) PURE;
  571. };
  572. /****************************************************************************
  573.  * 
  574.  *  Interface:
  575.  * 
  576.  * IHXNetworkServices
  577.  * 
  578.  *  Purpose:
  579.  * 
  580.  * This is a factory interface for the various types of networking
  581.  * interfaces described above.
  582.  * 
  583.  *  IID_IHXNetworkServices:
  584.  * 
  585.  * {00000106-0901-11d1-8B06-00A024406D59}
  586.  * 
  587.  */
  588. DEFINE_GUID(IID_IHXNetworkServices, 0x00000106, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  589. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  590. #undef  INTERFACE
  591. #define INTERFACE   IHXNetworkServices
  592. DECLARE_INTERFACE_(IHXNetworkServices, IUnknown)
  593. {
  594.     /*
  595.      *  IUnknown methods
  596.      */
  597.     STDMETHOD(QueryInterface) (THIS_
  598. REFIID riid,
  599. void** ppvObj) PURE;
  600.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  601.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  602.     /*
  603.      * IHXNetworkServices methods
  604.      */
  605.     /************************************************************************
  606.      * Method:
  607.      *     IHXNetworkServices::CreateTCPSocket
  608.      * Purpose:
  609.      *     Create a new TCP socket.
  610.      */
  611.     STDMETHOD(CreateTCPSocket) (THIS_
  612. IHXTCPSocket**    /*OUT*/  ppTCPSocket) PURE;
  613.     /************************************************************************
  614.      * Method:
  615.      *     IHXNetworkServices::CreateUDPSocket
  616.      * Purpose:
  617.      *     Create a new UDP socket.
  618.      */
  619.     STDMETHOD(CreateUDPSocket) (THIS_
  620. IHXUDPSocket**    /*OUT*/  ppUDPSocket) PURE;
  621.     /************************************************************************
  622.      * Method:
  623.      *     IHXNetworkServices::CreateListenSocket
  624.      * Purpose:
  625.      *     Create a new TCP socket that will listen for connections on a
  626.      *     particular port.
  627.      */
  628.     STDMETHOD(CreateListenSocket)   (THIS_
  629.     IHXListenSocket** /*OUT*/ ppListenSocket
  630.     ) PURE;
  631.     /************************************************************************
  632.      * Method:
  633.      *     IHXNetworkServices::CreateResolver
  634.      * Purpose:
  635.      *     Create a new resolver that can lookup host names
  636.      */
  637.     STDMETHOD(CreateResolver)   (THIS_
  638.      IHXResolver**    /*OUT*/     ppResolver) PURE;
  639. };
  640. /****************************************************************************
  641.  * 
  642.  *  Interface:
  643.  * 
  644.  * IHXNetworkServices2
  645.  * 
  646.  *  Purpose:
  647.  * 
  648.  * This is a factory interface for the various types of networking
  649.  * interfaces described above.
  650.  * 
  651.  *  IID_IHXNetworkServices:
  652.  * 
  653.  * {17951551-5683-11d3-B6BA-00C0F031C237}
  654.  * 
  655.  */
  656. // {17951551-5683-11d3-B6BA-00C0F031C237}
  657. DEFINE_GUID(IID_IHXNetworkServices2, 0x17951551, 0x5683, 0x11d3, 0xb6, 0xba, 0x0, 0xc0, 0xf0, 0x31, 0xc2, 0x37);
  658. #undef  INTERFACE
  659. #define INTERFACE   IHXNetworkServices2
  660. DECLARE_INTERFACE_(IHXNetworkServices2, IHXNetworkServices)
  661. {
  662.     /************************************************************************
  663.      * Method:
  664.      *     IHXNetworkServices2::CreateLBoundTCPSocket
  665.      * Purpose:
  666.      *     Create a new local bound TCP socket.
  667.      */
  668.     STDMETHOD(CreateLBoundTCPSocket) (THIS_
  669. IHXTCPSocket**    /*OUT*/  ppTCPSocket) PURE;
  670. };
  671. /****************************************************************************
  672.  * 
  673.  *  Interface:
  674.  * 
  675.  * IHXUDPResponse
  676.  * 
  677.  *  Purpose:
  678.  * 
  679.  * This is the response interface for the asynchronous UDP networking 
  680.  * interface.
  681.  * 
  682.  *  IID_IHXUDPResponse:
  683.  * 
  684.  * {00000107-0901-11d1-8B06-00A024406D59}
  685.  * 
  686.  */
  687. DEFINE_GUID(IID_IHXUDPResponse, 0x00000107, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  688. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  689. #undef  INTERFACE
  690. #define INTERFACE   IHXUDPResponse
  691. DECLARE_INTERFACE_(IHXUDPResponse, IUnknown)
  692. {
  693.     /*
  694.      *  IUnknown methods
  695.      */
  696.     STDMETHOD(QueryInterface) (THIS_
  697. REFIID riid,
  698. void** ppvObj) PURE;
  699.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  700.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  701.     /*
  702.      * IHXUDPResponse methods
  703.      */
  704.     STDMETHOD(ReadDone) (THIS_
  705. HX_RESULT status,
  706. IHXBuffer* pBuffer,
  707. ULONG32 ulAddr,
  708. UINT16 nPort) PURE;
  709. };
  710. /****************************************************************************
  711.  * 
  712.  *  Interface:
  713.  * 
  714.  * IHXUDPSocket
  715.  * 
  716.  *  Purpose:
  717.  * 
  718.  * Provides the user with an asynchronous UDP networking interface.
  719.  * 
  720.  *  IID_IHXUDPSocket:
  721.  * 
  722.  * {00000108-0901-11d1-8B06-00A024406D59}
  723.  * 
  724.  */
  725. DEFINE_GUID(IID_IHXUDPSocket, 0x00000108, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  726. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  727. #undef  INTERFACE
  728. #define INTERFACE   IHXUDPSocket
  729. DECLARE_INTERFACE_(IHXUDPSocket, IUnknown)
  730. {
  731.     /*
  732.      *  IUnknown methods
  733.      */
  734.     STDMETHOD(QueryInterface) (THIS_
  735. REFIID riid,
  736. void** ppvObj) PURE;
  737.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  738.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  739.     /*
  740.      * IHXUDPSocket methods
  741.      *
  742.      *  Network addresses and ports are in native byte order
  743.      */
  744.     STDMETHOD(Init) (THIS_
  745. ULONG32 ulAddr,
  746. UINT16 nPort,
  747. IHXUDPResponse* pUDPResponse) PURE;
  748.     STDMETHOD(Bind) (THIS_
  749. UINT32     ulLocalAddr,
  750. UINT16      nPort) PURE;
  751.     STDMETHOD(Read) (THIS_
  752. UINT16 Size) PURE;
  753.     STDMETHOD(Write) (THIS_
  754. IHXBuffer* pBuffer) PURE;
  755.     STDMETHOD(WriteTo) (THIS_
  756.      ULONG32 ulAddr,
  757. UINT16 nPort,
  758. IHXBuffer* pBuffer) PURE;
  759.     STDMETHOD(GetLocalPort) (THIS_
  760.      REF(UINT16) port) PURE;
  761.     STDMETHOD(JoinMulticastGroup) (THIS_
  762.      ULONG32     ulMulticastAddr,
  763.      ULONG32     ulInterfaceAddr) PURE;
  764.     
  765.     STDMETHOD(LeaveMulticastGroup) (THIS_
  766.      ULONG32     ulMulticastAddr,
  767.      ULONG32     ulInterfaceAddr) PURE;
  768. };
  769. /****************************************************************************
  770.  * 
  771.  *  Interface:
  772.  * 
  773.  * IHXResolver
  774.  * 
  775.  *  Purpose:
  776.  * 
  777.  * This interface allows you to asynchronously resolve hostnames.
  778.  * 
  779.  *  IID_IHXResolver:
  780.  * 
  781.  * {00000109-0901-11d1-8B06-00A024406D59}
  782.  * 
  783.  */
  784. DEFINE_GUID(IID_IHXResolver, 0x00000109, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  785. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  786. #undef  INTERFACE
  787. #define INTERFACE   IHXResolver
  788. DECLARE_INTERFACE_(IHXResolver, IUnknown)
  789. {
  790.     /*
  791.      *  IUnknown methods
  792.      */
  793.     STDMETHOD(QueryInterface) (THIS_
  794. REFIID riid,
  795. void** ppvObj) PURE;
  796.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  797.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  798.     /*
  799.      * IHXResolver methods
  800.      */
  801.     STDMETHOD(Init) (THIS_
  802. IHXResolverResponse*  pResponse) PURE;
  803.     STDMETHOD(GetHostByName) (THIS_
  804. const char* pHostName) PURE;
  805. };
  806. /****************************************************************************
  807.  * 
  808.  *  Interface:
  809.  * 
  810.  * IHXResolverResponse
  811.  * 
  812.  *  Purpose:
  813.  * 
  814.  * This is the response interface for the asynchronous DNS hostname
  815.  * resolver.
  816.  * 
  817.  *  IID_IHXResolverResponse:
  818.  * 
  819.  * {0000010A-0901-11d1-8B06-00A024406D59}
  820.  * 
  821.  */
  822. DEFINE_GUID(IID_IHXResolverResponse, 0x0000010A, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  823. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  824. #undef  INTERFACE
  825. #define INTERFACE   IHXResolverResponse
  826. DECLARE_INTERFACE_(IHXResolverResponse, IUnknown)
  827. {
  828.     /*
  829.      *  IUnknown methods
  830.      */
  831.     STDMETHOD(QueryInterface) (THIS_
  832. REFIID riid,
  833. void** ppvObj) PURE;
  834.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  835.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  836.     /*
  837.      * IHXResolverResponse methods
  838.      */
  839.     STDMETHOD(GetHostByNameDone) (THIS_
  840. HX_RESULT status,
  841. ULONG32 ulAddr) PURE;
  842. };
  843. /****************************************************************************
  844.  * 
  845.  *  Interface:
  846.  * 
  847.  * IHXInterruptSafe
  848.  * 
  849.  *  Purpose:
  850.  * 
  851.  * This interface is used in Macintosh implementations of callback 
  852.  * functions, renderers, etc... to determine if interrupt time execution  
  853.  * is supported. If this interface is not implemented then it is assumed
  854.  * that interrupt time execution is NOT supported. There are restrictions 
  855.  * on what may be executed at interrupt time; please consult the Macintosh
  856.  * Deferred Task Manager tech notes from Apple.
  857.  * 
  858.  *  IID_IHXInterruptSafe:
  859.  * 
  860.  * {0000010B-0901-11d1-8B06-00A024406D59}
  861.  * 
  862.  */
  863. DEFINE_GUID(IID_IHXInterruptSafe, 0x0000010B, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  864. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  865. #undef  INTERFACE
  866. #define INTERFACE   IHXInterruptSafe
  867. DECLARE_INTERFACE_(IHXInterruptSafe, IUnknown)
  868. {
  869.     /*
  870.      *  IUnknown methods
  871.      */
  872.     STDMETHOD(QueryInterface) (THIS_
  873. REFIID riid,
  874. void** ppvObj) PURE;
  875.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  876.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  877.     /*
  878.      *  IHXInterruptSafe methods
  879.      */
  880.     /************************************************************************
  881.      * Method:
  882.      *     IHXInterruptSafe::IsInterruptSafe
  883.      * Purpose:
  884.      *     This is the function that will be called to determine if
  885.      *     interrupt time execution is supported.
  886.      */
  887.     STDMETHOD_(BOOL,IsInterruptSafe) (THIS) PURE;
  888. };
  889. /****************************************************************************
  890.  * 
  891.  *  Interface:
  892.  * 
  893.  * IHXAsyncIOSelection
  894.  * 
  895.  *  Purpose:
  896.  * 
  897.  *      This interface is implemented by the server/player context on Unix
  898.  *      platforms.  This interface allows your plugin to get callbacks based
  899.  *      I/O events that are normally handled by select().  This interface
  900.  * allows you to setup callbacks which will be executed when a file
  901.  * descriptor is ready for reading, writing, or has an exception.
  902.  * 
  903.  *  IID_IHXAsyncIOSelection:
  904.  * 
  905.  * {0000010C-0901-11d1-8B06-00A024406D59}
  906.  * 
  907.  */
  908. DEFINE_GUID(IID_IHXAsyncIOSelection, 0x0000010C, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  909. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  910. #undef  INTERFACE
  911. #define INTERFACE   IHXAsyncIOSelection
  912. DECLARE_INTERFACE_(IHXAsyncIOSelection, IUnknown)
  913. {
  914.     /*
  915.      *  IUnknown methods
  916.      */
  917.     STDMETHOD(QueryInterface) (THIS_
  918. REFIID riid,
  919. void** ppvObj) PURE;
  920.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  921.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  922.     /*
  923.      * IHXAsyncIOSelection methods
  924.      */
  925.     /************************************************************************
  926.      * Method:
  927.      *     IHXAsyncIOSelection::Add
  928.      * Purpose:
  929.      *     This function will allow you to receive a callback when the
  930.      *     given descriptor is ready for read, write, or has an
  931.      *     exception.  This function is only available on Unix, and is
  932.      *     intended to replace the functionality of select().
  933.      */
  934.     STDMETHOD(Add) (THIS_
  935. IHXCallback* pCallback,
  936. INT32 lFileDescriptor,
  937. UINT32 ulType) PURE;
  938.     /************************************************************************
  939.      * Method:
  940.      *     IHXAsyncIOSelection::Remove
  941.      * Purpose:
  942.      *     This function will allow you remove the callback associated
  943.      *     with the given descriptor from the event handler.
  944.      *     This function is only available on Unix, and is intended to
  945.      *     replace the functionality of select().
  946.      */
  947.     STDMETHOD(Remove)                   (THIS_
  948.                                         INT32           lFileDescriptor,
  949. UINT32 ulType) PURE;
  950. };
  951. /****************************************************************************
  952.  * 
  953.  *  Interface:
  954.  * 
  955.  * IHXUDPMulticastInit
  956.  * 
  957.  *  Purpose:
  958.  * 
  959.  * Provides the user with a way to set the TTL for outgoing multicast
  960.  * UDP packets.  Usually shared with IHXUDPSocket.
  961.  * 
  962.  *  IID_IHXUDPMulticastInit:
  963.  * 
  964.  * {0000010D-0901-11d1-8B06-00A024406D59}
  965.  * 
  966.  */
  967. DEFINE_GUID(IID_IHXUDPMulticastInit, 0x0000010D, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  968. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  969. #undef  INTERFACE
  970. #define INTERFACE   IHXUDPMulticastInit
  971. DECLARE_INTERFACE_(IHXUDPMulticastInit, IUnknown)
  972. {
  973.     /*
  974.      *  IUnknown methods
  975.      */
  976.     STDMETHOD(QueryInterface) (THIS_
  977. REFIID riid,
  978. void** ppvObj) PURE;
  979.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  980.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  981.     /*
  982.      * IHXUDPMulticastInit methods
  983.      *
  984.      */
  985.      /************************************************************************
  986.      * Method:
  987.      *     IHXUDPMulticastInit::InitMulticast
  988.      * Purpose:
  989.      *     This function will set the TTL (time to live) for the UDP socket
  990.      *      so it can be used as a multicast socket, sending packets across
  991.      *      the number of routers specified in the ulTTL parameter.  
  992.      */
  993.     STDMETHOD(InitMulticast) (THIS_
  994.      UINT8     chTTL) PURE;
  995. };
  996. /****************************************************************************
  997.  * 
  998.  *  Interface:
  999.  * 
  1000.  * IHXInterruptState
  1001.  * 
  1002.  *  Purpose:
  1003.  * 
  1004.  * This interface is used in Macintosh implementations to inform the
  1005.  * the client engine when entering & leaving an interupt task. It is
  1006.  * also used to determine if it is currently at interrupt time.
  1007.  * Please consult the Macintosh Deferred Task Manager tech notes from Apple
  1008.  * for information on interrupt tasks.
  1009.  * 
  1010.  *  IID_IHXInterruptState:
  1011.  * 
  1012.  * {0000010E-0901-11d1-8B06-00A024406D59}
  1013.  * 
  1014.  */
  1015. DEFINE_GUID(IID_IHXInterruptState, 0x0000010E, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  1016. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1017. #undef  INTERFACE
  1018. #define INTERFACE   IHXInterruptState
  1019. DECLARE_INTERFACE_(IHXInterruptState, IUnknown)
  1020. {
  1021.     /*
  1022.      *  IUnknown methods
  1023.      */
  1024.     STDMETHOD(QueryInterface) (THIS_
  1025. REFIID riid,
  1026. void** ppvObj) PURE;
  1027.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1028.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1029.     /*
  1030.      *  IHXInterruptState methods
  1031.      */
  1032.     /************************************************************************
  1033.      * Method:
  1034.      *     IHXInterruptState::AtInterruptTime
  1035.      * Purpose:
  1036.      *     This function is called to determine if we are currently at
  1037.      *     interrupt task time.
  1038.      */
  1039.         STDMETHOD_(BOOL,AtInterruptTime) (THIS) PURE;
  1040.     /************************************************************************
  1041.      * Method:
  1042.      *     IHXInterruptState::EnterInterruptState
  1043.      * Purpose:
  1044.      *     This function is called when starting a deferred/interrupt task
  1045.      */
  1046.     STDMETHOD(EnterInterruptState) (THIS) PURE;
  1047.     /************************************************************************
  1048.      * Method:
  1049.      *     IHXInterruptState::LeaveInterruptState
  1050.      * Purpose:
  1051.      *     This function is called when leaving a deferred/interrupt task
  1052.      */
  1053.     STDMETHOD(LeaveInterruptState) (THIS) PURE;
  1054.     /************************************************************************
  1055.      * Method:
  1056.      *     IHXInterruptState::EnableInterrupt
  1057.      * Purpose:
  1058.      *     This function can be called to enable/disable interrupt time 
  1059.      *     processsing
  1060.      */
  1061.     STDMETHOD(EnableInterrupt) (THIS_
  1062. BOOL bEnable) PURE;
  1063.     
  1064.     /************************************************************************
  1065.      * Method:
  1066.      *     IHXInterruptState::IsInterruptEnabled
  1067.      * Purpose:
  1068.      *     This function can be called to find if the core is currently
  1069.      *     interrupt enabled.
  1070.      */
  1071.     STDMETHOD_(BOOL, IsInterruptEnabled)   (THIS) PURE;
  1072. };
  1073. /****************************************************************************
  1074.  * 
  1075.  *  Interface:
  1076.  * 
  1077.  * IHXOptimizedScheduler
  1078.  * 
  1079.  *  Purpose:
  1080.  * 
  1081.  * This interface provides the user with a way of scheduling callbacks
  1082.  * that will be executed at some time in the future.
  1083.  *
  1084.  * This interface should ONLY be used if you need accurately timed 
  1085.  * callbacks. These callbacks should be efficient and should not consume 
  1086.  * much time/CPU. This is not a thread safe interface. The user has to 
  1087.  * take care of synchronization in their callbacks.
  1088.  * 
  1089.  *  IID_IHXOptimizedScheduler:
  1090.  * 
  1091.  * {0000010F-0901-11d1-8B06-00A024406D59}
  1092.  * 
  1093.  */
  1094. DEFINE_GUID(IID_IHXOptimizedScheduler, 0x0000010F, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  1095. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1096. #undef  INTERFACE
  1097. #define INTERFACE   IHXOptimizedScheduler
  1098. DECLARE_INTERFACE_(IHXOptimizedScheduler, IUnknown)
  1099. {
  1100.     /*
  1101.      *  IUnknown methods
  1102.      */
  1103.     STDMETHOD(QueryInterface) (THIS_
  1104. REFIID riid,
  1105. void** ppvObj) PURE;
  1106.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1107.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1108.     /*
  1109.      * IHXOptimizedScheduler methods
  1110.      */
  1111.     /************************************************************************
  1112.      * Method:
  1113.      *     IHXOptimizedScheduler::RelativeEnter
  1114.      * Purpose:
  1115.      *     Schedule a callback to be executed "ms" milliseconds from now
  1116.      *     This function is less percise then AbsoluteEnter and should only
  1117.      *     be used when accurate timing is not critical.
  1118.      */
  1119.     STDMETHOD_(CallbackHandle,RelativeEnter) (THIS_
  1120. IHXCallback* pCallback,
  1121. UINT32 ms) PURE;
  1122.     /************************************************************************
  1123.      * Method:
  1124.      *     IHXOptimizedScheduler::AbsoluteEnter
  1125.      * Purpose:
  1126.      *     Schedule a callback to be executed at time "tVal".
  1127.      */
  1128.     STDMETHOD_(CallbackHandle,AbsoluteEnter) (THIS_
  1129. IHXCallback* pCallback,
  1130. HXTimeval tVal) PURE;
  1131.     /************************************************************************
  1132.      * Method:
  1133.      *     IHXOptimizedScheduler::Remove
  1134.      * Purpose:
  1135.      *     Remove a callback from the scheduler.
  1136.      */
  1137.     STDMETHOD(Remove) (THIS_
  1138.      CallbackHandle Handle) PURE;
  1139.     /************************************************************************
  1140.      * Method:
  1141.      *     IHXOptimizedScheduler::GetCurrentSchedulerTime
  1142.      * Purpose:
  1143.      *     Gives the current time (in the timeline of the scheduler).
  1144.      */
  1145.     STDMETHOD_(HXTimeval,GetCurrentSchedulerTime) (THIS) PURE;
  1146. };
  1147. /****************************************************************************
  1148.  *
  1149.  *  Interface:
  1150.  *
  1151.  *     IHXThreadSafeScheduler
  1152.  *
  1153.  *  Purpose:
  1154.  *
  1155.  *     This interface provides the user with a way of scheduling callbacks
  1156.  *     that will be executed at some time in the future.  This is identical
  1157.  *      to IHXScheduler except the scheduler events are considered thread-safe.
  1158.  *
  1159.  *  IID_IHXThreadSafeScheduler:
  1160.  *
  1161.  *     {00000120-0901-11d1-8B06-00A024406D59}
  1162.  *
  1163.  */
  1164. DEFINE_GUID(IID_IHXThreadSafeScheduler, 0x00000120, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  1165.                        0xa0, 0x24, 0x40, 0x6d, 0x59);
  1166. #undef  INTERFACE
  1167. #define INTERFACE   IHXThreadSafeScheduler
  1168. DECLARE_INTERFACE_(IHXThreadSafeScheduler, IUnknown)
  1169. {
  1170.     /*
  1171.      *  IUnknown methods
  1172.      */
  1173.     STDMETHOD(QueryInterface)          (THIS_
  1174.                                        REFIID riid,
  1175.                                        void** ppvObj) PURE;
  1176.     STDMETHOD_(ULONG32,AddRef)         (THIS) PURE;
  1177.     STDMETHOD_(ULONG32,Release)                (THIS) PURE;
  1178.     /*
  1179.      * IHXThreadSafeScheduler methods
  1180.      */
  1181.     /************************************************************************
  1182.      * Method:
  1183.      *     IHXThreadSafeScheduler::RelativeEnter
  1184.      * Purpose:
  1185.      *     Schedule a callback to be executed "ms" milliseconds from now
  1186.      *     This function is less percise then AbsoluteEnter and should only
  1187.      *     be used when accurate timing is not critical.
  1188.      */
  1189.     STDMETHOD_(CallbackHandle,RelativeEnter)   (THIS_
  1190.                                                IHXCallback* pCallback,
  1191.                                                UINT32 ms) PURE;
  1192.     /************************************************************************
  1193.      * Method:
  1194.      *     IHXThreadSafeScheduler::AbsoluteEnter
  1195.      * Purpose:
  1196.      *     Schedule a callback to be executed at time "tVal".
  1197.      */
  1198.     STDMETHOD_(CallbackHandle,AbsoluteEnter)   (THIS_
  1199.                                                IHXCallback* pCallback,
  1200.                                                HXTimeval tVal) PURE;
  1201.     /************************************************************************
  1202.      * Method:
  1203.      *     IHXThreadSafeScheduler::Remove
  1204.      * Purpose:
  1205.      *     Remove a callback from the scheduler.
  1206.      */
  1207.     STDMETHOD(Remove)          (THIS_
  1208.                                CallbackHandle Handle) PURE;
  1209. };
  1210. /****************************************************************************
  1211.  *
  1212.  *  Interface:
  1213.  *
  1214.  *     IHXProcessEntryPoint
  1215.  *
  1216.  *  Purpose:
  1217.  *
  1218.  *     This interface is the entry point for an IHXProcess
  1219.  *
  1220.  *  IID_IHXProcessEntryPoint
  1221.  *
  1222.  *     {00000123-0901-11d1-8B06-00A024406D59}
  1223.  *
  1224.  */
  1225. DEFINE_GUID(IID_IHXProcessEntryPoint, 0x00000123, 0x901, 0x11d1, 0x8b, 0x6,
  1226.             0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1227. #undef  INTERFACE
  1228. #define INTERFACE   IHXProcessEntryPoint
  1229. DECLARE_INTERFACE_(IHXProcessEntryPoint, IUnknown)
  1230. {
  1231.     /*
  1232.      *  IUnknown methods
  1233.      */
  1234.     STDMETHOD(QueryInterface)          (THIS_
  1235.                                        REFIID riid,
  1236.                                        void** ppvObj) PURE;
  1237.     STDMETHOD_(ULONG32,AddRef)         (THIS) PURE;
  1238.     STDMETHOD_(ULONG32,Release)        (THIS) PURE;
  1239.     STDMETHOD(Func)                   (THIS_
  1240.                                        IUnknown* pContext) PURE;
  1241. };
  1242. /****************************************************************************
  1243.  *
  1244.  *  Interface:
  1245.  *
  1246.  *     IHXProcess
  1247.  *
  1248.  *  Purpose:
  1249.  *
  1250.  *     This interface allows you to create new server processes and specify
  1251.  *  an entry point.  It is queried off the context.
  1252.  *
  1253.  *  IID_IHXProcess
  1254.  *
  1255.  *     {00000122-0901-11d1-8B06-00A024406D59}
  1256.  *
  1257.  */
  1258. DEFINE_GUID(IID_IHXProcess, 0x00000122, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  1259.                        0xa0, 0x24, 0x40, 0x6d, 0x59);
  1260. #undef  INTERFACE
  1261. #define INTERFACE   IHXProcess
  1262. DECLARE_INTERFACE_(IHXProcess, IUnknown)
  1263. {
  1264.     /*
  1265.      *  IUnknown methods
  1266.      */
  1267.     STDMETHOD(QueryInterface)          (THIS_
  1268.                                        REFIID riid,
  1269.                                        void** ppvObj) PURE;
  1270.     STDMETHOD_(ULONG32,AddRef)         (THIS) PURE;
  1271.     STDMETHOD_(ULONG32,Release)        (THIS) PURE;
  1272.     STDMETHOD(Start)                   (THIS_
  1273.                                        const char* pProcessName,
  1274.                                        IHXProcessEntryPoint* pEntryPoint) PURE;
  1275. };
  1276. /****************************************************************************
  1277.  * 
  1278.  *  Interface:
  1279.  * 
  1280.  * IHXLoadBalancedListen
  1281.  * 
  1282.  *  Purpose:
  1283.  * 
  1284.  * This interface is queried off of IHXListenSocket.  It allows
  1285.  * a plugin to specify that it wants the server to load balance
  1286.  * multiple instances of itself.  The server will instantiate multiple
  1287.  * instances of the plugin as needed based on socket / descriptor limits.
  1288.  * Each plugin instance should attempt to listen on the same port as
  1289.  * other instances (they will share the port).
  1290.  * 
  1291.  *  IID_IHXLoadBalancedListen:
  1292.  * 
  1293.  * {00000110-0901-11d1-8B06-00A024406D59}
  1294.  * 
  1295.  */
  1296. DEFINE_GUID(IID_IHXLoadBalancedListen, 0x00000110, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  1297. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1298. #undef  INTERFACE
  1299. #define INTERFACE   IHXLoadBalancedListen
  1300. DECLARE_INTERFACE_(IHXLoadBalancedListen, IUnknown)
  1301. {
  1302.     /*
  1303.      *  IUnknown methods
  1304.      */
  1305.     STDMETHOD(QueryInterface) (THIS_
  1306. REFIID riid,
  1307. void** ppvObj) PURE;
  1308.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1309.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1310.     /*
  1311.      * IHXLoadBalancedListen methods
  1312.      */
  1313.     /************************************************************************
  1314.      * Method:
  1315.      *     IHXLoadBalancedListen::SetID
  1316.      * Purpose:
  1317.      *     This function set's the unique ID for this listen socket.  This
  1318.      *     ID is used to determine whether or not different instances of
  1319.      *     a plugin trying to listen on a single port are actually the
  1320.      *     same plugin.  Without this function, it would be possible for
  1321.      *     two completely different plugins to listen on the same port using
  1322.      *     the load balanced listener.
  1323.      */
  1324.     STDMETHOD(SetID) (THIS_
  1325.      REFIID ID) PURE;
  1326.     /************************************************************************
  1327.      * Method:
  1328.      *     IHXLoadBalancedListen::SetReserveLimit
  1329.      * Purpose:
  1330.      *     Sets the reserve limit for descriptors / sockets.  If less
  1331.      *     than reserve limit descriptors / sockets are left then a new
  1332.      *     instance of the plugin will be created.
  1333.      */
  1334.     STDMETHOD(SetReserveLimit) (THIS_
  1335.      UINT32 ulDescriptors,
  1336. UINT32 ulSockets) PURE;
  1337. };
  1338. /****************************************************************************
  1339.  * 
  1340.  *  Interface:
  1341.  * 
  1342.  * IHXOverrideDefaultServices
  1343.  * 
  1344.  *  Purpose:
  1345.  * 
  1346.  * This interface is queried off of the context.  It allows
  1347.  * a plugin to override any default services provided by the G2 system.
  1348.  * Currently, it is supported only on the client side. 
  1349.  * You may currently override IHXNetworkServices using this interface
  1350.  * You can use the same interface to later restore back the overriden services.
  1351.  * This is done by calling the same OverrideServices() function with the 
  1352.  * original service QIed before the initial override.
  1353.  * 
  1354.  *  IID_IHXOverrideDefaultServices:
  1355.  * 
  1356.  * {00000111-0901-11d1-8B06-00A024406D59}
  1357.  * 
  1358.  */
  1359. DEFINE_GUID(IID_IHXOverrideDefaultServices, 0x00000111, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  1360. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1361. #undef  INTERFACE
  1362. #define INTERFACE   IHXOverrideDefaultServices
  1363. DECLARE_INTERFACE_(IHXOverrideDefaultServices, IUnknown)
  1364. {
  1365.     /*
  1366.      * IUnknown methods
  1367.      */
  1368.     STDMETHOD(QueryInterface)   (THIS_
  1369.                                 REFIID riid,
  1370. void** ppvObj) PURE;
  1371.     STDMETHOD_(ULONG32,AddRef)  (THIS) PURE;
  1372.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1373.    /*
  1374.     * IHXOverrideDefaultServices methods
  1375.     */
  1376.    /************************************************************************
  1377.     *  Method:
  1378.     *      IHXOverrideDefaultServices::OverrideServices
  1379.     *  Purpose:
  1380.     *      Override default services provided by the G2 system.
  1381.     *
  1382.     */
  1383.     STDMETHOD(OverrideServices)         (THIS_
  1384. IUnknown* pContext) PURE;
  1385. };
  1386. typedef enum _HX_SOCKET_OPTION
  1387. {
  1388.     HX_SOCKOPT_REUSE_ADDR,
  1389.     HX_SOCKOPT_REUSE_PORT,
  1390.     HX_SOCKOPT_BROADCAST,
  1391.     HX_SOCKOPT_SET_RECVBUF_SIZE,
  1392.     HX_SOCKOPT_SET_SENDBUF_SIZE,
  1393.     HX_SOCKOPT_MULTICAST_IF,
  1394.     HX_SOCKOPT_IP_TOS
  1395. } HX_SOCKET_OPTION;
  1396. /****************************************************************************
  1397.  * 
  1398.  *  Interface:
  1399.  * 
  1400.  * IHXSetSocketOption
  1401.  * 
  1402.  *  Purpose:
  1403.  * 
  1404.  * Set sockt option
  1405.  * 
  1406.  *  IID_IHXSetSocketOption:
  1407.  * 
  1408.  * IID_IHXSetSocketOption:    {00000114-0901-11d1-8B06-00A024406D59}
  1409.  * 
  1410.  */
  1411. DEFINE_GUID(IID_IHXSetSocketOption,
  1412.     0x00000114, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1413. #undef  INTERFACE
  1414. #define INTERFACE   IHXSetSocketOption
  1415. DECLARE_INTERFACE_(IHXSetSocketOption, IUnknown)
  1416. {
  1417.     /*
  1418.      *  IUnknown methods
  1419.      */
  1420.     STDMETHOD(QueryInterface) (THIS_
  1421. REFIID riid,
  1422. void** ppvObj) PURE;
  1423.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1424.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1425.     /*
  1426.      * IHXListenSocket methods
  1427.      */
  1428.     STDMETHOD(SetOption) (THIS_ 
  1429.  HX_SOCKET_OPTION option,
  1430.  UINT32 ulValue) PURE;  
  1431. };
  1432. #define HX_THREADSAFE_METHOD_FF_GETPACKET 0x00000001
  1433. /*
  1434.  * FileFormat::GetPacket() only calls:
  1435.  *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, 
  1436.  *     FS->Read(), FS->Close(), FS->Seek(),
  1437.  *     FFR->PacketReady(), FFR->StreamDone()
  1438.  *     Context->Scheduler->*,
  1439.  *     CCF->CI(Mutex), Mutex->*
  1440.  *     Context->ErrorMessages
  1441.  *
  1442.  * XXXSMPNOW
  1443.  */
  1444. #define HX_THREADSAFE_METHOD_FS_READ 0x00000002
  1445. /*
  1446.  * FileSystem::Read()/Seek()/Close() only calls:
  1447.  *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, 
  1448.  *     FS->Read(), FS->Close(), FS->Seek(),
  1449.  *     Context->Scheduler->*,
  1450.  *     CCF->CI(Mutex), Mutex->*
  1451.  *     Context->ErrorMessages
  1452.  *
  1453.  * XXXSMPNOW
  1454.  */
  1455. #define HX_THREADSAFE_METHOD_FSR_READDONE 0x00000004
  1456. /*
  1457.  * FileFormat::ReadDone()/SeekDone()/CloseDone() only calls:
  1458.  *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, 
  1459.  *     FS->Read(), FS->Close(), FS->Seek(),
  1460.  *     FFR->PacketReady(), FFR->StreamDone()
  1461.  *     Context->Scheduler->*,
  1462.  *     CCF->CI(Mutex), Mutex->*
  1463.  *     Context->ErrorMessages
  1464.  *
  1465.  * XXXSMPNOW
  1466.  */
  1467. #define HX_THREADSAFE_METHOD_CACHE_FILE 0x00000008
  1468. /*
  1469.  * FileSystem::Read()/Seek()/Close() only calls:
  1470.  *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, 
  1471.  *     FS->Read(), FS->Close(), FS->Seek(),
  1472.  *     IHXCacheFile->*, IHXCacheFileResponse->*,
  1473.  *     Context->Scheduler->*,
  1474.  *     CCF->CI(Mutex), Mutex->*
  1475.  *     Context->ErrorMessages
  1476.  *
  1477.  * XXXSMPNOW
  1478.  */
  1479. #define HX_THREADSAFE_METHOD_CACHE_FILE_RESPONSE 0x00000010
  1480. /*
  1481.  * FileSystem::Read()/Seek()/Close() only calls:
  1482.  *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, 
  1483.  *     FS->Read(), FS->Close(), FS->Seek(),
  1484.  *     IHXCacheFile->*, IHXCacheFileResponse->*,
  1485.  *     Context->Scheduler->*,
  1486.  *     CCF->CI(Mutex), Mutex->*
  1487.  *     Context->ErrorMessages
  1488.  *
  1489.  * XXXSMPNOW
  1490.  */
  1491. /*
  1492.  * Thread Safe flags for IHXDataConvert
  1493.  */
  1494. #define HX_THREADSAFE_METHOD_CONVERT_HEADERS 0x00000020
  1495. /*
  1496.  * IHXDataConvert::ConvertXXX()/CtrlBufferReady() only calls:
  1497.  *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, 
  1498.  *     IHXDataConvertResponse->*
  1499.  *     Context->Scheduler->*,
  1500.  *     CCF->CI(Mutex), Mutex->*
  1501.  *     Context->ErrorMessages
  1502.  *
  1503.  * XXXSMPNOW
  1504.  */
  1505. #define HX_THREADSAFE_METHOD_CONVERT_DATA 0x00000040
  1506. /*
  1507.  * IHXDataConvert::ConvertXXX()/CtrlBufferReady() only calls:
  1508.  *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, 
  1509.  *     IHXDataConvertResponse->*
  1510.  *     Context->Scheduler->*,
  1511.  *     CCF->CI(Mutex), Mutex->*
  1512.  *     Context->ErrorMessages
  1513.  *
  1514.  * XXXSMPNOW
  1515.  */
  1516. #define HX_THREADSAFE_METHOD_CONVERT_CTRL_BUFFER_READY 0x00000080
  1517. /*
  1518.  * IHXDataConvert::ConvertXXX()/CtrlBufferReady() only calls:
  1519.  *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, 
  1520.  *     IHXDataConvertResponse->*
  1521.  *     Context->Scheduler->*,
  1522.  *     CCF->CI(Mutex), Mutex->*
  1523.  *     Context->ErrorMessages
  1524.  *
  1525.  * XXXSMPNOW
  1526.  */
  1527. #define HX_THREADSAFE_METHOD_SOCKET_READDONE  0x00000100
  1528. #define HX_THREADSAFE_METHOD_ALL  (~0)
  1529. /****************************************************************************
  1530.  * 
  1531.  *  Interface:
  1532.  * 
  1533.  * IHXThreadSafeMethods
  1534.  * 
  1535.  *  Purpose:
  1536.  * 
  1537.  * XXXSMPNOW
  1538.  * 
  1539.  *  IID_IHXThreadSafeMethods:
  1540.  * 
  1541.  * {00000115-0901-11d1-8B06-00A024406D59}
  1542.  * 
  1543.  */
  1544. DEFINE_GUID(IID_IHXThreadSafeMethods, 0x00000115, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  1545. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1546. #undef  INTERFACE
  1547. #define INTERFACE   IHXThreadSafeMethods
  1548. DECLARE_INTERFACE_(IHXThreadSafeMethods, IUnknown)
  1549. {
  1550.     /*
  1551.      * IUnknown methods
  1552.      */
  1553.     STDMETHOD(QueryInterface) (THIS_
  1554. REFIID riid,
  1555. void** ppvObj) PURE;
  1556.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1557.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1558.     /*
  1559.      * IHXThreadSafeMethods methods
  1560.      */
  1561.     /************************************************************************
  1562.      * Method:
  1563.      *     IHXThreadSafeMethods::IsThreadSafe
  1564.      * Purpose:
  1565.      *     XXXSMPNOW
  1566.      */
  1567.     STDMETHOD_(UINT32,IsThreadSafe)     (THIS) PURE;
  1568. };
  1569. /****************************************************************************
  1570.  * 
  1571.  *  Interface:
  1572.  * 
  1573.  * IHXMutex
  1574.  * 
  1575.  *  Purpose:
  1576.  * 
  1577.  * XXXSMPNOW
  1578.  * 
  1579.  *  IID_IHXMutex:
  1580.  * 
  1581.  * {00000116-0901-11d1-8B06-00A024406D59}
  1582.  * 
  1583.  */
  1584. DEFINE_GUID(IID_IHXMutex, 0x00000116, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  1585. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1586. #undef  INTERFACE
  1587. #define INTERFACE   IHXMutex
  1588. /*
  1589.  *  The IHXCommonClassFactory supports creating an instance
  1590.  *  of this object.
  1591.  */
  1592. #define CLSID_IHXMutex IID_IHXMutex
  1593. DECLARE_INTERFACE_(IHXMutex, IUnknown)
  1594. {
  1595.     /*
  1596.      * IUnknown methods
  1597.      */
  1598.     STDMETHOD(QueryInterface) (THIS_
  1599. REFIID riid,
  1600. void** ppvObj) PURE;
  1601.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1602.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1603.     /*
  1604.      * IHXMutex methods
  1605.      */
  1606.      /* XXXSMPNOW Comments */
  1607.     STDMETHOD(Lock)     (THIS) PURE;
  1608.     STDMETHOD(TryLock)     (THIS) PURE;
  1609.     STDMETHOD(Unlock)     (THIS) PURE;
  1610. };
  1611. // $Private:
  1612. /****************************************************************************
  1613.  * 
  1614.  *  Interface:
  1615.  * 
  1616.  * IHXFastPathNetWrite
  1617.  * 
  1618.  *  Purpose:
  1619.  * 
  1620.  * Private interface for high speed UDP output.
  1621.  * 
  1622.  *  IID_IHXFastPathNetWrite:
  1623.  * 
  1624.  * {00000117-0901-11d1-8B06-00A024406D59}
  1625.  * 
  1626.  */
  1627. DEFINE_GUID(IID_IHXFastPathNetWrite, 0x00000117, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  1628. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1629. #undef  INTERFACE
  1630. #define INTERFACE   IHXFastPathNetWrite
  1631. DECLARE_INTERFACE_(IHXFastPathNetWrite, IUnknown)
  1632. {
  1633.     /*
  1634.      *  IUnknown methods
  1635.      */
  1636.     STDMETHOD(QueryInterface) (THIS_
  1637. REFIID riid,
  1638. void** ppvObj) PURE;
  1639.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1640.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1641.     /*
  1642.      * IHXFastPathNetWrite methods
  1643.      *
  1644.      */
  1645.     STDMETHOD(FastWrite) (THIS_
  1646. const UINT8* pBuffer, UINT32 ulLen) PURE;
  1647. };
  1648. /****************************************************************************
  1649.  * 
  1650.  *  Interface:
  1651.  * 
  1652.  * IHXWouldBlockResponse
  1653.  * 
  1654.  *  Purpose:
  1655.  * 
  1656.  * Get notifications of EWOULDBLOCK conditions.
  1657.  * 
  1658.  *  IID_IHXWouldBlockResponse:
  1659.  * 
  1660.  * {00000118-0901-11d1-8B06-00A024406D59}
  1661.  * 
  1662.  */
  1663. DEFINE_GUID(IID_IHXWouldBlockResponse, 0x00000118, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1664. #undef  INTERFACE
  1665. #define INTERFACE   IHXWouldBlockResponse
  1666. DECLARE_INTERFACE_(IHXWouldBlockResponse, IUnknown)
  1667. {
  1668.     /*
  1669.      *  IUnknown methods
  1670.      */
  1671.     STDMETHOD(QueryInterface) (THIS_
  1672. REFIID riid,
  1673. void** ppvObj) PURE;
  1674.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1675.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1676.     /*
  1677.      * IHXWouldBlockResponse methods
  1678.      *
  1679.      */
  1680.     
  1681.     
  1682.     /*
  1683.      * WouldBlock
  1684.      *
  1685.      * Return HXR_OK to go into blocked mode, causing a future
  1686.      * WouldBlockCleared call.  HXR_anythingelse to ignore.
  1687.      */
  1688.     
  1689.     STDMETHOD(WouldBlock) (THIS_ UINT32 id) PURE;
  1690.     STDMETHOD(WouldBlockCleared)(THIS_ UINT32 id) PURE;
  1691. };
  1692. /****************************************************************************
  1693.  * 
  1694.  *  Interface:
  1695.  * 
  1696.  * IHXWouldBlock
  1697.  * 
  1698.  *  Purpose:
  1699.  * 
  1700.  * Notifier for EWOULDBLOCK conditions.
  1701.  * 
  1702.  *  IID_IHXWouldBlock:
  1703.  * 
  1704.  * {00000119-0901-11d1-8B06-00A024406D59}
  1705.  * 
  1706.  */
  1707. DEFINE_GUID(IID_IHXWouldBlock, 0x00000119, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  1708. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1709. #undef  INTERFACE
  1710. #define INTERFACE   IHXWouldBlock
  1711. DECLARE_INTERFACE_(IHXWouldBlock, IUnknown)
  1712. {
  1713.     /*
  1714.      *  IUnknown methods
  1715.      */
  1716.     STDMETHOD(QueryInterface) (THIS_
  1717. REFIID riid,
  1718. void** ppvObj) PURE;
  1719.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1720.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1721.     /*
  1722.      * IHXWouldBlock methods
  1723.      *
  1724.      */
  1725.     
  1726.     STDMETHOD(WantWouldBlock) (THIS_
  1727.      IHXWouldBlockResponse*, UINT32 id) PURE;
  1728. };
  1729. /****************************************************************************
  1730.  *
  1731.  *  Interface:
  1732.  *
  1733.  *     IHXSharedUDPServices
  1734.  *
  1735.  *  Purpose:
  1736.  *
  1737.  *     Private interface for tying a UDP socket (via IHXUDPSocketContext) to
  1738.  *  a shared UDP resend port.  Used to send UDP packet resend requests to one
  1739.  *  shared UDP port per streamer.
  1740.  *
  1741.  *  IID_IHXSharedUDPServices
  1742.  *
  1743.  *     {00000123-0901-11d1-8B06-00A024406D59}
  1744.  *
  1745.  */
  1746. DEFINE_GUID(IID_IHXSharedUDPServices, 0x00000124, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  1747.                        0xa0, 0x24, 0x40, 0x6d, 0x59);
  1748. #undef  INTERFACE
  1749. #define INTERFACE   IHXSharedUDPServices
  1750. DECLARE_INTERFACE_(IHXSharedUDPServices, IUnknown)
  1751. {
  1752.     /*
  1753.      *  IUnknown methods
  1754.      */
  1755.     STDMETHOD(QueryInterface)          (THIS_
  1756.                                        REFIID riid,
  1757.                                        void** ppvObj) PURE;
  1758.     STDMETHOD_(ULONG32,AddRef)         (THIS) PURE;
  1759.     STDMETHOD_(ULONG32,Release)        (THIS) PURE;
  1760.     /*
  1761.      * IHXSharedUDPServices methods
  1762.      */
  1763.     STDMETHOD(RegisterSharedResponse) (THIS_
  1764.  IHXUDPResponse* response,
  1765.  UINT16 sPortEnum) PURE;
  1766.     STDMETHOD(UnregisterSharedResponse) (THIS) PURE;
  1767.     STDMETHOD_(UINT16, GetSharedPort) (THIS) PURE;
  1768. };
  1769. /****************************************************************************
  1770.  *
  1771.  *  Interface:
  1772.  *
  1773.  *     IHXThreadLocal
  1774.  *
  1775.  *  Purpose:
  1776.  *
  1777.  *     Thread-local information, namely the procnum.
  1778.  *
  1779.  *  IID_IHXThreadLocal
  1780.  *
  1781.  *     {00000125-0901-11d1-8B06-00A024406D59}
  1782.  *
  1783.  */
  1784. DEFINE_GUID(IID_IHXThreadLocal, 0x00000125, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  1785.                        0xa0, 0x24, 0x40, 0x6d, 0x59);
  1786. #undef  INTERFACE
  1787. #define INTERFACE   IHXThreadLocal
  1788. #define CLSID_IHXThreadLocal IID_IHXThreadLocal
  1789. DECLARE_INTERFACE_(IHXThreadLocal, IUnknown)
  1790. {
  1791.     /*
  1792.      *  IUnknown methods
  1793.      */
  1794.     STDMETHOD(QueryInterface)          (THIS_
  1795.                                        REFIID riid,
  1796.                                        void** ppvObj) PURE;
  1797.     STDMETHOD_(ULONG32,AddRef)         (THIS) PURE;
  1798.     STDMETHOD_(ULONG32,Release)        (THIS) PURE;
  1799.     /*
  1800.      * IHXThreadLocal methods
  1801.      */
  1802.     /*
  1803.      *  IHXThreadLocal::GetMaxThreads()
  1804.      *
  1805.      *  Maximum number of threads on the system (MAX_THREADS on server)
  1806.      */
  1807.     STDMETHOD_(int, GetMaxThreads) (THIS) PURE;
  1808.     /*
  1809.      *  IHXThreadLocal::GetThreadNumber()
  1810.      *
  1811.      *  This thread's number (< MAX_THREADS)
  1812.      */
  1813.     STDMETHOD_(int, GetThreadNumber) (THIS) PURE;
  1814. };
  1815. /****************************************************************************
  1816.  *
  1817.  *  Interface:
  1818.  *
  1819.  *     IHXMemoryServices
  1820.  *
  1821.  *  Purpose:
  1822.  *
  1823.  *     Exposes server memory functions
  1824.  *
  1825.  *  IID_IHXMemoryServices
  1826.  *
  1827.  *     {00000126-0901-11d1-8B06-00A024406D59}
  1828.  *
  1829.  */
  1830. DEFINE_GUID(IID_IHXMemoryServices, 0x00000126, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  1831.                        0xa0, 0x24, 0x40, 0x6d, 0x59);
  1832. #undef  INTERFACE
  1833. #define INTERFACE   IHXMemoryServices
  1834. #define CLSID_IHXMemoryServices IID_IHXMemoryServices
  1835. DECLARE_INTERFACE_(IHXMemoryServices, IUnknown)
  1836. {
  1837.     /*
  1838.      *  IUnknown methods
  1839.      */
  1840.     STDMETHOD(QueryInterface)          (THIS_
  1841.                                        REFIID riid,
  1842.                                        void** ppvObj) PURE;
  1843.     STDMETHOD_(ULONG32,AddRef)         (THIS) PURE;
  1844.     STDMETHOD_(ULONG32,Release)        (THIS) PURE;
  1845.     /*
  1846.      * IHXMemoryServices methods
  1847.      */
  1848.     /*
  1849.      *  IHXMemoryServices::ValidateMemory()
  1850.      *
  1851.      *  Make consistency checks on the server shared memory space.
  1852.      *
  1853.      * lStartPage, lPages
  1854.      *
  1855.      * Specifies a page range to allow smaller searches, if you have a 
  1856.      * repro case and want to fail as soon as possible after the scribble.
  1857.      * Use lPages == 0 to check to the last page.  (Pages in the shared
  1858.      * space are numbered starting from zero.  You can decide on a range
  1859.      * based on the printout of previous errors.)
  1860.      *
  1861.      * ulFlags
  1862.      *
  1863.      * 0x00000001 fail -- abort() -- on finding an error.
  1864.      * 0x00000002 do rudimentary checks on internal SharedMemory data arrays.
  1865.      *
  1866.      */
  1867.     STDMETHOD(ValidateMemory) (THIS_
  1868.  INT32 lStartPage, 
  1869.  INT32 lPages, 
  1870.  UINT32 ulFlags) PURE;
  1871. };
  1872. typedef enum _HX_PRIVATE_SOCKET_OPTION
  1873. {
  1874.     HX_PRIVATE_SOCKOPT_IGNORE_WSAECONNRESET
  1875. } HX_PRIVATE_SOCKET_OPTION;
  1876. /****************************************************************************
  1877.  * 
  1878.  *  Interface:
  1879.  * 
  1880.  * IHXSetPrivateSocketOption
  1881.  * 
  1882.  *  Purpose:
  1883.  * 
  1884.  * Set private sockt option
  1885.  * 
  1886.  *  IID_IHXSetPrivateSocketOption:
  1887.  *
  1888.  *     {00000127-0901-11d1-8B06-00A024406D59}
  1889.  * 
  1890.  */
  1891. DEFINE_GUID(IID_IHXSetPrivateSocketOption, 
  1892.     0x00000127, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1893.  
  1894. #undef  INTERFACE
  1895. #define INTERFACE   IHXSetPrivateSocketOption
  1896. DECLARE_INTERFACE_(IHXSetPrivateSocketOption, IUnknown)
  1897. {
  1898.     /*
  1899.      *  IUnknown methods
  1900.      */
  1901.     STDMETHOD(QueryInterface) (THIS_
  1902. REFIID riid,
  1903. void** ppvObj) PURE;
  1904.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1905.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1906.     /*
  1907.      * IHXSetPrivateSocketOption methods
  1908.      */
  1909.     STDMETHOD(SetOption) (THIS_ 
  1910.  HX_PRIVATE_SOCKET_OPTION option,
  1911.  UINT32 ulValue) PURE;  
  1912. };
  1913. /****************************************************************************
  1914.  * 
  1915.  *  Interface:
  1916.  * 
  1917.  * IHXNetInterfaces
  1918.  * 
  1919.  *  Purpose:
  1920.  * 
  1921.  * Network Interfaces
  1922.  * 
  1923.  *  IID_IHXNetInterfaces:
  1924.  *
  1925.  *     {00000128-0901-11d1-8B06-00A024406D59}
  1926.  * 
  1927.  */
  1928. typedef enum
  1929. {
  1930.     UNKNOWN,
  1931.     LOOPBACK,
  1932.     POINTTOPOINT,
  1933.     BROADCAST
  1934. } NIType;
  1935. typedef struct _NIInfo
  1936. {
  1937.     NIType type;
  1938.     BOOL bActive;
  1939.     UINT32 ulNetAddress;
  1940.     UINT32 ulNetMask;
  1941. } NIInfo;
  1942. DEFINE_GUID(IID_IHXNetInterfaces, 
  1943.     0x00000128, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1944.  
  1945. #undef  INTERFACE
  1946. #define INTERFACE   IHXNetInterfaces
  1947. DECLARE_INTERFACE_(IHXNetInterfaces, IUnknown)
  1948. {
  1949.     /*
  1950.      *  IUnknown methods
  1951.      */
  1952.     STDMETHOD(QueryInterface) (THIS_
  1953. REFIID riid,
  1954. void** ppvObj) PURE;
  1955.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1956.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1957.     /*
  1958.      * IHXNetworkInterfaces methods
  1959.      */
  1960.     STDMETHOD(UpdateNetInterfaces) (THIS) PURE;
  1961.     STDMETHOD_(UINT32, GetNumOfNetInterfaces) (THIS) PURE;
  1962.     STDMETHOD(GetNetInterfaces) (THIS_
  1963. UINT16 lIndex,
  1964. REF(NIInfo*) pNIInfo) PURE;
  1965.     STDMETHOD(AddAdviseSink) (THIS_
  1966. IHXNetInterfacesAdviseSink* pSink) PURE;
  1967.     STDMETHOD(RemoveAdviseSink) (THIS_
  1968. IHXNetInterfacesAdviseSink* pSink) PURE;
  1969. };
  1970. /****************************************************************************
  1971.  * 
  1972.  *  Interface:
  1973.  * 
  1974.  * IHXNetInterfacesAdviseSink
  1975.  * 
  1976.  *  Purpose:
  1977.  * 
  1978.  * Network Interfaces Advise Sink
  1979.  * 
  1980.  *  IID_IHXNetInterfaces:
  1981.  *
  1982.  *     {00000129-0901-11d1-8B06-00A024406D59}
  1983.  * 
  1984.  */
  1985. DEFINE_GUID(IID_IHXNetInterfacesAdviseSink, 
  1986.     0x00000129, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1987.  
  1988. #undef  INTERFACE
  1989. #define INTERFACE   IHXNetInterfacesAdviseSink
  1990. DECLARE_INTERFACE_(IHXNetInterfacesAdviseSink, IUnknown)
  1991. {
  1992.     /*
  1993.      *  IUnknown methods
  1994.      */
  1995.     STDMETHOD(QueryInterface) (THIS_
  1996. REFIID riid,
  1997. void** ppvObj) PURE;
  1998.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1999.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  2000.     /*
  2001.      * IHXNetInterfacesAdviseSink methods
  2002.      */
  2003.     STDMETHOD(NetInterfacesUpdated) (THIS) PURE;
  2004. };
  2005. // $EndPrivate.
  2006. /****************************************************************************
  2007.  * 
  2008.  *  Interface:
  2009.  * 
  2010.  * IHXNetworkInterfaceEnumerator
  2011.  * 
  2012.  *  Purpose:
  2013.  * 
  2014.  * Enumerate interfaces on a box.
  2015.  * 
  2016.  *  IID_IHXNetworkInterfaceEnumerator;
  2017.  * 
  2018.  * {00000121-0901-11d1-8B06-00A024406D59}
  2019.  * 
  2020.  */
  2021. DEFINE_GUID(IID_IHXNetworkInterfaceEnumerator, 0x00000121, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  2022. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  2023. #undef  INTERFACE
  2024. #define INTERFACE   IHXNetworkInterfaceEnumerator
  2025. DECLARE_INTERFACE_(IHXNetworkInterfaceEnumerator, IUnknown)
  2026. {
  2027.     /*
  2028.      *  IUnknown methods
  2029.      */
  2030.     STDMETHOD(QueryInterface) (THIS_
  2031. REFIID riid,
  2032. void** ppvObj) PURE;
  2033.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  2034.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  2035.     /************************************************************************
  2036.      * Method:
  2037.      *     IHXNetworkInterfaceEnumerator::EnumerateInterfaces
  2038.      * Purpose:
  2039.      *     returns a list of local interfaces
  2040.      * Usage:
  2041.      *     If a buffer passed in is too small, it will return 
  2042.      *     HXR_BUFFERTOOSMALL with ulNumInterfaces updated.
  2043.      */
  2044.     STDMETHOD(EnumerateInterfaces) (THIS_
  2045. REF(UINT32*) pulInterfaces, REF(UINT32) ulNumInterfaces) PURE;
  2046. };
  2047. /****************************************************************************
  2048.  * 
  2049.  *  Interface:
  2050.  * 
  2051.  * IHXUDPConnectedSocket
  2052.  * 
  2053.  *  Purpose:
  2054.  * 
  2055.  * Connect and disconnect a UDP socket
  2056.  * 
  2057.  *  IID_IHXUDPConnectedSocket;
  2058.  * 
  2059.  * {0000012A-0901-11d1-8B06-00A024406D59}
  2060.  * 
  2061.  */
  2062. DEFINE_GUID(IID_IHXUDPConnectedSocket, 0x0000012a, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  2063. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  2064. #undef  INTERFACE
  2065. #define INTERFACE   IHXUDPConnectedSocket
  2066. DECLARE_INTERFACE_(IHXUDPConnectedSocket, IUnknown)
  2067. {
  2068.     /*
  2069.      *  IUnknown methods
  2070.      */
  2071.     STDMETHOD(QueryInterface) (THIS_
  2072. REFIID riid,
  2073. void** ppvObj) PURE;
  2074.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  2075.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  2076.     /************************************************************************
  2077.      * Method:
  2078.      *     IHXUDPConnectedSocket::UDPConnect
  2079.      * Purpose:
  2080.      *     Connect the udp socket
  2081.      * Usage:
  2082.      *     Connect to the foreign addr and port the socket already knows
  2083.      *      about; this is implementation-dependent.
  2084.      */
  2085.     STDMETHOD(UDPConnect) (THIS) PURE;
  2086.     /************************************************************************
  2087.      * Method:
  2088.      *     IHXUDPConnectedSocket::UDPConnect(ULONG32 ulAddr, UINT16 nPort);
  2089.      * Purpose:
  2090.      *     Connect the udp socket
  2091.      * Usage:
  2092.      *     Specify the host-ordered foreign addr and port to connect to.
  2093.      */
  2094.     STDMETHOD(UDPConnect) (THIS_ ULONG32 ulAddr, UINT16 nPort) PURE;
  2095.     /************************************************************************
  2096.      * Method:
  2097.      *     IHXUDPConnectedSocket::UDPDisconnect
  2098.      * Purpose:
  2099.      *     Disconnect the udp socket
  2100.      */
  2101.     STDMETHOD(UDPDisconnect) (THIS) PURE;
  2102.     /************************************************************************
  2103.      * Method:
  2104.      *     IHXUDPConnectedSocket::IsUDPConnected
  2105.      * Purpose:
  2106.      *     Return whether the socket is connected.
  2107.      */
  2108.     STDMETHOD_(BOOL, IsUDPConnected) (THIS) PURE;
  2109.     /************************************************************************
  2110.      * Method:
  2111.      *     IHXUDPConnectedSocket::IsUDPConnected(REF(ULONG32) ulAddr, 
  2112.      *                                            REF(UINT16) nPort)
  2113.      * Purpose:
  2114.      *     Return whether the socket is connected, and the connected addr/port.
  2115.      * Usage:
  2116.      *      Return the foreign addr/port the socket knows about, regardless of
  2117.      *      whether it's connected.  This is the foreign addr that is connected
  2118.      *      to (if TRUE) or that will be used if Connect(void) called (if FALSE).
  2119.      */
  2120.     STDMETHOD_(BOOL, IsUDPConnected) (THIS_ REF(ULONG32) ulAddr, 
  2121.                                             REF(UINT16) nPort) PURE;
  2122. };
  2123. #endif /* _HXENGIN_H_ */