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.

310 lines
9.1 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ClusProp.cpp
  7. //
  8. // Abstract:
  9. // Definition of the cluster property sheet and pages.
  10. //
  11. // Author:
  12. // David Potter (davidp) May 13, 1996
  13. //
  14. // Revision History:
  15. //
  16. // Notes:
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19. #ifndef _CLUSPROP_H_
  20. #define _CLUSPROP_H_
  21. /////////////////////////////////////////////////////////////////////////////
  22. // Include Files
  23. /////////////////////////////////////////////////////////////////////////////
  24. #ifndef _BASEPAGE_H_
  25. #include "BasePPag.h" // for CBasePropertyPage
  26. #endif
  27. #ifndef _BASESHT_H_
  28. #include "BasePSht.h" // for CBasePropertySheet
  29. #endif
  30. #ifndef _NETWORK_H_
  31. #include "Network.h" // for CNetworkList
  32. #endif
  33. /////////////////////////////////////////////////////////////////////////////
  34. // Forward Class Declarations
  35. /////////////////////////////////////////////////////////////////////////////
  36. class CClusterGeneralPage;
  37. class CClusterQuorumPage;
  38. class CClusterNetPriorityPage;
  39. class CClusterPropSheet;
  40. /////////////////////////////////////////////////////////////////////////////
  41. // External Class Declarations
  42. /////////////////////////////////////////////////////////////////////////////
  43. class CCluster;
  44. class CResource;
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CClusterGeneralPage dialog
  47. /////////////////////////////////////////////////////////////////////////////
  48. class CClusterGeneralPage : public CBasePropertyPage
  49. {
  50. DECLARE_DYNCREATE(CClusterGeneralPage)
  51. // Construction
  52. public:
  53. CClusterGeneralPage(void);
  54. ~CClusterGeneralPage(void);
  55. virtual BOOL BInit(IN OUT CBaseSheet * psht);
  56. // Dialog Data
  57. //{{AFX_DATA(CClusterGeneralPage)
  58. enum { IDD = IDD_PP_CLUSTER_GENERAL };
  59. CEdit m_editName;
  60. CEdit m_editDesc;
  61. CString m_strName;
  62. CString m_strDesc;
  63. CString m_strVendorID;
  64. CString m_strVersion;
  65. //}}AFX_DATA
  66. // Overrides
  67. // ClassWizard generate virtual function overrides
  68. //{{AFX_VIRTUAL(CClusterGeneralPage)
  69. public:
  70. virtual BOOL OnSetActive();
  71. virtual BOOL OnKillActive();
  72. virtual BOOL OnApply();
  73. protected:
  74. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  75. //}}AFX_VIRTUAL
  76. // Implementation
  77. protected:
  78. // BOOL m_bSecurityChanged;
  79. CClusterPropSheet * PshtCluster(void) { return (CClusterPropSheet *) Psht(); }
  80. CCluster * PciCluster(void) { return (CCluster *) Pci(); }
  81. // BOOL BSecurityChanged(void) const { return m_bSecurityChanged; }
  82. // Generated message map functions
  83. //{{AFX_MSG(CClusterGeneralPage)
  84. virtual BOOL OnInitDialog();
  85. // afx_msg void OnBnClickedPermissions();
  86. //}}AFX_MSG
  87. DECLARE_MESSAGE_MAP()
  88. }; //*** class CClusterGeneralPage
  89. /////////////////////////////////////////////////////////////////////////////
  90. // CClusterQuorumPage dialog
  91. /////////////////////////////////////////////////////////////////////////////
  92. class CClusterQuorumPage : public CBasePropertyPage
  93. {
  94. DECLARE_DYNCREATE(CClusterQuorumPage)
  95. // Construction
  96. public:
  97. CClusterQuorumPage(void);
  98. ~CClusterQuorumPage(void);
  99. virtual BOOL BInit(IN OUT CBaseSheet * psht);
  100. // Dialog Data
  101. //{{AFX_DATA(CClusterQuorumPage)
  102. enum { IDD = IDD_PP_CLUSTER_QUORUM };
  103. CEdit m_editRootPath;
  104. CEdit m_editMaxLogSize;
  105. CComboBox m_cboxPartition;
  106. CComboBox m_cboxQuorumResource;
  107. CString m_strQuorumResource;
  108. CString m_strPartition;
  109. DWORD m_nMaxLogSize;
  110. CString m_strRootPath;
  111. //}}AFX_DATA
  112. // Overrides
  113. // ClassWizard generate virtual function overrides
  114. //{{AFX_VIRTUAL(CClusterQuorumPage)
  115. public:
  116. virtual BOOL OnApply();
  117. protected:
  118. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  119. //}}AFX_VIRTUAL
  120. // Implementation
  121. protected:
  122. struct SPartitionItemData
  123. {
  124. TCHAR szDeviceName[ _MAX_PATH ];
  125. TCHAR szPartitionName[ _MAX_PATH ];
  126. TCHAR szBaseRootPath[ _MAX_PATH ];
  127. };
  128. BOOL m_bControlsInitialized;
  129. PBYTE m_pbDiskInfo;
  130. DWORD m_cbDiskInfo;
  131. CString m_strCurrentPartition;
  132. CString m_strCurrentRootPath;
  133. SPartitionItemData * m_ppid;
  134. BOOL BControlsInitialized(void) const { return m_bControlsInitialized; }
  135. CClusterPropSheet * PshtCluster(void) const { return (CClusterPropSheet *) Psht(); }
  136. CCluster * PciCluster(void) const { return (CCluster *) Pci(); }
  137. void ClearResourceList(void);
  138. void ClearPartitionList(void);
  139. void FillResourceList(void);
  140. void FillPartitionList(IN OUT CResource * pciRes);
  141. BOOL BGetDiskInfo(IN OUT CResource & rpciRes);
  142. void
  143. SplitDeviceName(
  144. LPCTSTR pszDeviceNameIn,
  145. LPTSTR pszPartitionNameOut,
  146. LPTSTR pszRootPathOut
  147. );
  148. // Generated message map functions
  149. //{{AFX_MSG(CClusterQuorumPage)
  150. virtual BOOL OnInitDialog();
  151. afx_msg void OnDblClkQuorumResource();
  152. afx_msg void OnChangeQuorumResource();
  153. afx_msg void OnDestroy();
  154. //}}AFX_MSG
  155. DECLARE_MESSAGE_MAP()
  156. }; //*** class CClusterQuorumPage
  157. /////////////////////////////////////////////////////////////////////////////
  158. // CClusterNetPriorityPage dialog
  159. /////////////////////////////////////////////////////////////////////////////
  160. class CClusterNetPriorityPage : public CBasePropertyPage
  161. {
  162. DECLARE_DYNCREATE(CClusterNetPriorityPage)
  163. // Construction
  164. public:
  165. CClusterNetPriorityPage(void);
  166. // Dialog Data
  167. //{{AFX_DATA(CClusterNetPriorityPage)
  168. enum { IDD = IDD_PP_CLUSTER_NET_PRIORITY };
  169. CButton m_pbProperties;
  170. CButton m_pbDown;
  171. CButton m_pbUp;
  172. CListBox m_lbList;
  173. //}}AFX_DATA
  174. // Overrides
  175. // ClassWizard generate virtual function overrides
  176. //{{AFX_VIRTUAL(CClusterNetPriorityPage)
  177. public:
  178. virtual BOOL OnApply();
  179. protected:
  180. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  181. //}}AFX_VIRTUAL
  182. // Implementation
  183. protected:
  184. BOOL m_bControlsInitialized;
  185. CNetworkList m_lpciNetworkPriority;
  186. BOOL BControlsInitialized(void) const { return m_bControlsInitialized; }
  187. CClusterPropSheet * PshtCluster(void) const { return (CClusterPropSheet *) Psht(); }
  188. CCluster * PciCluster(void) const { return (CCluster *) Pci(); }
  189. CNetworkList & LpciNetworkPriority(void) { return m_lpciNetworkPriority; }
  190. void FillList(void);
  191. void ClearNetworkList(void);
  192. void DisplayProperties(void);
  193. // Generated message map functions
  194. //{{AFX_MSG(CClusterNetPriorityPage)
  195. afx_msg void OnSelChangeList();
  196. virtual BOOL OnInitDialog();
  197. afx_msg void OnUp();
  198. afx_msg void OnDown();
  199. afx_msg void OnProperties();
  200. afx_msg void OnDestroy();
  201. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  202. afx_msg void OnDblClkList();
  203. //}}AFX_MSG
  204. DECLARE_MESSAGE_MAP()
  205. }; //*** class CClusterNetPriorityPage
  206. /////////////////////////////////////////////////////////////////////////////
  207. // CClusterPropSheet
  208. /////////////////////////////////////////////////////////////////////////////
  209. class CClusterPropSheet : public CBasePropertySheet
  210. {
  211. DECLARE_DYNAMIC(CClusterPropSheet)
  212. // Construction
  213. public:
  214. CClusterPropSheet(
  215. IN OUT CWnd * pParentWnd = NULL,
  216. IN UINT iSelectPage = 0
  217. );
  218. virtual BOOL BInit(
  219. IN OUT CClusterItem * pciCluster,
  220. IN IIMG iimgIcon
  221. );
  222. // Attributes
  223. protected:
  224. CBasePropertyPage * m_rgpages[3];
  225. // Pages
  226. CClusterGeneralPage m_pageGeneral;
  227. CClusterQuorumPage m_pageQuorum;
  228. CClusterNetPriorityPage m_pageNetPriority;
  229. CClusterGeneralPage & PageGeneral(void) { return m_pageGeneral; }
  230. CClusterQuorumPage & PageQuorum(void) { return m_pageQuorum; }
  231. CClusterNetPriorityPage & PageNetPriority(void) { return m_pageNetPriority; }
  232. public:
  233. CCluster * PciCluster(void) { return (CCluster *) Pci(); }
  234. // Operations
  235. // Overrides
  236. protected:
  237. virtual CBasePropertyPage** Ppages(void);
  238. virtual int Cpages(void);
  239. // ClassWizard generated virtual function overrides
  240. //{{AFX_VIRTUAL(CClusterPropSheet)
  241. //}}AFX_VIRTUAL
  242. // Implementation
  243. public:
  244. // Generated message map functions
  245. protected:
  246. //{{AFX_MSG(CClusterPropSheet)
  247. // NOTE - the ClassWizard will add and remove member functions here.
  248. //}}AFX_MSG
  249. DECLARE_MESSAGE_MAP()
  250. }; //*** class CClusterPropSheet
  251. /////////////////////////////////////////////////////////////////////////////
  252. #endif // _CLUSPROP_H_