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.

202 lines
5.0 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1999 **/
  4. /**********************************************************************/
  5. /*
  6. root.h
  7. Root node information (the root node is not displayed
  8. in the MMC framework but contains information such as
  9. all of the subnodes in this snapin).
  10. FILE HISTORY:
  11. */
  12. #ifndef _DMVROOT_H
  13. #define _DMVROOT_H
  14. #ifndef _BASEHAND_H
  15. #include "basehand.h"
  16. #endif
  17. #ifndef _HANDLERS_H
  18. #include "handlers.h"
  19. #endif
  20. #ifndef _QUERYOBJ_H
  21. #include "queryobj.h"
  22. #endif
  23. #ifndef _ATLKSTRM_H
  24. #include "ATLKstrm.h"
  25. #endif
  26. #ifndef _INFO_H
  27. #include "info.h"
  28. #endif
  29. #ifndef _ROOT_H
  30. #include "root.h"
  31. #endif
  32. #ifndef _MACHINE_H
  33. #include "machine.h"
  34. #endif
  35. #ifndef AFX_DLGSVR_H__19556672_96AB_11D1_8575_00C04FC31FD3__INCLUDED_
  36. #include "rrasqry.h"
  37. #endif
  38. #ifndef _DMVSTRM_H
  39. #include "dmvstrm.h"
  40. #endif
  41. #include "refresh.h"
  42. #define COMPUTERNAME_LEN_MAX 255
  43. // forward declarations
  44. struct SDMVNodeMenu;
  45. class RouterRefreshObject;
  46. // container for domain view's servers
  47. // and lists to facilitate lazy expansion of nodes
  48. class CServerList
  49. {
  50. public:
  51. CServerList() {};
  52. ~CServerList()
  53. {
  54. removeall();
  55. }
  56. //add a server to this container; adds to lazy containers
  57. HRESULT AddServer(const CString& servername);
  58. // removes a aserver from this container, removes from lazy also
  59. HRESULT RemoveServer(LPCTSTR pszServerName);
  60. //empty all containers
  61. HRESULT RemoveAllServerNodes();
  62. HRESULT RemoveAllServerHandlers();
  63. HRESULT removeall();
  64. private:
  65. list<MachineNodeData *> m_listServerNodesToExpand;
  66. list<MachineNodeData *> m_listServerHandlersToExpand;
  67. friend class DMVRootHandler;
  68. friend class DomainStatusHandler;
  69. };
  70. // Class: DMVRootHandler
  71. //
  72. // There should be a DMVRootHandler for every root node created.
  73. // DMVRootHandler's have a 1-to-1 relationship with their node!
  74. // Other parts of the code depend on this.
  75. // These are the valid values for the DMVRootHandler UserNotify()
  76. #define DMV_DELETE_SERVER_ENTRY (100)
  77. class DMVRootHandler
  78. : public RootHandler
  79. {
  80. public:
  81. DMVRootHandler(ITFSComponentData *pCompData);
  82. ~DMVRootHandler();
  83. // Override QI to handle embedded interface
  84. STDMETHOD(QueryInterface)(REFIID iid, LPVOID *ppv);
  85. OVERRIDE_NodeHandler_HasPropertyPages();
  86. OVERRIDE_NodeHandler_CreatePropertyPages();
  87. OVERRIDE_NodeHandler_GetString();
  88. STDMETHOD(GetClassID)(CLSID *pClassId);
  89. // Notification overrides
  90. OVERRIDE_BaseHandlerNotify_OnExpand();
  91. HRESULT LoadPersistedServerList();
  92. HRESULT LoadPersistedServerListFromNode();
  93. // this needs the full function of RouterRefreshObject, so use RouterRefreshObject directly
  94. HRESULT GetSummaryNodeRefreshObject(RouterRefreshObject** ppRefresh);
  95. HRESULT GetServerNodesRefreshObject(IRouterRefresh** ppRefresh);
  96. static HRESULT UpdateAllMachineIcons(ITFSNode* pRootNode);
  97. // Structure used to pass data to callbacks - used as a way of
  98. // avoiding recomputation
  99. struct SMenuData
  100. {
  101. SPITFSNode m_spNode;
  102. DMVRootHandler *m_pDMVRootHandler; // non-AddRef'd
  103. };
  104. // Handler overrides
  105. OVERRIDE_NodeHandler_OnCreateDataObject();
  106. OVERRIDE_NodeHandler_DestroyHandler();
  107. OVERRIDE_NodeHandler_OnAddMenuItems();
  108. OVERRIDE_NodeHandler_OnCommand();
  109. OVERRIDE_NodeHandler_UserNotify();
  110. // result handler overrides -- result pane message
  111. OVERRIDE_BaseResultHandlerNotify_OnResultSelect();
  112. OVERRIDE_ResultHandler_AddMenuItems();
  113. OVERRIDE_ResultHandler_Command();
  114. OVERRIDE_ResultHandler_OnGetResultViewType();
  115. // Help support
  116. OVERRIDE_BaseResultHandlerNotify_OnResultContextHelp();
  117. HRESULT Init(ITFSNode* pNode);
  118. // virtual function to access config stream
  119. ConfigStream * GetConfigStream()
  120. { return &m_ConfigStream; }
  121. static ULONG GetAutoRefreshFlags(const SRouterNodeMenu *pMenuData,
  122. INT_PTR pUserData);
  123. // result message view helper
  124. void UpdateResultMessage(ITFSNode * pNode);
  125. protected:
  126. bool m_bExpanded;
  127. CServerList m_serverlist;
  128. SPIRtrMgrInfo m_spRm;
  129. LONG_PTR m_ulConnId; // connection id for RtrMgr
  130. BOOL m_fAddedProtocolNode;
  131. CString m_strDomainName;
  132. DMVConfigStream m_ConfigStream;
  133. HRESULT QryAddServer(ITFSNode *pNode);
  134. HRESULT AddServersToList(const CStringArray& sa, ITFSNode *pNode);
  135. HRESULT ExecServerQry(ITFSNode* pNode);
  136. DomainStatusHandler* m_pStatusHandler;
  137. SPITFSNode m_spStatusNode;
  138. SPIRouterRefresh m_spServerNodesRefreshObject;
  139. SPRouterRefreshObject m_spSummaryModeRefreshObject;
  140. RouterRefreshObjectGroup m_RefreshGroup;
  141. };
  142. #endif _DMVROOT_H