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.

326 lines
9.9 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. //
  123. // This struct will be stored as the data item in the resource drop down.
  124. // We use the pciRes to get info about the resource and nIndex is the
  125. // index of the last selected partition for that resource so that we can
  126. // remember what the user wanted (rather than default to the first entry
  127. // every time we select a new resource).
  128. //
  129. struct SResourceItemData
  130. {
  131. CResource * pciRes;
  132. int nIndex;
  133. };
  134. BOOL m_bControlsInitialized;
  135. PBYTE m_pbDiskInfo;
  136. DWORD m_cbDiskInfo;
  137. //
  138. // Last saved values to compare against to determine whether to apply chagnes or not.
  139. //
  140. CString m_strSavedResource;
  141. CString m_strSavedPartition;
  142. CString m_strSavedRootPath;
  143. DWORD m_nSavedLogSize;
  144. BOOL BControlsInitialized(void) const { return m_bControlsInitialized; }
  145. CClusterPropSheet * PshtCluster(void) const { return (CClusterPropSheet *) Psht(); }
  146. CCluster * PciCluster(void) const { return (CCluster *) Pci(); }
  147. void ClearResourceList(void);
  148. void ClearPartitionList(void);
  149. void FillResourceList(void);
  150. void FillPartitionList(IN OUT CResource * pciRes);
  151. BOOL BGetDiskInfo(IN OUT CResource & rpciRes);
  152. void
  153. SplitRootPath(
  154. CResource * pciRes,
  155. LPTSTR pszPartitionNameOut,
  156. DWORD cchPartition,
  157. LPTSTR pszRootPathOut,
  158. DWORD cchRootPath
  159. );
  160. // Generated message map functions
  161. //{{AFX_MSG(CClusterQuorumPage)
  162. virtual BOOL OnInitDialog();
  163. afx_msg void OnDblClkQuorumResource();
  164. afx_msg void OnChangeQuorumResource();
  165. afx_msg void OnChangePartition();
  166. afx_msg void OnDestroy();
  167. //}}AFX_MSG
  168. DECLARE_MESSAGE_MAP()
  169. }; //*** class CClusterQuorumPage
  170. /////////////////////////////////////////////////////////////////////////////
  171. // CClusterNetPriorityPage dialog
  172. /////////////////////////////////////////////////////////////////////////////
  173. class CClusterNetPriorityPage : public CBasePropertyPage
  174. {
  175. DECLARE_DYNCREATE(CClusterNetPriorityPage)
  176. // Construction
  177. public:
  178. CClusterNetPriorityPage(void);
  179. // Dialog Data
  180. //{{AFX_DATA(CClusterNetPriorityPage)
  181. enum { IDD = IDD_PP_CLUSTER_NET_PRIORITY };
  182. CButton m_pbProperties;
  183. CButton m_pbDown;
  184. CButton m_pbUp;
  185. CListBox m_lbList;
  186. //}}AFX_DATA
  187. // Overrides
  188. // ClassWizard generate virtual function overrides
  189. //{{AFX_VIRTUAL(CClusterNetPriorityPage)
  190. public:
  191. virtual BOOL OnApply();
  192. protected:
  193. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  194. //}}AFX_VIRTUAL
  195. // Implementation
  196. protected:
  197. BOOL m_bControlsInitialized;
  198. CNetworkList m_lpciNetworkPriority;
  199. BOOL BControlsInitialized(void) const { return m_bControlsInitialized; }
  200. CClusterPropSheet * PshtCluster(void) const { return (CClusterPropSheet *) Psht(); }
  201. CCluster * PciCluster(void) const { return (CCluster *) Pci(); }
  202. CNetworkList & LpciNetworkPriority(void) { return m_lpciNetworkPriority; }
  203. void FillList(void);
  204. void ClearNetworkList(void);
  205. void DisplayProperties(void);
  206. // Generated message map functions
  207. //{{AFX_MSG(CClusterNetPriorityPage)
  208. afx_msg void OnSelChangeList();
  209. virtual BOOL OnInitDialog();
  210. afx_msg void OnUp();
  211. afx_msg void OnDown();
  212. afx_msg void OnProperties();
  213. afx_msg void OnDestroy();
  214. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  215. afx_msg void OnDblClkList();
  216. //}}AFX_MSG
  217. DECLARE_MESSAGE_MAP()
  218. }; //*** class CClusterNetPriorityPage
  219. /////////////////////////////////////////////////////////////////////////////
  220. // CClusterPropSheet
  221. /////////////////////////////////////////////////////////////////////////////
  222. class CClusterPropSheet : public CBasePropertySheet
  223. {
  224. DECLARE_DYNAMIC(CClusterPropSheet)
  225. // Construction
  226. public:
  227. CClusterPropSheet(
  228. IN OUT CWnd * pParentWnd = NULL,
  229. IN UINT iSelectPage = 0
  230. );
  231. virtual BOOL BInit(
  232. IN OUT CClusterItem * pciCluster,
  233. IN IIMG iimgIcon
  234. );
  235. // Attributes
  236. protected:
  237. CBasePropertyPage * m_rgpages[3];
  238. // Pages
  239. CClusterGeneralPage m_pageGeneral;
  240. CClusterQuorumPage m_pageQuorum;
  241. CClusterNetPriorityPage m_pageNetPriority;
  242. CClusterGeneralPage & PageGeneral(void) { return m_pageGeneral; }
  243. CClusterQuorumPage & PageQuorum(void) { return m_pageQuorum; }
  244. CClusterNetPriorityPage & PageNetPriority(void) { return m_pageNetPriority; }
  245. public:
  246. CCluster * PciCluster(void) { return (CCluster *) Pci(); }
  247. // Operations
  248. // Overrides
  249. protected:
  250. virtual CBasePropertyPage** Ppages(void);
  251. virtual int Cpages(void);
  252. // ClassWizard generated virtual function overrides
  253. //{{AFX_VIRTUAL(CClusterPropSheet)
  254. //}}AFX_VIRTUAL
  255. // Implementation
  256. public:
  257. // Generated message map functions
  258. protected:
  259. //{{AFX_MSG(CClusterPropSheet)
  260. // NOTE - the ClassWizard will add and remove member functions here.
  261. //}}AFX_MSG
  262. DECLARE_MESSAGE_MAP()
  263. }; //*** class CClusterPropSheet
  264. /////////////////////////////////////////////////////////////////////////////
  265. #endif // _CLUSPROP_H_