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.

206 lines
4.8 KiB

  1. /*
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. */
  4. #ifndef __PTREG__
  5. #define __PTREG__
  6. #include "PTUtil.h"
  7. //
  8. // CPlugTerminal implements ITPTRegTerminal interface
  9. //
  10. class ATL_NO_VTABLE CPlugTerminal :
  11. public CComCoClass<CPlugTerminal, &CLSID_PluggableTerminalRegistration>,
  12. public IDispatchImpl<ITPluggableTerminalClassRegistration, &IID_ITPluggableTerminalClassRegistration, &LIBID_TERMMGRLib>,
  13. public CComObjectRootEx<CComMultiThreadModel>
  14. {
  15. public:
  16. DECLARE_REGISTRY_RESOURCEID(IDR_PTREGTERMINAL)
  17. DECLARE_NOT_AGGREGATABLE(CPlugTerminal)
  18. DECLARE_GET_CONTROLLING_UNKNOWN()
  19. virtual HRESULT FinalConstruct(void);
  20. BEGIN_COM_MAP(CPlugTerminal)
  21. COM_INTERFACE_ENTRY(ITPluggableTerminalClassRegistration)
  22. COM_INTERFACE_ENTRY(IDispatch)
  23. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pFTM)
  24. END_COM_MAP()
  25. public:
  26. CPlugTerminal() :
  27. m_pFTM(NULL)
  28. {
  29. }
  30. ~CPlugTerminal()
  31. {
  32. if( m_pFTM )
  33. {
  34. m_pFTM->Release();
  35. m_pFTM = NULL;
  36. }
  37. }
  38. public:
  39. STDMETHOD(get_Name)(
  40. /*[out, retval]*/ BSTR* pName
  41. );
  42. STDMETHOD(put_Name)(
  43. /*[in]*/ BSTR bstrName
  44. );
  45. STDMETHOD(get_Company)(
  46. /*[out, retval]*/ BSTR* pCompany
  47. );
  48. STDMETHOD(put_Company)(
  49. /*[in]*/ BSTR bstrCompany
  50. );
  51. STDMETHOD(get_Version)(
  52. /*[out, retval]*/ BSTR* pVersion
  53. );
  54. STDMETHOD(put_Version)(
  55. /*[in]*/ BSTR bstrVersion
  56. );
  57. STDMETHOD(get_TerminalClass)(
  58. /*[out, retval]*/ BSTR* pTerminalClass
  59. );
  60. STDMETHOD(put_TerminalClass)(
  61. /*[in]*/ BSTR bstrTerminalClass
  62. );
  63. STDMETHOD(get_CLSID)(
  64. /*[out, retval]*/ BSTR* pCLSID
  65. );
  66. STDMETHOD(put_CLSID)(
  67. /*[in]*/ BSTR bstrCLSID
  68. );
  69. STDMETHOD(get_Direction)(
  70. /*[out, retval]*/ TMGR_DIRECTION* pDirection
  71. );
  72. STDMETHOD(put_Direction)(
  73. /*[in]*/ TMGR_DIRECTION nDirection
  74. );
  75. STDMETHOD(get_MediaTypes)(
  76. /*[out, retval]*/ long* pMediaTypes
  77. );
  78. STDMETHOD(put_MediaTypes)(
  79. /*[in]*/ long nMediaTypes
  80. );
  81. STDMETHOD(Add)(
  82. /*[in]*/ BSTR bstrSuperclass
  83. );
  84. STDMETHOD(Delete)(
  85. /*[in]*/ BSTR bstrSuperclass
  86. );
  87. STDMETHOD(GetTerminalClassInfo)(
  88. /*[in]*/ BSTR bstrSuperclass
  89. );
  90. private:
  91. CMSPCritSection m_CritSect; // Critical Section
  92. CPTTerminal m_Terminal; // Terminal stuff
  93. IUnknown* m_pFTM; // pointer to the free threaded marshaler
  94. };
  95. //
  96. // CPlugTerminalSuperclass implements ITPTRegTerminalClass interface
  97. //
  98. class ATL_NO_VTABLE CPlugTerminalSuperclass :
  99. public CComCoClass<CPlugTerminalSuperclass, &CLSID_PluggableSuperclassRegistration>,
  100. public IDispatchImpl<ITPluggableTerminalSuperclassRegistration, &IID_ITPluggableTerminalSuperclassRegistration, &LIBID_TERMMGRLib>,
  101. public CComObjectRootEx<CComMultiThreadModel>
  102. {
  103. public:
  104. DECLARE_REGISTRY_RESOURCEID(IDR_PTREGTERMCLASS)
  105. DECLARE_NOT_AGGREGATABLE(CPlugTerminalSuperclass)
  106. DECLARE_GET_CONTROLLING_UNKNOWN()
  107. virtual HRESULT FinalConstruct(void);
  108. BEGIN_COM_MAP(CPlugTerminalSuperclass)
  109. COM_INTERFACE_ENTRY(ITPluggableTerminalSuperclassRegistration)
  110. COM_INTERFACE_ENTRY(IDispatch)
  111. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pFTM)
  112. END_COM_MAP()
  113. public:
  114. CPlugTerminalSuperclass() :
  115. m_pFTM(NULL)
  116. {
  117. }
  118. ~CPlugTerminalSuperclass()
  119. {
  120. if( m_pFTM )
  121. {
  122. m_pFTM->Release();
  123. m_pFTM = NULL;
  124. }
  125. }
  126. public:
  127. STDMETHOD(get_Name)(
  128. /*[out, retval]*/ BSTR* pName
  129. );
  130. STDMETHOD(put_Name)(
  131. /*[in]*/ BSTR bstrName
  132. );
  133. STDMETHOD(get_CLSID)(
  134. /*[out, retval]*/ BSTR* pCLSID
  135. );
  136. STDMETHOD(put_CLSID)(
  137. /*[in]*/ BSTR bstrCLSID
  138. );
  139. STDMETHOD(Add)(
  140. );
  141. STDMETHOD(Delete)(
  142. );
  143. STDMETHOD(GetTerminalSuperclassInfo)(
  144. );
  145. STDMETHOD(get_TerminalClasses)(
  146. /*[out, retval]*/ VARIANT* pTerminals
  147. );
  148. STDMETHOD(EnumerateTerminalClasses)(
  149. OUT IEnumTerminalClass** ppTerminals
  150. );
  151. private:
  152. CMSPCritSection m_CritSect; // Critical Section
  153. CPTSuperclass m_Superclass; // Terminal superclass
  154. IUnknown* m_pFTM; // pointer to the free threaded marshaler
  155. };
  156. #endif
  157. // eof