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.

144 lines
4.2 KiB

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