Source code of Windows XP (NT5)
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.

383 lines
9.6 KiB

  1. /*++
  2. Module Name:
  3. MmcRoot.h
  4. Abstract:
  5. This module contains the definition for CMmcDfsRoot class. This is an class
  6. for MMC display related calls for the first level node(the DfsRoot nodes)
  7. Also contains members and method to be able to manipulate IDfsRoot object
  8. and add the same to the MMC Console
  9. --*/
  10. #if !defined(AFX_MMCDFSROOT_H__D78B64F3_3E2B_11D1_AA1A_00C06C00392D__INCLUDED_)
  11. #define AFX_MMCDFSROOT_H__D78B64F3_3E2B_11D1_AA1A_00C06C00392D__INCLUDED_
  12. #if _MSC_VER >= 1000
  13. #pragma once
  14. #endif // _MSC_VER >= 1000
  15. #include "MmcDispl.h"
  16. #include "DfsCore.h"
  17. #include "JPProp.h"
  18. #include "frsProp.h"
  19. #include "pubProp.h"
  20. #include "DfsEnums.h"
  21. #include <list>
  22. using namespace std;
  23. class CMmcDfsAdmin;
  24. class CMmcDfsJunctionPoint;
  25. class CMmcDfsReplica;
  26. class JP_LIST_NODE
  27. {
  28. public:
  29. CMmcDfsJunctionPoint* pJPoint;
  30. JP_LIST_NODE (CMmcDfsJunctionPoint* i_pMmcJP); // constructor defined as inline in MmcJp.cpp
  31. ~JP_LIST_NODE (); // destructor defined as inline in MmcJp.cpp
  32. };
  33. typedef list<JP_LIST_NODE*> DFS_JUNCTION_LIST;
  34. class REP_LIST_NODE
  35. {
  36. public:
  37. CMmcDfsReplica* pReplica;
  38. REP_LIST_NODE (CMmcDfsReplica* i_pMmcReplica); // constructor defined as inline in MmcRep.cpp
  39. ~REP_LIST_NODE (); // destructor defined as inline in MmcRep.cpp
  40. };
  41. typedef list<REP_LIST_NODE*> DFS_REPLICA_LIST;
  42. class CMmcDfsRoot : public CMmcDisplay
  43. {
  44. public:
  45. CMmcDfsRoot(
  46. IN IDfsRoot* i_pDfsRoot,
  47. IN CMmcDfsAdmin* i_pMmcDfsAdmin,
  48. IN LPCONSOLE2 i_lpConsole,
  49. IN ULONG i_ulLinkFilterMaxLimit = FILTERDFSLINKS_MAXLIMIT_DEFAULT,
  50. IN FILTERDFSLINKS_TYPE i_lLinkFilterType = FILTERDFSLINKS_TYPE_NO_FILTER,
  51. IN BSTR i_bstrLinkFilterName = NULL
  52. );
  53. virtual ~CMmcDfsRoot();
  54. // Not implemented
  55. private:
  56. CMmcDfsRoot();
  57. public:
  58. // For adding context menu items
  59. STDMETHOD(AddMenuItems)(
  60. IN LPCONTEXTMENUCALLBACK i_lpContextMenuCallback,
  61. IN LPLONG i_lpInsertionAllowed
  62. );
  63. // For taking action on a context menu selection.
  64. STDMETHOD(Command)(
  65. IN LONG i_lCommandID
  66. );
  67. // Set the headers for the listview (in the result pane) column
  68. STDMETHOD(SetColumnHeader)(
  69. IN LPHEADERCTRL2 i_piHeaderControl
  70. );
  71. // Return the requested display information for the Result Pane
  72. STDMETHOD(GetResultDisplayInfo)(
  73. IN OUT LPRESULTDATAITEM io_pResultDataItem
  74. );
  75. // Return the requested display information for the Scope Pane
  76. STDMETHOD(GetScopeDisplayInfo)(
  77. IN OUT LPSCOPEDATAITEM io_pScopeDataItem
  78. );
  79. // Add all containing items to the Scope Pane
  80. STDMETHOD(EnumerateScopePane)(
  81. IN LPCONSOLENAMESPACE i_lpConsoleNameSpace,
  82. IN HSCOPEITEM i_hParent
  83. );
  84. // Add all containing items to the Result Pane
  85. STDMETHOD(EnumerateResultPane)(
  86. IN OUT IResultData* io_pResultData
  87. );
  88. // Delete the node from m_MmcJPList
  89. STDMETHOD(DeleteMmcJPNode)(
  90. IN CMmcDfsJunctionPoint* i_pJPoint
  91. );
  92. // Delete the current object
  93. STDMETHOD(OnDeleteConnectionToDfsRoot)(
  94. BOOLEAN i_bForRemoveDfs = FALSE
  95. );
  96. // Add the current item to the Scope Pane
  97. STDMETHOD(AddItemToScopePane)(
  98. IN LPCONSOLENAMESPACE i_lpConsoleNameSpace,
  99. IN HSCOPEITEM i_hParent
  100. );
  101. // Set the console verb settings. Change the state, decide the default verb, etc
  102. STDMETHOD(SetConsoleVerbs)(
  103. IN LPCONSOLEVERB i_lpConsoleVerb
  104. );
  105. // let MMC handle the default verb.
  106. STDMETHOD(DoDblClick)(
  107. ) { return S_FALSE; }
  108. // Delete the current item.
  109. STDMETHOD(DoDelete)(
  110. );
  111. // Checks whether the object has pages to display
  112. STDMETHOD(QueryPagesFor)(
  113. );
  114. // Creates and passes back the pages to be displayed
  115. STDMETHOD(CreatePropertyPages)(
  116. IN LPPROPERTYSHEETCALLBACK i_lpPropSheetCallback,
  117. IN LONG_PTR i_lNotifyHandle
  118. );
  119. STDMETHOD(CreateFrsPropertyPage)(
  120. IN LPPROPERTYSHEETCALLBACK i_lpPropSheetCallback,
  121. IN LONG_PTR i_lNotifyHandle
  122. );
  123. STDMETHOD(CreatePublishPropertyPage)(
  124. IN LPPROPERTYSHEETCALLBACK i_lpPropSheetCallback,
  125. IN LONG_PTR i_lNotifyHandle
  126. );
  127. // Used to notify the object that it's properties have changed
  128. STDMETHOD(PropertyChanged)(
  129. );
  130. // Used to set the result view description bar text
  131. STDMETHOD(SetDescriptionBarText)(
  132. IN LPRESULTDATA i_lpResultData
  133. );
  134. STDMETHOD(SetStatusText)(
  135. IN LPCONSOLE2 i_lpConsole
  136. );
  137. // Delete the Remove (Stop hosting) the Dfs Root.
  138. STDMETHOD(OnDeleteDfsRoot)(
  139. );
  140. STDMETHOD(OnDeleteDisplayedDfsLinks)(
  141. );
  142. // Handle a select event for the node. Handle only toolbar related
  143. // activities here
  144. STDMETHOD(ToolbarSelect)(
  145. IN const LONG i_lArg,
  146. IN IToolbar* i_pToolBar
  147. );
  148. // Handle a click on the toolbar
  149. STDMETHOD(ToolbarClick)(
  150. IN const LPCONTROLBAR i_pControlbar,
  151. IN const LPARAM i_lParam
  152. );
  153. // Handle the menu item (and toolbar) for root replica.
  154. STDMETHOD(OnNewRootReplica)(
  155. );
  156. // Helper member function to actually delete (Stop hosting) the Dfs Root.
  157. // This is also called to delete root level replica.
  158. HRESULT _DeleteDfsRoot(
  159. IN BSTR i_bstrServerName,
  160. IN BSTR i_bstrShareName,
  161. IN BSTR i_bstrFtDfsName
  162. );
  163. STDMETHOD(CleanScopeChildren)(
  164. VOID
  165. );
  166. STDMETHOD(CleanResultChildren)(
  167. );
  168. STDMETHOD(RefreshResultChildren)(
  169. );
  170. STDMETHOD(ViewChange)(
  171. IResultData* i_pResultData,
  172. LONG_PTR i_lHint
  173. );
  174. STDMETHOD(AddResultPaneItem)(
  175. CMmcDfsReplica* i_pReplicaDispObject
  176. );
  177. STDMETHOD(RemoveJP)(LPCTSTR i_pszDisplayName);
  178. STDMETHOD(RemoveReplica)(LPCTSTR i_pszDisplayName);
  179. STDMETHOD(RemoveResultPaneItem)(
  180. CMmcDfsReplica* i_pReplicaDispObject
  181. );
  182. // Check the replica status
  183. STDMETHOD(OnCheckStatus)(
  184. );
  185. STDMETHOD(GetEntryPath)(BSTR* o_pbstrEntryPath)
  186. { GET_BSTR(m_bstrRootEntryPath, o_pbstrEntryPath); }
  187. DISPLAY_OBJECT_TYPE GetDisplayObjectType() { return DISPLAY_OBJECT_TYPE_ROOT; }
  188. HRESULT CreateToolbar(
  189. IN const LPCONTROLBAR i_pControlbar,
  190. IN const LPEXTENDCONTROLBAR i_lExtendControlbar,
  191. OUT IToolbar** o_ppToolBar
  192. );
  193. HRESULT OnRefresh(
  194. );
  195. HRESULT OnRefreshFilteredLinks(
  196. );
  197. STDMETHOD(OnFilterDfsLinks)();
  198. ULONG get_LinkFilterMaxLimit() { return m_ulLinkFilterMaxLimit; }
  199. FILTERDFSLINKS_TYPE get_LinkFilterType() { return m_lLinkFilterType; }
  200. BSTR get_LinkFilterName() { return (BSTR)m_bstrLinkFilterName; }
  201. BOOL get_ShowFRS() { return m_bShowFRS; }
  202. HRESULT ClosePropertySheet(BOOL bSilent);
  203. HRESULT ClosePropertySheetsOfAllLinks(BOOL bSilent);
  204. HRESULT CloseAllPropertySheets(BOOL bSilent);
  205. private:
  206. // Create a new junction point. Displays the dialog box and call the other method
  207. STDMETHOD(OnCreateNewJunctionPoint)();
  208. // Create a new junction point.
  209. STDMETHOD(OnCreateNewJunctionPoint)(
  210. IN LPCTSTR i_szJPName,
  211. IN LPCTSTR i_szServerName,
  212. IN LPCTSTR i_szShareName,
  213. IN LPCTSTR i_szComment,
  214. IN long i_lTimeOut
  215. );
  216. HRESULT OnNewReplicaSet();
  217. HRESULT OnShowReplication();
  218. HRESULT OnStopReplication(BOOL bConfirm = FALSE);
  219. HRESULT GetIReplicaSetPtr(IReplicaSet** o_ppiReplicaSet);
  220. // Confirm the delete operation with the user.
  221. HRESULT ConfirmOperationOnDfsRoot(int idString);
  222. HRESULT ConfirmDeleteDisplayedDfsLinks(
  223. );
  224. HRESULT _InitReplicaSet(); // init m_piReplicaSet
  225. BOOL IsNewSchema() { return m_bNewSchema; }
  226. // Constants, Statics, etc
  227. public:
  228. static const int m_iIMAGEINDEX;
  229. static const int m_iOPENIMAGEINDEX;
  230. // Data members
  231. private:
  232. friend class CMmcDfsJunctionPoint;
  233. friend class CMmcDfsReplica; // so that MmcJP can access m_DfsRoot;
  234. CComPtr<IDfsRoot> m_DfsRoot; // IDfsRoot object
  235. CComPtr<IReplicaSet> m_piReplicaSet;
  236. CComBSTR m_bstrDisplayName; // Display name of the current DfsRoot
  237. CComBSTR m_bstrRootEntryPath; // Root EntryPath;
  238. DFS_TYPE m_lDfsRootType; // Type of the DfsRoot, Standalone or Fault Tolerant
  239. long m_lRootJunctionState;
  240. HSCOPEITEM m_hScopeItem; // Scopeitem handle
  241. CMmcDfsAdmin* m_pParent; // Pointer to the parent
  242. DFS_JUNCTION_LIST m_MmcJPList; // The list of child Junction points
  243. DFS_REPLICA_LIST m_MmcRepList; // The list of replicas
  244. CComBSTR m_bstrFullDisplayName;
  245. ULONG m_ulLinkFilterMaxLimit;
  246. FILTERDFSLINKS_TYPE m_lLinkFilterType;
  247. CComBSTR m_bstrLinkFilterName; // string filter on junction points
  248. ULONG m_ulCountOfDfsJunctionPointsFiltered;
  249. CReplicaSetPropPage m_PropPage; // The property page
  250. CRealReplicaSetPropPage m_frsPropPage;
  251. BOOL m_bShowFRS;
  252. BOOL m_bNewSchema;
  253. CPublishPropPage m_publishPropPage;
  254. CComPtr<IConsole2> m_lpConsole; // The Console callback. The mother of all mmc interfaces
  255. CComPtr<IConsoleNameSpace> m_lpConsoleNameSpace; // The Callback used to do Scope Pane operations
  256. };
  257. #endif // !defined(AFX_MMCDFSROOT_H__D78B64F3_3E2B_11D1_AA1A_00C06C00392D__INCLUDED_)