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.

245 lines
6.2 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. /*++
  3. Copyright (C) Microsoft Corporation, 1997 - 1999
  4. Module Name:
  5. MachineNode.h
  6. Abstract:
  7. Header file for the MachineNode subnode.
  8. See MachineNode.cpp for implementation.
  9. Revision History:
  10. mmaguire 12/03/97 - created
  11. --*/
  12. //////////////////////////////////////////////////////////////////////////////
  13. #if !defined(_NAP_MACHINE_NODE_H_)
  14. #define _NAP_MACHINE_NODE_H_
  15. //////////////////////////////////////////////////////////////////////////////
  16. // BEGIN INCLUDES
  17. //
  18. // where we can find what this class derives from:
  19. //
  20. #include "SnapinNode.h"
  21. #include "rtradvise.h"
  22. //
  23. //
  24. // where we can find what this class has or uses:
  25. //
  26. #include "PoliciesNode.h"
  27. #include "ConnectionToServer.h"
  28. #include <map>
  29. #include <string>
  30. //
  31. // END INCLUDES
  32. //////////////////////////////////////////////////////////////////////////////
  33. //////////////////////////////////////////////////////////////////////////////
  34. // Functor needed for CComBSTR comparison used in map below
  35. //////////////////////////////////////////////////////////////////////////////
  36. //class MySort
  37. //{
  38. //
  39. //public:
  40. //
  41. // MySort()
  42. // {
  43. // ;
  44. // }
  45. //
  46. //// bool operator()( const CComBSTR & x, const CComBSTR & y) const throw ()
  47. //
  48. // bool operator()( const pair< CComBSTR, CMachineNode* > & x, const pair< CComBSTR, CMachineNode* > & y) const throw ()
  49. // {
  50. //
  51. // bool bReturnValue = FALSE;
  52. //
  53. // return bReturnValue;
  54. //
  55. // }
  56. //
  57. //};
  58. class CComponentData;
  59. class CComponent;
  60. //typedef std::map< string, CMachineNode *, MySort() > SERVERSMAP;
  61. typedef std::map< std::basic_string< wchar_t > , CMachineNode * > SERVERSMAP;
  62. class CMachineNode : public CSnapinNode< CMachineNode, CComponentData, CComponent >
  63. {
  64. public:
  65. // Clipboard format through which this extension snapin receives
  66. // information about machine it's focussed on.
  67. static CLIPFORMAT m_CCF_MMC_SNAPIN_MACHINE_NAME;
  68. static void InitClipboardFormat();
  69. // Returns whether we extend a particular GUID and sets the
  70. // m_enumExtendedSnapin to indicate which snapin we are extending.
  71. BOOL IsSupportedGUID( GUID & guid );
  72. // Indicates which standalone snapin we are extending.
  73. _enum_EXTENDED_SNAPIN m_enumExtendedSnapin;
  74. HRESULT InitSdoObjects();
  75. SNAPINMENUID(IDM_MACHINE_NODE)
  76. BEGIN_SNAPINTOOLBARID_MAP(CMachineNode)
  77. SNAPINTOOLBARID_ENTRY(IDR_MACHINE_TOOLBAR)
  78. END_SNAPINTOOLBARID_MAP()
  79. CSnapInItem * GetExtNodeObject(LPDATAOBJECT pDataObject, CMachineNode * pDataClass );
  80. CMachineNode();
  81. ~CMachineNode();
  82. LPOLESTR GetResultPaneColInfo(int nCol);
  83. // Pointer to the CComponentData object owning this node.
  84. // A root node doesn't belong to another node, so its
  85. // m_pParentNode pointer is NULL.
  86. // Rather it is owned by the unique IComponentData object
  87. // for this snapin.
  88. // We pass in this CComponentData pointer during CComponentData initialization.
  89. // By storing this pointer, we can have access to member
  90. // variables stored in CComponentData, e.g. a pointer to IConsole.
  91. // Since all nodes store a pointer to their parent, any node
  92. // can look its way up the tree and get access to CComponentData.
  93. CComponentData * m_pComponentData;
  94. void InitDataClass(IDataObject* pDataObject, CSnapInItem* pDefault);
  95. BOOL m_fAlreadyAnalyzedDataClass;
  96. BOOL m_bConfigureLocal;
  97. CComBSTR m_bstrServerAddress;
  98. HRESULT DataRefresh();
  99. virtual HRESULT OnExpand(
  100. LPARAM arg
  101. , LPARAM param
  102. , IComponentData * pComponentData
  103. , IComponent * pComponent
  104. , DATA_OBJECT_TYPES type
  105. );
  106. virtual HRESULT OnRename(
  107. LPARAM arg
  108. , LPARAM param
  109. , IComponentData * pComponentData
  110. , IComponent * pComponent
  111. , DATA_OBJECT_TYPES type
  112. );
  113. virtual HRESULT OnRemoveChildren(
  114. LPARAM arg
  115. , LPARAM param
  116. , IComponentData * pComponentData
  117. , IComponent * pComponent
  118. , DATA_OBJECT_TYPES type
  119. );
  120. STDMETHOD(TaskNotify)(
  121. IDataObject * pDataObject
  122. , VARIANT * pvarg
  123. , VARIANT * pvparam
  124. );
  125. STDMETHOD(EnumTasks)(
  126. IDataObject * pDataObject
  127. , BSTR szTaskGroup
  128. , IEnumTASK** ppEnumTASK
  129. );
  130. HRESULT OnTaskPadDefineNetworkAccessPolicy(
  131. IDataObject * pDataObject
  132. , VARIANT * pvarg
  133. , VARIANT * pvparam
  134. );
  135. CComponentData * GetComponentData( void );
  136. // Pointers to child nodes.
  137. CPoliciesNode * m_pPoliciesNode; // this is one CPoliciesNode object
  138. ////////////////////////////////////////////////////////////////////////////
  139. //
  140. // Asynchrnous connect related...
  141. //
  142. ////////////////////////////////////////////////////////////////////////////
  143. HRESULT BeginConnectAction( void );
  144. HRESULT LoadSdoData(BOOL fDSAvailable);
  145. ////////////////////////////////////////////////////////////////////////////
  146. //
  147. // RRAS related
  148. //
  149. ////////////////////////////////////////////////////////////////////////////
  150. // OnRRASChange -- to decide if to show RAP node under the machine node
  151. // Only show RAP node if NT Authentication is selected
  152. HRESULT OnRRASChange(
  153. /* [in] */ LONG_PTR ulConnection,
  154. /* [in] */ DWORD dwChangeType,
  155. /* [in] */ DWORD dwObjectType,
  156. /* [in] */ LPARAM lUserParam,
  157. /* [in] */ LPARAM lParam);
  158. HRESULT TryShow(BOOL* pbVisible);
  159. BOOL m_bServerSupported;
  160. ////////////////////////////////////////////////////////////////////////////
  161. //
  162. // SDO related pointers
  163. //
  164. ////////////////////////////////////////////////////////////////////////////
  165. protected:
  166. virtual HRESULT SetVerbs( IConsoleVerb * pConsoleVerb );
  167. BOOL m_fSdoConnected;
  168. BOOL m_fUseActiveDirectory;
  169. BOOL m_fDSAvailable;
  170. CConnectionToServer* m_pConnectionToServer;
  171. BOOL m_fNodeHasUI;
  172. // For extending snapins like RRAS which have multiple machine views.
  173. SERVERSMAP m_mapMachineNodes;
  174. CComPtr< CRtrAdviseSinkForIAS<CMachineNode> > m_spRtrAdviseSink;
  175. };
  176. _declspec( selectany ) CLIPFORMAT CMachineNode::m_CCF_MMC_SNAPIN_MACHINE_NAME = 0;
  177. // _declspec( selectany ) _enum_EXTENDED_SNAPIN CMachineNode::m_enumExtendedSnapin = INTERNET_AUTHENTICATION_SERVICE_SNAPIN;
  178. #endif // _NAP_MACHINE_NODE_H_