Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

157 lines
4.5 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. H323term.h
  5. Abstract:
  6. Definitions for the CH323BaseTerminal
  7. Author:
  8. Zoltan Szilagyi (zoltans) September 6,1998
  9. --*/
  10. #ifndef _H323TERM_H_
  11. #define _H323TERM_H_
  12. /////////////////////////////////////////////////////////////////////////////
  13. /////////////////////////////////////////////////////////////////////////////
  14. //
  15. // CH323BaseTerminal
  16. //
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19. /////////////////////////////////////////////////////////////////////////////
  20. #if 0
  21. // {e309dcd8-1ed6-11d3-a576-00c04f8ef6e3}
  22. DEFINE_GUID(IID_IH323PrivateTerminal,
  23. 0xe309dcd8, 0x1ed6, 0x11d3, 0xa5, 0x76, 0x00, 0xc0, 0x4f, 0x8e, 0xf6, 0xe3);
  24. DECLARE_INTERFACE_(IH323PrivateTerminal, IUnknown)
  25. {
  26. STDMETHOD (GetFilter) (THIS_
  27. IBaseFilter *
  28. ) PURE;
  29. };
  30. #endif
  31. class CH323BaseTerminal :
  32. virtual public CComObjectRootEx<CComMultiThreadModelNoCS>, // we have our own CS implementation
  33. public IDispatchImpl<ITTerminal, &IID_ITTerminal, &LIBID_TAPI3Lib>,
  34. public ITTerminalControl,
  35. public CMSPObjectSafetyImpl
  36. {
  37. BEGIN_COM_MAP(CH323BaseTerminal)
  38. COM_INTERFACE_ENTRY(IObjectSafety)
  39. COM_INTERFACE_ENTRY(IDispatch)
  40. COM_INTERFACE_ENTRY(ITTerminal)
  41. COM_INTERFACE_ENTRY(ITTerminalControl)
  42. COM_INTERFACE_ENTRY2(IDispatch, ITTerminal)
  43. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pFTM)
  44. END_COM_MAP()
  45. DECLARE_GET_CONTROLLING_UNKNOWN()
  46. public:
  47. CH323BaseTerminal();
  48. HRESULT FinalConstruct();
  49. virtual ~CH323BaseTerminal();
  50. public:
  51. // ITTerminal -- COM interface for use by MSP or application
  52. STDMETHOD(get_TerminalClass)(OUT BSTR *pVal);
  53. STDMETHOD(get_TerminalType) (OUT TERMINAL_TYPE *pVal);
  54. STDMETHOD(get_State) (OUT TERMINAL_STATE *pVal);
  55. STDMETHOD(get_Name) (OUT BSTR *pVal);
  56. STDMETHOD(get_MediaType) (OUT long * plMediaType);
  57. STDMETHOD(get_Direction) (OUT TERMINAL_DIRECTION *pDirection);
  58. // ITTerminalControl -- COM interface for use by MSP only
  59. STDMETHOD (get_AddressHandle) (
  60. OUT MSP_HANDLE * phtAddress
  61. );
  62. STDMETHOD (ConnectTerminal) (
  63. IN IGraphBuilder * pGraph,
  64. IN DWORD dwReserved,
  65. IN OUT DWORD * pdwNumPins,
  66. OUT IPin ** ppPins
  67. );
  68. STDMETHOD (CompleteConnectTerminal) (void);
  69. STDMETHOD (DisconnectTerminal) (
  70. IN IGraphBuilder * pGraph,
  71. IN DWORD dwReserved
  72. );
  73. STDMETHOD (RunRenderFilter) (void);
  74. STDMETHOD (StopRenderFilter) (void);
  75. public:
  76. HRESULT Initialize(
  77. IN WCHAR * strName,
  78. IN MSP_HANDLE htAddress
  79. );
  80. HRESULT Initialize(
  81. IN char * strName,
  82. IN MSP_HANDLE htAddress
  83. );
  84. protected:
  85. void Lock() { EnterCriticalSection(&m_CritSec); }
  86. void Unlock() { LeaveCriticalSection(&m_CritSec); }
  87. virtual DWORD GetNumExposedPins() const = 0;
  88. virtual HRESULT CreateFilter() = 0;
  89. virtual HRESULT GetExposedPins(
  90. IN IPin ** ppPins,
  91. IN DWORD dwNumPins
  92. ) = 0;
  93. virtual HRESULT AddFilterToGraph(
  94. IN IGraphBuilder *pGraph
  95. );
  96. virtual HRESULT RemoveFilterFromGraph(
  97. IN IGraphBuilder *pGraph
  98. );
  99. protected:
  100. // The lock that protects the data members.
  101. CRITICAL_SECTION m_CritSec;
  102. BOOL m_fCritSecValid;
  103. // these five numbers need to be set by the derived class.
  104. GUID m_TerminalClassID;
  105. TERMINAL_DIRECTION m_TerminalDirection;
  106. TERMINAL_TYPE m_TerminalType;
  107. TERMINAL_STATE m_TerminalState;
  108. DWORD m_dwMediaType;
  109. WCHAR m_szName[MAX_PATH + 1];
  110. MSP_HANDLE m_htAddress;
  111. // Pointer to the free threaded marshaler.
  112. IUnknown * m_pFTM;
  113. // stores the filter graph builder (derives from IFilterGraph)
  114. IGraphBuilder * m_pGraph;
  115. IBaseFilter * m_pFilter;
  116. };
  117. #endif // _H323TERM_H_