rmaengin.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:39k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /****************************************************************************
  2.  * 
  3.  *  $Id: rmaengin.h,v 1.1 2003/05/30 02:17:36 gabest Exp $
  4.  *
  5.  *  Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved.
  6.  *  
  7.  *  http://www.real.com/devzone
  8.  *
  9.  *  This program contains proprietary 
  10.  *  information of Progressive Networks, Inc, and is licensed
  11.  *  subject to restrictions on use and distribution.
  12.  *
  13.  *
  14.  *  RealMedia Architecture Callback, Networking, and Scheduling interfaces.
  15.  *
  16.  */
  17. #ifndef _RMAENGIN_H_
  18. #define _RMAENGIN_H_
  19. /*
  20.  * Forward declarations of some interfaces used here-in.
  21.  */
  22. typedef _INTERFACE IRMABuffer IRMABuffer;
  23. typedef _INTERFACE IRMACallback IRMACallback;
  24. typedef _INTERFACE IRMAScheduler IRMAScheduler;
  25. typedef _INTERFACE IRMATCPResponse IRMATCPResponse;
  26. typedef _INTERFACE IRMALBoundTCPSocket IRMALBoundTCPSocket;
  27. typedef _INTERFACE IRMATCPSocket IRMATCPSocket;
  28. typedef _INTERFACE IRMAListenResponse IRMAListenResponse;
  29. typedef _INTERFACE IRMAListenSocket IRMAListenSocket;
  30. typedef _INTERFACE IRMANetworkServices IRMANetworkServices;
  31. typedef _INTERFACE IRMANetworkServices2 IRMANetworkServices2;
  32. typedef _INTERFACE IRMAUDPResponse      IRMAUDPResponse;
  33. typedef _INTERFACE IRMAUDPSocket IRMAUDPSocket;
  34. typedef _INTERFACE IRMAResolver IRMAResolver;
  35. typedef _INTERFACE IRMAResolverResponse IRMAResolverResponse;
  36. typedef _INTERFACE IRMAInterruptSafe IRMAInterruptSafe;
  37. typedef _INTERFACE IRMAAsyncIOSelection IRMAAsyncIOSelection;
  38. typedef _INTERFACE IRMAUDPMulticastInit IRMAUDPMulticastInit;
  39. typedef _INTERFACE IRMAInterruptState IRMAInterruptState;
  40. typedef _INTERFACE IRMAOptimizedScheduler IRMAOptimizedScheduler;
  41. /*
  42.  * Address flags starting with PNR are depricated.
  43.  */
  44. #define PNR_INADDR_ANY (UINT32)0x00000000  //THIS FLAG IS DEPRICATED
  45. #define PN_INADDR_ANY (UINT32)0x00000000
  46. /*
  47.  * 255.255.255.254
  48.  *
  49.  * Bind to all ports in IPBindings list from
  50.  * server config.
  51.  */
  52. #define PNR_INADDR_IPBINDINGS (UINT32)0xfffffffe    //THIS FLAG IS DEPRICATED
  53. #define PN_INADDR_IPBINDINGS (UINT32)0xfffffffe
  54. /* Async IO Selection Type (Unix Only) */
  55. #define PNAIO_READ 1
  56. #define PNAIO_WRITE 2
  57. #define PNAIO_EXCEPTION 4
  58. /****************************************************************************
  59.  * 
  60.  *  Interface:
  61.  * 
  62.  * IRMACallback
  63.  * 
  64.  *  Purpose:
  65.  * 
  66.  * This interface defines a simple callback which will be used in
  67.  * various interfaces such as IRMAScheduler.
  68.  * 
  69.  *  IID_IRMACallback:
  70.  * 
  71.  * {00000100-0901-11d1-8B06-00A024406D59}
  72.  * 
  73.  */
  74. DEFINE_GUID(IID_IRMACallback, 0x00000100, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  75. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  76. #undef  INTERFACE
  77. #define INTERFACE   IRMACallback
  78. DECLARE_INTERFACE_(IRMACallback, IUnknown)
  79. {
  80.     /*
  81.      *  IUnknown methods
  82.      */
  83.     STDMETHOD(QueryInterface) (THIS_
  84. REFIID riid,
  85. void** ppvObj) PURE;
  86.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  87.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  88.     /*
  89.      *  IRMACallback methods
  90.      */
  91.     /************************************************************************
  92.      * Method:
  93.      *     IRMACallback::Func
  94.      * Purpose:
  95.      *     This is the function that will be called when a callback is
  96.      *     to be executed.
  97.      */
  98.     STDMETHOD(Func) (THIS) PURE;
  99. };
  100. /****************************************************************************
  101.  * 
  102.  *  Interface:
  103.  * 
  104.  * IRMAScheduler
  105.  * 
  106.  *  Purpose:
  107.  * 
  108.  * This interface provides the user with a way of scheduling callbacks
  109.  * that will be executed at some time in the future.
  110.  * 
  111.  *  IID_IRMAScheduler:
  112.  * 
  113.  * {00000101-0901-11d1-8B06-00A024406D59}
  114.  * 
  115.  */
  116. DEFINE_GUID(IID_IRMAScheduler, 0x00000101, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  117. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  118. #undef  INTERFACE
  119. #define INTERFACE   IRMAScheduler
  120. typedef ULONG32 CallbackHandle;
  121. typedef struct _RMATimeval
  122. {
  123.     UINT32 tv_sec;
  124.     UINT32 tv_usec;
  125. } RMATimeval;
  126. DECLARE_INTERFACE_(IRMAScheduler, IUnknown)
  127. {
  128.     /*
  129.      *  IUnknown methods
  130.      */
  131.     STDMETHOD(QueryInterface) (THIS_
  132. REFIID riid,
  133. void** ppvObj) PURE;
  134.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  135.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  136.     /*
  137.      * IRMAScheduler methods
  138.      */
  139.     /************************************************************************
  140.      * Method:
  141.      *     IRMAScheduler::RelativeEnter
  142.      * Purpose:
  143.      *     Schedule a callback to be executed "ms" milliseconds from now
  144.      *     This function is less percise then AbsoluteEnter and should only
  145.      *     be used when accurate timing is not critical.
  146.      */
  147.     STDMETHOD_(CallbackHandle,RelativeEnter) (THIS_
  148. IRMACallback* pCallback,
  149. UINT32 ms) PURE;
  150.     /************************************************************************
  151.      * Method:
  152.      *     IRMAScheduler::AbsoluteEnter
  153.      * Purpose:
  154.      *     Schedule a callback to be executed at time "tVal".
  155.      */
  156.     STDMETHOD_(CallbackHandle,AbsoluteEnter) (THIS_
  157. IRMACallback* pCallback,
  158. RMATimeval tVal) PURE;
  159.     /************************************************************************
  160.      * Method:
  161.      *     IRMAScheduler::Remove
  162.      * Purpose:
  163.      *     Remove a callback from the scheduler.
  164.      */
  165.     STDMETHOD(Remove) (THIS_
  166.      CallbackHandle Handle) PURE;
  167.     /************************************************************************
  168.      * Method:
  169.      *     IRMAScheduler::GetCurrentSchedulerTime
  170.      * Purpose:
  171.      *     Gives the current time (in the timeline of the scheduler).
  172.      */
  173.     STDMETHOD_(RMATimeval,GetCurrentSchedulerTime) (THIS) PURE;
  174. };
  175. /****************************************************************************
  176.  * 
  177.  *  Interface:
  178.  * 
  179.  * IRMATCPResponse
  180.  * 
  181.  *  Purpose:
  182.  * 
  183.  * This is the response interface for the asynchronous TCP networking 
  184.  * interface.
  185.  * 
  186.  *  IID_IRMATCPResponse:
  187.  * 
  188.  * {00000102-0901-11d1-8B06-00A024406D59}
  189.  * 
  190.  */
  191. DEFINE_GUID(IID_IRMATCPResponse, 0x00000102, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  192. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  193. #undef  INTERFACE
  194. #define INTERFACE   IRMATCPResponse
  195. DECLARE_INTERFACE_(IRMATCPResponse, IUnknown)
  196. {
  197.     /*
  198.      *  IUnknown methods
  199.      */
  200.     STDMETHOD(QueryInterface) (THIS_
  201. REFIID riid,
  202. void** ppvObj) PURE;
  203.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  204.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  205.     /*
  206.      * IRMATCPResponse methods
  207.      */
  208.     /************************************************************************
  209.      * Method:
  210.      *     IRMATCPResponse::ConnectDone
  211.      * Purpose:
  212.      *     A Connect operation has been completed or an error has occurred.
  213.      */
  214.     STDMETHOD(ConnectDone) (THIS_
  215. PN_RESULT status) PURE;
  216.     /************************************************************************
  217.      * Method:
  218.      *     IRMATCPResponse::ReadDone
  219.      * Purpose:
  220.      *     A Read operation has been completed or an error has occurred.
  221.      *     The data is returned in the IRMABuffer.
  222.      */
  223.     STDMETHOD(ReadDone) (THIS_
  224. PN_RESULT status,
  225. IRMABuffer* pBuffer) PURE;
  226.     /************************************************************************
  227.      * Method:
  228.      *     IRMATCPResponse::WriteReady
  229.      * Purpose:
  230.      *     This is the response method for WantWrite.
  231.      *     If PN_RESULT is ok, then the TCP channel is ok to Write to.
  232.      */
  233.     STDMETHOD(WriteReady) (THIS_
  234.      PN_RESULT status) PURE;
  235.     /************************************************************************
  236.      * Method:
  237.      *     IRMATCPResponse::Closed
  238.      * Purpose:
  239.      *     This method is called to inform you that the TCP channel has
  240.      *     been closed by the peer or closed due to error.
  241.      */
  242.     STDMETHOD(Closed) (THIS_
  243. PN_RESULT status) PURE;
  244. };
  245. /****************************************************************************
  246.  * 
  247.  *  Interface:
  248.  * 
  249.  * IRMATCPSocket
  250.  * 
  251.  *  Purpose:
  252.  * 
  253.  * Provides the user with an asynchronous TCP networking interface.
  254.  * 
  255.  *  IID_IRMATCPSocket:
  256.  * 
  257.  * {00000103-0901-11d1-8B06-00A024406D59}
  258.  * 
  259.  */
  260. DEFINE_GUID(IID_IRMATCPSocket, 0x00000103, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  261. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  262. #undef  INTERFACE
  263. #define INTERFACE   IRMATCPSocket
  264. DECLARE_INTERFACE_(IRMATCPSocket, IUnknown)
  265. {
  266.     /*
  267.      *  IUnknown methods
  268.      */
  269.     STDMETHOD(QueryInterface) (THIS_
  270. REFIID riid,
  271. void** ppvObj) PURE;
  272.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  273.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  274.     /*
  275.      * IRMATCPSocket methods
  276.      *
  277.      *  Network addresses and ports are in native byte order
  278.      *  
  279.      */
  280.     STDMETHOD(Init) (THIS_
  281. IRMATCPResponse*    /*IN*/  pTCPResponse) PURE;
  282.     STDMETHOD(SetResponse) (THIS_
  283.      IRMATCPResponse*     pTCPResponse) PURE;
  284.     STDMETHOD(Bind) (THIS_
  285. UINT32     ulLocalAddr,
  286. UINT16      nPort) PURE;
  287.     /*
  288.      * pDestination is a string containing host name or dotted-ip notation
  289.      */
  290.     STDMETHOD(Connect) (THIS_
  291. const char*     pDestination,
  292. UINT16      nPort) PURE;
  293.     STDMETHOD(Read) (THIS_
  294. UINT16     Size) PURE;
  295.     STDMETHOD(Write) (THIS_
  296. IRMABuffer*     pBuffer) PURE;
  297.     /************************************************************************
  298.      * Method:
  299.      *     IRMATCPSocket::WantWrite
  300.      * Purpose:
  301.      *     This method is called when you wish to write a large amount of
  302.      *     data.  If you are only writing small amounts of data, you can
  303.      *     just call Write (all data not ready to be transmitted will be
  304.      *     buffered on your behalf).  When the TCP channel is ready to be
  305.      *     written to, the response interfaces WriteReady method will be 
  306.      *     called.
  307.      */
  308.     STDMETHOD(WantWrite) (THIS) PURE;
  309.     /************************************************************************
  310.      * Method:
  311.      *     IRMATCPSocket::GetForeignAddress
  312.      * Purpose:
  313.      *     Returns the address of the other end of the TCP socket as a
  314.      *     ULONG32 in local host order
  315.      */
  316.     STDMETHOD(GetForeignAddress) (THIS_
  317.      REF(ULONG32) lAddress) PURE;
  318.     STDMETHOD(GetLocalAddress) (THIS_
  319.      REF(ULONG32) lAddress) PURE;
  320.     /************************************************************************
  321.      * Method:
  322.      *     IRMATCPSocket::GetForeignPort
  323.      * Purpose:
  324.      *     Returns the port of the other end of the TCP socket in local
  325.      *      host order.
  326.      */
  327.     STDMETHOD(GetForeignPort) (THIS_
  328.      REF(UINT16) port) PURE;
  329.     STDMETHOD(GetLocalPort) (THIS_
  330.      REF(UINT16) port) PURE;
  331. };
  332. /****************************************************************************
  333.  * 
  334.  *  Interface:
  335.  * 
  336.  * IRMAListenResponse
  337.  * 
  338.  *  Purpose:
  339.  * 
  340.  * This is the response interface for the asynchronous TCP listening
  341.  * socket interface.
  342.  * 
  343.  *  IID_IRMAListenResponse:
  344.  * 
  345.  * {00000104-0901-11d1-8B06-00A024406D59}
  346.  * 
  347.  */
  348. DEFINE_GUID(IID_IRMAListenResponse, 0x00000104, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  349. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  350. #undef  INTERFACE
  351. #define INTERFACE   IRMAListenResponse
  352. DECLARE_INTERFACE_(IRMAListenResponse, IUnknown)
  353. {
  354.     /*
  355.      *  IUnknown methods
  356.      */
  357.     STDMETHOD(QueryInterface) (THIS_
  358. REFIID riid,
  359. void** ppvObj) PURE;
  360.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  361.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  362.     /*
  363.      * IRMAListenResponse methods
  364.      */
  365.     STDMETHOD(NewConnection) (THIS_
  366. PN_RESULT status,
  367. IRMATCPSocket* pTCPSocket) PURE;
  368. };
  369. /****************************************************************************
  370.  * 
  371.  *  Interface:
  372.  * 
  373.  * IRMAListenSocket
  374.  * 
  375.  *  Purpose:
  376.  * 
  377.  * This interfaces allows you to asynchronously listen on a port for
  378.  * TCP connections.
  379.  * 
  380.  *  IID_IRMAListenSocket:
  381.  * 
  382.  * {00000105-0901-11d1-8B06-00A024406D59}
  383.  * 
  384.  */
  385. DEFINE_GUID(IID_IRMAListenSocket, 0x00000105, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  386. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  387. #undef  INTERFACE
  388. #define INTERFACE   IRMAListenSocket
  389. DECLARE_INTERFACE_(IRMAListenSocket, IUnknown)
  390. {
  391.     /*
  392.      *  IUnknown methods
  393.      */
  394.     STDMETHOD(QueryInterface) (THIS_
  395. REFIID riid,
  396. void** ppvObj) PURE;
  397.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  398.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  399.     /*
  400.      * IRMAListenSocket methods
  401.      */
  402.     STDMETHOD(Init) (THIS_
  403. UINT32 ulLocalAddr,
  404. UINT16 port,
  405. IRMAListenResponse*    /*IN*/ pListenResponse
  406. ) PURE;
  407. };
  408. /****************************************************************************
  409.  * 
  410.  *  Interface:
  411.  * 
  412.  * IRMANetworkServices
  413.  * 
  414.  *  Purpose:
  415.  * 
  416.  * This is a factory interface for the various types of networking
  417.  * interfaces described above.
  418.  * 
  419.  *  IID_IRMANetworkServices:
  420.  * 
  421.  * {00000106-0901-11d1-8B06-00A024406D59}
  422.  * 
  423.  */
  424. DEFINE_GUID(IID_IRMANetworkServices, 0x00000106, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  425. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  426. #undef  INTERFACE
  427. #define INTERFACE   IRMANetworkServices
  428. DECLARE_INTERFACE_(IRMANetworkServices, IUnknown)
  429. {
  430.     /*
  431.      *  IUnknown methods
  432.      */
  433.     STDMETHOD(QueryInterface) (THIS_
  434. REFIID riid,
  435. void** ppvObj) PURE;
  436.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  437.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  438.     /*
  439.      * IRMANetworkServices methods
  440.      */
  441.     /************************************************************************
  442.      * Method:
  443.      *     IRMANetworkServices::CreateTCPSocket
  444.      * Purpose:
  445.      *     Create a new TCP socket.
  446.      */
  447.     STDMETHOD(CreateTCPSocket) (THIS_
  448. IRMATCPSocket**    /*OUT*/  ppTCPSocket) PURE;
  449.     /************************************************************************
  450.      * Method:
  451.      *     IRMANetworkServices::CreateUDPSocket
  452.      * Purpose:
  453.      *     Create a new UDP socket.
  454.      */
  455.     STDMETHOD(CreateUDPSocket) (THIS_
  456. IRMAUDPSocket**    /*OUT*/  ppUDPSocket) PURE;
  457.     /************************************************************************
  458.      * Method:
  459.      *     IRMANetworkServices::CreateListenSocket
  460.      * Purpose:
  461.      *     Create a new TCP socket that will listen for connections on a
  462.      *     particular port.
  463.      */
  464.     STDMETHOD(CreateListenSocket)   (THIS_
  465.     IRMAListenSocket** /*OUT*/ ppListenSocket
  466.     ) PURE;
  467.     /************************************************************************
  468.      * Method:
  469.      *     IRMANetworkServices::CreateResolver
  470.      * Purpose:
  471.      *     Create a new resolver that can lookup host names
  472.      */
  473.     STDMETHOD(CreateResolver)   (THIS_
  474.      IRMAResolver**    /*OUT*/     ppResolver) PURE;
  475. };
  476. /****************************************************************************
  477.  * 
  478.  *  Interface:
  479.  * 
  480.  * IRMANetworkServices2
  481.  * 
  482.  *  Purpose:
  483.  * 
  484.  * This is a factory interface for the various types of networking
  485.  * interfaces described above.
  486.  * 
  487.  *  IID_IRMANetworkServices:
  488.  * 
  489.  * {17951551-5683-11d3-B6BA-00C0F031C237}
  490.  * 
  491.  */
  492. // {17951551-5683-11d3-B6BA-00C0F031C237}
  493. DEFINE_GUID(IID_IRMANetworkServices2, 0x17951551, 0x5683, 0x11d3, 0xb6, 0xba, 0x0, 0xc0, 0xf0, 0x31, 0xc2, 0x37);
  494. #undef  INTERFACE
  495. #define INTERFACE   IRMANetworkServices2
  496. DECLARE_INTERFACE_(IRMANetworkServices2, IRMANetworkServices)
  497. {
  498.     /************************************************************************
  499.      * Method:
  500.      *     IRMANetworkServices2::CreateLBoundTCPSocket
  501.      * Purpose:
  502.      *     Create a new local bound TCP socket.
  503.      */
  504.     STDMETHOD(CreateLBoundTCPSocket) (THIS_
  505. IRMATCPSocket**    /*OUT*/  ppTCPSocket) PURE;
  506. };
  507. /****************************************************************************
  508.  * 
  509.  *  Interface:
  510.  * 
  511.  * IRMAUDPResponse
  512.  * 
  513.  *  Purpose:
  514.  * 
  515.  * This is the response interface for the asynchronous UDP networking 
  516.  * interface.
  517.  * 
  518.  *  IID_IRMAUDPResponse:
  519.  * 
  520.  * {00000107-0901-11d1-8B06-00A024406D59}
  521.  * 
  522.  */
  523. DEFINE_GUID(IID_IRMAUDPResponse, 0x00000107, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  524. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  525. #undef  INTERFACE
  526. #define INTERFACE   IRMAUDPResponse
  527. DECLARE_INTERFACE_(IRMAUDPResponse, IUnknown)
  528. {
  529.     /*
  530.      *  IUnknown methods
  531.      */
  532.     STDMETHOD(QueryInterface) (THIS_
  533. REFIID riid,
  534. void** ppvObj) PURE;
  535.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  536.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  537.     /*
  538.      * IRMAUDPResponse methods
  539.      */
  540.     STDMETHOD(ReadDone) (THIS_
  541. PN_RESULT status,
  542. IRMABuffer* pBuffer,
  543. ULONG32 ulAddr,
  544. UINT16 nPort) PURE;
  545. };
  546. /****************************************************************************
  547.  * 
  548.  *  Interface:
  549.  * 
  550.  * IRMAUDPSocket
  551.  * 
  552.  *  Purpose:
  553.  * 
  554.  * Provides the user with an asynchronous UDP networking interface.
  555.  * 
  556.  *  IID_IRMAUDPSocket:
  557.  * 
  558.  * {00000108-0901-11d1-8B06-00A024406D59}
  559.  * 
  560.  */
  561. DEFINE_GUID(IID_IRMAUDPSocket, 0x00000108, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  562. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  563. #undef  INTERFACE
  564. #define INTERFACE   IRMAUDPSocket
  565. DECLARE_INTERFACE_(IRMAUDPSocket, IUnknown)
  566. {
  567.     /*
  568.      *  IUnknown methods
  569.      */
  570.     STDMETHOD(QueryInterface) (THIS_
  571. REFIID riid,
  572. void** ppvObj) PURE;
  573.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  574.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  575.     /*
  576.      * IRMAUDPSocket methods
  577.      *
  578.      *  Network addresses and ports are in native byte order
  579.      */
  580.     STDMETHOD(Init) (THIS_
  581. ULONG32 ulAddr,
  582. UINT16 nPort,
  583. IRMAUDPResponse* pUDPResponse) PURE;
  584.     STDMETHOD(Bind) (THIS_
  585. UINT32     ulLocalAddr,
  586. UINT16      nPort) PURE;
  587.     STDMETHOD(Read) (THIS_
  588. UINT16 Size) PURE;
  589.     STDMETHOD(Write) (THIS_
  590. IRMABuffer* pBuffer) PURE;
  591.     STDMETHOD(WriteTo) (THIS_
  592.      ULONG32 ulAddr,
  593. UINT16 nPort,
  594. IRMABuffer* pBuffer) PURE;
  595.     STDMETHOD(GetLocalPort) (THIS_
  596.      REF(UINT16) port) PURE;
  597.     STDMETHOD(JoinMulticastGroup) (THIS_
  598.      ULONG32     ulMulticastAddr,
  599.      ULONG32     ulInterfaceAddr) PURE;
  600.     
  601.     STDMETHOD(LeaveMulticastGroup) (THIS_
  602.      ULONG32     ulMulticastAddr,
  603.      ULONG32     ulInterfaceAddr) PURE;
  604. };
  605. /****************************************************************************
  606.  * 
  607.  *  Interface:
  608.  * 
  609.  * IRMAResolver
  610.  * 
  611.  *  Purpose:
  612.  * 
  613.  * This interface allows you to asynchronously resolve hostnames.
  614.  * 
  615.  *  IID_IRMAResolver:
  616.  * 
  617.  * {00000109-0901-11d1-8B06-00A024406D59}
  618.  * 
  619.  */
  620. DEFINE_GUID(IID_IRMAResolver, 0x00000109, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  621. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  622. #undef  INTERFACE
  623. #define INTERFACE   IRMAResolver
  624. DECLARE_INTERFACE_(IRMAResolver, IUnknown)
  625. {
  626.     /*
  627.      *  IUnknown methods
  628.      */
  629.     STDMETHOD(QueryInterface) (THIS_
  630. REFIID riid,
  631. void** ppvObj) PURE;
  632.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  633.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  634.     /*
  635.      * IRMAResolver methods
  636.      */
  637.     STDMETHOD(Init) (THIS_
  638. IRMAResolverResponse*  pResponse) PURE;
  639.     STDMETHOD(GetHostByName) (THIS_
  640. const char* pHostName) PURE;
  641. };
  642. /****************************************************************************
  643.  * 
  644.  *  Interface:
  645.  * 
  646.  * IRMAResolverResponse
  647.  * 
  648.  *  Purpose:
  649.  * 
  650.  * This is the response interface for the asynchronous DNS hostname
  651.  * resolver.
  652.  * 
  653.  *  IID_IRMAResolverResponse:
  654.  * 
  655.  * {0000010A-0901-11d1-8B06-00A024406D59}
  656.  * 
  657.  */
  658. DEFINE_GUID(IID_IRMAResolverResponse, 0x0000010A, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  659. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  660. #undef  INTERFACE
  661. #define INTERFACE   IRMAResolverResponse
  662. DECLARE_INTERFACE_(IRMAResolverResponse, IUnknown)
  663. {
  664.     /*
  665.      *  IUnknown methods
  666.      */
  667.     STDMETHOD(QueryInterface) (THIS_
  668. REFIID riid,
  669. void** ppvObj) PURE;
  670.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  671.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  672.     /*
  673.      * IRMAResolverResponse methods
  674.      */
  675.     STDMETHOD(GetHostByNameDone) (THIS_
  676. PN_RESULT status,
  677. ULONG32 ulAddr) PURE;
  678. };
  679. /****************************************************************************
  680.  * 
  681.  *  Interface:
  682.  * 
  683.  * IRMAInterruptSafe
  684.  * 
  685.  *  Purpose:
  686.  * 
  687.  * This interface is used in Macintosh implementations of callback 
  688.  * functions, renderers, etc... to determine if interrupt time execution  
  689.  * is supported. If this interface is not implemented then it is assumed
  690.  * that interrupt time execution is NOT supported. There are restrictions 
  691.  * on what may be executed at interrupt time; please consult the Macintosh
  692.  * Deferred Task Manager tech notes from Apple.
  693.  * 
  694.  *  IID_IRMAInterruptSafe:
  695.  * 
  696.  * {0000010B-0901-11d1-8B06-00A024406D59}
  697.  * 
  698.  */
  699. DEFINE_GUID(IID_IRMAInterruptSafe, 0x0000010B, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  700. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  701. #undef  INTERFACE
  702. #define INTERFACE   IRMAInterruptSafe
  703. DECLARE_INTERFACE_(IRMAInterruptSafe, IUnknown)
  704. {
  705.     /*
  706.      *  IUnknown methods
  707.      */
  708.     STDMETHOD(QueryInterface) (THIS_
  709. REFIID riid,
  710. void** ppvObj) PURE;
  711.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  712.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  713.     /*
  714.      *  IRMAInterruptSafe methods
  715.      */
  716.     /************************************************************************
  717.      * Method:
  718.      *     IRMAInterruptSafe::IsInterruptSafe
  719.      * Purpose:
  720.      *     This is the function that will be called to determine if
  721.      *     interrupt time execution is supported.
  722.      */
  723.     STDMETHOD_(BOOL,IsInterruptSafe) (THIS) PURE;
  724. };
  725. /****************************************************************************
  726.  * 
  727.  *  Interface:
  728.  * 
  729.  * IRMAAsyncIOSelection
  730.  * 
  731.  *  Purpose:
  732.  * 
  733.  *      This interface is implemented by the server/player context on Unix
  734.  *      platforms.  This interface allows your plugin to get callbacks based
  735.  *      I/O events that are normally handled by select().  This interface
  736.  * allows you to setup callbacks which will be executed when a file
  737.  * descriptor is ready for reading, writing, or has an exception.
  738.  * 
  739.  *  IID_IRMAAsyncIOSelection:
  740.  * 
  741.  * {0000010C-0901-11d1-8B06-00A024406D59}
  742.  * 
  743.  */
  744. DEFINE_GUID(IID_IRMAAsyncIOSelection, 0x0000010C, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  745. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  746. #undef  INTERFACE
  747. #define INTERFACE   IRMAAsyncIOSelection
  748. DECLARE_INTERFACE_(IRMAAsyncIOSelection, IUnknown)
  749. {
  750.     /*
  751.      *  IUnknown methods
  752.      */
  753.     STDMETHOD(QueryInterface) (THIS_
  754. REFIID riid,
  755. void** ppvObj) PURE;
  756.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  757.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  758.     /*
  759.      * IRMAAsyncIOSelection methods
  760.      */
  761.     /************************************************************************
  762.      * Method:
  763.      *     IRMAAsyncIOSelection::Add
  764.      * Purpose:
  765.      *     This function will allow you to receive a callback when the
  766.      *     given descriptor is ready for read, write, or has an
  767.      *     exception.  This function is only available on Unix, and is
  768.      *     intended to replace the functionality of select().
  769.      */
  770.     STDMETHOD(Add) (THIS_
  771. IRMACallback* pCallback,
  772. INT32 lFileDescriptor,
  773. UINT32 ulType) PURE;
  774.     /************************************************************************
  775.      * Method:
  776.      *     IRMAAsyncIOSelection::Remove
  777.      * Purpose:
  778.      *     This function will allow you remove the callback associated
  779.      *     with the given descriptor from the event handler.
  780.      *     This function is only available on Unix, and is intended to
  781.      *     replace the functionality of select().
  782.      */
  783.     STDMETHOD(Remove)                   (THIS_
  784.                                         INT32           lFileDescriptor,
  785. UINT32 ulType) PURE;
  786. };
  787. /****************************************************************************
  788.  * 
  789.  *  Interface:
  790.  * 
  791.  * IRMAUDPMulticastInit
  792.  * 
  793.  *  Purpose:
  794.  * 
  795.  * Provides the user with a way to set the TTL for outgoing multicast
  796.  * UDP packets.  Usually shared with IRMAUDPSocket.
  797.  * 
  798.  *  IID_IRMAUDPMulticastInit:
  799.  * 
  800.  * {0000010D-0901-11d1-8B06-00A024406D59}
  801.  * 
  802.  */
  803. DEFINE_GUID(IID_IRMAUDPMulticastInit, 0x0000010D, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  804. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  805. #undef  INTERFACE
  806. #define INTERFACE   IRMAUDPMulticastInit
  807. DECLARE_INTERFACE_(IRMAUDPMulticastInit, IUnknown)
  808. {
  809.     /*
  810.      *  IUnknown methods
  811.      */
  812.     STDMETHOD(QueryInterface) (THIS_
  813. REFIID riid,
  814. void** ppvObj) PURE;
  815.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  816.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  817.     /*
  818.      * IRMAUDPMulticastInit methods
  819.      *
  820.      */
  821.      /************************************************************************
  822.      * Method:
  823.      *     IRMAUDPMulticastInit::InitMulticast
  824.      * Purpose:
  825.      *     This function will set the TTL (time to live) for the UDP socket
  826.      *      so it can be used as a multicast socket, sending packets across
  827.      *      the number of routers specified in the ulTTL parameter.  
  828.      */
  829.     STDMETHOD(InitMulticast) (THIS_
  830.      UINT8     chTTL) PURE;
  831. };
  832. /****************************************************************************
  833.  * 
  834.  *  Interface:
  835.  * 
  836.  * IRMAInterruptState
  837.  * 
  838.  *  Purpose:
  839.  * 
  840.  * This interface is used in Macintosh implementations to inform the
  841.  * the client engine when entering & leaving an interupt task. It is
  842.  * also used to determine if it is currently at interrupt time.
  843.  * Please consult the Macintosh Deferred Task Manager tech notes from Apple
  844.  * for information on interrupt tasks.
  845.  * 
  846.  *  IID_IRMAInterruptState:
  847.  * 
  848.  * {0000010E-0901-11d1-8B06-00A024406D59}
  849.  * 
  850.  */
  851. DEFINE_GUID(IID_IRMAInterruptState, 0x0000010E, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  852. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  853. #undef  INTERFACE
  854. #define INTERFACE   IRMAInterruptState
  855. DECLARE_INTERFACE_(IRMAInterruptState, IUnknown)
  856. {
  857.     /*
  858.      *  IUnknown methods
  859.      */
  860.     STDMETHOD(QueryInterface) (THIS_
  861. REFIID riid,
  862. void** ppvObj) PURE;
  863.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  864.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  865.     /*
  866.      *  IRMAInterruptState methods
  867.      */
  868.     /************************************************************************
  869.      * Method:
  870.      *     IRMAInterruptState::AtInterruptTime
  871.      * Purpose:
  872.      *     This function is called to determine if we are currently at
  873.      *     interrupt task time.
  874.      */
  875.         STDMETHOD_(BOOL,AtInterruptTime) (THIS) PURE;
  876.     /************************************************************************
  877.      * Method:
  878.      *     IRMAInterruptState::EnterInterruptState
  879.      * Purpose:
  880.      *     This function is called when starting a deferred/interrupt task
  881.      */
  882.     STDMETHOD(EnterInterruptState) (THIS) PURE;
  883.     /************************************************************************
  884.      * Method:
  885.      *     IRMAInterruptState::LeaveInterruptState
  886.      * Purpose:
  887.      *     This function is called when leaving a deferred/interrupt task
  888.      */
  889.     STDMETHOD(LeaveInterruptState) (THIS) PURE;
  890.     /************************************************************************
  891.      * Method:
  892.      *     IRMAInterruptState::EnableInterrupt
  893.      * Purpose:
  894.      *     This function can be called to enable/disable interrupt time 
  895.      *     processsing
  896.      */
  897.     STDMETHOD(EnableInterrupt) (THIS_
  898. BOOL bEnable) PURE;
  899.     
  900.     /************************************************************************
  901.      * Method:
  902.      *     IRMAInterruptState::IsInterruptEnabled
  903.      * Purpose:
  904.      *     This function can be called to find if the core is currently
  905.      *     interrupt enabled.
  906.      */
  907.     STDMETHOD_(BOOL, IsInterruptEnabled)   (THIS) PURE;
  908. };
  909. /****************************************************************************
  910.  * 
  911.  *  Interface:
  912.  * 
  913.  * IRMAOptimizedScheduler
  914.  * 
  915.  *  Purpose:
  916.  * 
  917.  * This interface provides the user with a way of scheduling callbacks
  918.  * that will be executed at some time in the future.
  919.  *
  920.  * This interface should ONLY be used if you need accurately timed 
  921.  * callbacks. These callbacks should be efficient and should not consume 
  922.  * much time/CPU. This is not a thread safe interface. The user has to 
  923.  * take care of synchronization in their callbacks.
  924.  * 
  925.  *  IID_IRMAOptimizedScheduler:
  926.  * 
  927.  * {0000010F-0901-11d1-8B06-00A024406D59}
  928.  * 
  929.  */
  930. DEFINE_GUID(IID_IRMAOptimizedScheduler, 0x0000010F, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  931. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  932. #undef  INTERFACE
  933. #define INTERFACE   IRMAOptimizedScheduler
  934. DECLARE_INTERFACE_(IRMAOptimizedScheduler, IUnknown)
  935. {
  936.     /*
  937.      *  IUnknown methods
  938.      */
  939.     STDMETHOD(QueryInterface) (THIS_
  940. REFIID riid,
  941. void** ppvObj) PURE;
  942.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  943.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  944.     /*
  945.      * IRMAOptimizedScheduler methods
  946.      */
  947.     /************************************************************************
  948.      * Method:
  949.      *     IRMAOptimizedScheduler::RelativeEnter
  950.      * Purpose:
  951.      *     Schedule a callback to be executed "ms" milliseconds from now
  952.      *     This function is less percise then AbsoluteEnter and should only
  953.      *     be used when accurate timing is not critical.
  954.      */
  955.     STDMETHOD_(CallbackHandle,RelativeEnter) (THIS_
  956. IRMACallback* pCallback,
  957. UINT32 ms) PURE;
  958.     /************************************************************************
  959.      * Method:
  960.      *     IRMAOptimizedScheduler::AbsoluteEnter
  961.      * Purpose:
  962.      *     Schedule a callback to be executed at time "tVal".
  963.      */
  964.     STDMETHOD_(CallbackHandle,AbsoluteEnter) (THIS_
  965. IRMACallback* pCallback,
  966. RMATimeval tVal) PURE;
  967.     /************************************************************************
  968.      * Method:
  969.      *     IRMAOptimizedScheduler::Remove
  970.      * Purpose:
  971.      *     Remove a callback from the scheduler.
  972.      */
  973.     STDMETHOD(Remove) (THIS_
  974.      CallbackHandle Handle) PURE;
  975.     /************************************************************************
  976.      * Method:
  977.      *     IRMAOptimizedScheduler::GetCurrentSchedulerTime
  978.      * Purpose:
  979.      *     Gives the current time (in the timeline of the scheduler).
  980.      */
  981.     STDMETHOD_(RMATimeval,GetCurrentSchedulerTime) (THIS) PURE;
  982. };
  983. /****************************************************************************
  984.  * 
  985.  *  Interface:
  986.  * 
  987.  * IRMALoadBalancedListen
  988.  * 
  989.  *  Purpose:
  990.  * 
  991.  * This interface is queried off of IRMAListenSocket.  It allows
  992.  * a plugin to specify that it wants the server to load balance
  993.  * multiple instances of itself.  The server will instantiate multiple
  994.  * instances of the plugin as needed based on socket / descriptor limits.
  995.  * Each plugin instance should attempt to listen on the same port as
  996.  * other instances (they will share the port).
  997.  * 
  998.  *  IID_IRMALoadBalancedListen:
  999.  * 
  1000.  * {00000110-0901-11d1-8B06-00A024406D59}
  1001.  * 
  1002.  */
  1003. DEFINE_GUID(IID_IRMALoadBalancedListen, 0x00000110, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  1004. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1005. #undef  INTERFACE
  1006. #define INTERFACE   IRMALoadBalancedListen
  1007. DECLARE_INTERFACE_(IRMALoadBalancedListen, IUnknown)
  1008. {
  1009.     /*
  1010.      *  IUnknown methods
  1011.      */
  1012.     STDMETHOD(QueryInterface) (THIS_
  1013. REFIID riid,
  1014. void** ppvObj) PURE;
  1015.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1016.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1017.     /*
  1018.      * IRMALoadBalancedListen methods
  1019.      */
  1020.     /************************************************************************
  1021.      * Method:
  1022.      *     IRMALoadBalancedListen::SetID
  1023.      * Purpose:
  1024.      *     This function set's the unique ID for this listen socket.  This
  1025.      *     ID is used to determine whether or not different instances of
  1026.      *     a plugin trying to listen on a single port are actually the
  1027.      *     same plugin.  Without this function, it would be possible for
  1028.      *     two completely different plugins to listen on the same port using
  1029.      *     the load balanced listener.
  1030.      */
  1031.     STDMETHOD(SetID) (THIS_
  1032.      REFIID ID) PURE;
  1033.     /************************************************************************
  1034.      * Method:
  1035.      *     IRMALoadBalancedListen::SetReserveLimit
  1036.      * Purpose:
  1037.      *     Sets the reserve limit for descriptors / sockets.  If less
  1038.      *     than reserve limit descriptors / sockets are left then a new
  1039.      *     instance of the plugin will be created.
  1040.      */
  1041.     STDMETHOD(SetReserveLimit) (THIS_
  1042.      UINT32 ulDescriptors,
  1043. UINT32 ulSockets) PURE;
  1044. };
  1045. /****************************************************************************
  1046.  * 
  1047.  *  Interface:
  1048.  * 
  1049.  * IRMAOverrideDefaultServices
  1050.  * 
  1051.  *  Purpose:
  1052.  * 
  1053.  * This interface is queried off of the context.  It allows
  1054.  * a plugin to override any default services provided by the G2 system.
  1055.  * Currently, it is supported only on the client side. 
  1056.  * You may currently override IRMANetworkServices using this interface
  1057.  * You can use the same interface to later restore back the overriden services.
  1058.  * This is done by calling the same OverrideServices() function with the 
  1059.  * original service QIed before the initial override.
  1060.  * 
  1061.  *  IID_IRMAOverrideDefaultServices:
  1062.  * 
  1063.  * {00000111-0901-11d1-8B06-00A024406D59}
  1064.  * 
  1065.  */
  1066. DEFINE_GUID(IID_IRMAOverrideDefaultServices, 0x00000111, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  1067. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1068. #undef  INTERFACE
  1069. #define INTERFACE   IRMAOverrideDefaultServices
  1070. DECLARE_INTERFACE_(IRMAOverrideDefaultServices, IUnknown)
  1071. {
  1072.     /*
  1073.      * IUnknown methods
  1074.      */
  1075.     STDMETHOD(QueryInterface)   (THIS_
  1076.                                 REFIID riid,
  1077. void** ppvObj) PURE;
  1078.     STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  1079.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1080.    /*
  1081.     * IRMAOverrideDefaultServices methods
  1082.     */
  1083.    /************************************************************************
  1084.     *  Method:
  1085.     *      IRMAOverrideDefaultServices::OverrideServices
  1086.     *  Purpose:
  1087.     *      Override default services provided by the G2 system.
  1088.     *
  1089.     */
  1090.     STDMETHOD(OverrideServices)         (THIS_
  1091. IUnknown* pContext) PURE;
  1092. };
  1093. enum PN_SOCKET_OPTION
  1094. {
  1095.     PN_SOCKOPT_REUSE_ADDR,
  1096.     PN_SOCKOPT_REUSE_PORT,
  1097.     PN_SOCKOPT_BROADCAST,
  1098.     PN_SOCKOPT_SET_RECVBUF_SIZE,
  1099.     PN_SOCKOPT_SET_SENDBUF_SIZE
  1100. };
  1101. /****************************************************************************
  1102.  * 
  1103.  *  Interface:
  1104.  * 
  1105.  * IRMASetSocketOption
  1106.  * 
  1107.  *  Purpose:
  1108.  * 
  1109.  * Set sockt option
  1110.  * 
  1111.  *  IID_IRMASetSocketOption:
  1112.  * 
  1113.  * IID_IRMASetSocketOption:    {00000114-0901-11d1-8B06-00A024406D59}
  1114.  * 
  1115.  */
  1116. DEFINE_GUID(IID_IRMASetSocketOption,
  1117.     0x00000114, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1118. #undef  INTERFACE
  1119. #define INTERFACE   IRMASetSocketOption
  1120. DECLARE_INTERFACE_(IRMASetSocketOption, IUnknown)
  1121. {
  1122.     /*
  1123.      *  IUnknown methods
  1124.      */
  1125.     STDMETHOD(QueryInterface) (THIS_
  1126. REFIID riid,
  1127. void** ppvObj) PURE;
  1128.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1129.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1130.     /*
  1131.      * IRMAListenSocket methods
  1132.      */
  1133.     STDMETHOD(SetOption) (THIS_ 
  1134.  PN_SOCKET_OPTION option,
  1135.  UINT32 ulValue) PURE;  
  1136. };
  1137. #define RMA_THREADSAFE_METHOD_FF_GETPACKET 0x00000001
  1138. /*
  1139.  * FileFormat::GetPacket() only calls:
  1140.  *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, 
  1141.  *     FS->Read(), FS->Close(), FS->Seek(),
  1142.  *     FFR->PacketReady(), FFR->StreamDone()
  1143.  *     Context->Scheduler->*,
  1144.  *     CCF->CI(Mutex), Mutex->*
  1145.  *     Context->ErrorMessages
  1146.  *
  1147.  * XXXSMPNOW
  1148.  */
  1149. #define RMA_THREADSAFE_METHOD_FS_READ 0x00000002
  1150. /*
  1151.  * FileSystem::Read()/Seek()/Close() only calls:
  1152.  *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, 
  1153.  *     FS->Read(), FS->Close(), FS->Seek(),
  1154.  *     Context->Scheduler->*,
  1155.  *     CCF->CI(Mutex), Mutex->*
  1156.  *     Context->ErrorMessages
  1157.  *
  1158.  * XXXSMPNOW
  1159.  */
  1160. #define RMA_THREADSAFE_METHOD_FSR_READDONE 0x00000004
  1161. /*
  1162.  * FileFormat::ReadDone()/SeekDone()/CloseDone() only calls:
  1163.  *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, 
  1164.  *     FS->Read(), FS->Close(), FS->Seek(),
  1165.  *     FFR->PacketReady(), FFR->StreamDone()
  1166.  *     Context->Scheduler->*,
  1167.  *     CCF->CI(Mutex), Mutex->*
  1168.  *     Context->ErrorMessages
  1169.  *
  1170.  * XXXSMPNOW
  1171.  */
  1172. #define RMA_THREADSAFE_METHOD_CACHE_FILE 0x00000008
  1173. /*
  1174.  * FileSystem::Read()/Seek()/Close() only calls:
  1175.  *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, 
  1176.  *     FS->Read(), FS->Close(), FS->Seek(),
  1177.  *     IRMACacheFile->*, IRMACacheFileResponse->*,
  1178.  *     Context->Scheduler->*,
  1179.  *     CCF->CI(Mutex), Mutex->*
  1180.  *     Context->ErrorMessages
  1181.  *
  1182.  * XXXSMPNOW
  1183.  */
  1184. #define RMA_THREADSAFE_METHOD_CACHE_FILE_RESPONSE 0x00000010
  1185. /*
  1186.  * FileSystem::Read()/Seek()/Close() only calls:
  1187.  *     CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free, 
  1188.  *     FS->Read(), FS->Close(), FS->Seek(),
  1189.  *     IRMACacheFile->*, IRMACacheFileResponse->*,
  1190.  *     Context->Scheduler->*,
  1191.  *     CCF->CI(Mutex), Mutex->*
  1192.  *     Context->ErrorMessages
  1193.  *
  1194.  * XXXSMPNOW
  1195.  */
  1196. /****************************************************************************
  1197.  * 
  1198.  *  Interface:
  1199.  * 
  1200.  * IRMAThreadSafeMethods
  1201.  * 
  1202.  *  Purpose:
  1203.  * 
  1204.  * XXXSMPNOW
  1205.  * 
  1206.  *  IID_IRMAThreadSafeMethods:
  1207.  * 
  1208.  * {00000115-0901-11d1-8B06-00A024406D59}
  1209.  * 
  1210.  */
  1211. DEFINE_GUID(IID_IRMAThreadSafeMethods, 0x00000115, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  1212. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1213. #undef  INTERFACE
  1214. #define INTERFACE   IRMAThreadSafeMethods
  1215. DECLARE_INTERFACE_(IRMAThreadSafeMethods, IUnknown)
  1216. {
  1217.     /*
  1218.      * IUnknown methods
  1219.      */
  1220.     STDMETHOD(QueryInterface) (THIS_
  1221. REFIID riid,
  1222. void** ppvObj) PURE;
  1223.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1224.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1225.     /*
  1226.      * IRMAThreadSafeMethods methods
  1227.      */
  1228.     /************************************************************************
  1229.      * Method:
  1230.      *     IRMAThreadSafeMethods::IsThreadSafe
  1231.      * Purpose:
  1232.      *     XXXSMPNOW
  1233.      */
  1234.     STDMETHOD_(UINT32,IsThreadSafe)     (THIS) PURE;
  1235. };
  1236. /****************************************************************************
  1237.  * 
  1238.  *  Interface:
  1239.  * 
  1240.  * IRMAMutex
  1241.  * 
  1242.  *  Purpose:
  1243.  * 
  1244.  * XXXSMPNOW
  1245.  * 
  1246.  *  IID_IRMAMutex:
  1247.  * 
  1248.  * {00000116-0901-11d1-8B06-00A024406D59}
  1249.  * 
  1250.  */
  1251. DEFINE_GUID(IID_IRMAMutex, 0x00000116, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  1252. 0xa0, 0x24, 0x40, 0x6d, 0x59);
  1253. #undef  INTERFACE
  1254. #define INTERFACE   IRMAMutex
  1255. /*
  1256.  *  The IRMACommonClassFactory supports creating an instance
  1257.  *  of this object.
  1258.  */
  1259. #define CLSID_IRMAMutex IID_IRMAMutex
  1260. DECLARE_INTERFACE_(IRMAMutex, IUnknown)
  1261. {
  1262.     /*
  1263.      * IUnknown methods
  1264.      */
  1265.     STDMETHOD(QueryInterface) (THIS_
  1266. REFIID riid,
  1267. void** ppvObj) PURE;
  1268.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1269.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1270.     /*
  1271.      * IRMAMutex methods
  1272.      */
  1273.      /* XXXSMPNOW Comments */
  1274.     STDMETHOD(Lock)     (THIS) PURE;
  1275.     STDMETHOD(TryLock)     (THIS) PURE;
  1276.     STDMETHOD(Unlock)     (THIS) PURE;
  1277. };
  1278. #endif /* _RMAENGIN_H_ */