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.

416 lines
10 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1999 **/
  4. /**********************************************************************/
  5. /*
  6. srvlatpp.h
  7. Brings up the property page for the server node
  8. FILE HISTORY:
  9. */
  10. #if !defined(AFX_SRVLATPP_H__35B59246_47F9_11D1_B9A6_00C04FBF914A__INCLUDED_)
  11. #define AFX_SRVLATPP_H__35B59246_47F9_11D1_B9A6_00C04FBF914A__INCLUDED_
  12. #if _MSC_VER >= 1000
  13. #pragma once
  14. #endif // _MSC_VER >= 1000
  15. #ifndef _CONFIG_H
  16. #include "config.h"
  17. #endif
  18. #define BURST_QUE_SIZE_LOW 300
  19. #define BURST_QUE_SIZE_MEDIUM 500
  20. #define BURST_QUE_SIZE_HIGH 1000
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CServerPropGeneral dialog
  23. class CServerPropGeneral : public CPropertyPageBase
  24. {
  25. DECLARE_DYNCREATE(CServerPropGeneral)
  26. // Construction
  27. public:
  28. CServerPropGeneral();
  29. ~CServerPropGeneral();
  30. // Dialog Data
  31. //{{AFX_DATA(CServerPropGeneral)
  32. enum { IDD = IDD_SERVER_PROP_GEN };
  33. CStatic m_staticrefresh;
  34. CStatic m_staticDesc;
  35. CEdit m_editRefreshMn;
  36. CEdit m_editRefreshHr;
  37. CEdit m_editRefreshSc;
  38. CSpinButtonCtrl m_spinRefreshSc;
  39. CSpinButtonCtrl m_spinRefreshmn;
  40. CSpinButtonCtrl m_spinRefreshHr;
  41. CEdit m_editBackupPath;
  42. CButton m_check_BackupOnTermination;
  43. CButton m_check_EnableAutoRefresh;
  44. CButton m_button_Browse;
  45. BOOL m_fBackupDB;
  46. BOOL m_fEnableAutoRefresh;
  47. CString m_strBackupPath;
  48. int m_nRefreshHours;
  49. int m_nRefreshMinutes;
  50. int m_nRefreshSeconds;
  51. //}}AFX_DATA
  52. UINT m_uImage;
  53. // Overrides
  54. // ClassWizard generate virtual function overrides
  55. //{{AFX_VIRTUAL(CServerPropGeneral)
  56. public:
  57. virtual BOOL OnApply();
  58. virtual void OnOK();
  59. protected:
  60. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  61. //}}AFX_VIRTUAL
  62. // Implementation
  63. protected:
  64. // Generated message map functions
  65. //{{AFX_MSG(CServerPropGeneral)
  66. virtual BOOL OnInitDialog();
  67. afx_msg void OnButtonBrowse();
  68. afx_msg void OnCheckEnableAutorefresh();
  69. afx_msg void OnChangeEditBackuppath();
  70. afx_msg void OnChangeRefresh();
  71. afx_msg void OnChangeCheckBackupdb();
  72. //}}AFX_MSG
  73. DECLARE_MESSAGE_MAP()
  74. private:
  75. CConfiguration * m_pConfig;
  76. BOOL m_fUpdateRefresh;
  77. BOOL m_fUpdateConfig;
  78. HRESULT GetConfig();
  79. HRESULT UpdateServerConfiguration();
  80. BOOL UpdateConfig();
  81. void SetRefreshData();
  82. int CalculateRefrInt();
  83. CString ToString(int nNumber);
  84. BOOL IsLocalConnection();
  85. public:
  86. virtual DWORD * GetHelpMap() { return WinsGetHelpMap(CServerPropGeneral::IDD);};
  87. };
  88. /////////////////////////////////////////////////////////////////////////////
  89. // CServerPropDBRecord dialog
  90. class CServerPropDBRecord : public CPropertyPageBase
  91. {
  92. DECLARE_DYNCREATE(CServerPropDBRecord)
  93. // Construction
  94. public:
  95. CServerPropDBRecord();
  96. ~CServerPropDBRecord();
  97. // Dialog Data
  98. //{{AFX_DATA(CServerPropDBRecord)
  99. enum { IDD = IDD_SERVER_PROP_DBRECORD };
  100. CEdit m_editExtIntMinute;
  101. CSpinButtonCtrl m_spinVerifyMinute;
  102. CSpinButtonCtrl m_spinVerifyHour;
  103. CSpinButtonCtrl m_spinVerifyDay;
  104. CSpinButtonCtrl m_spinRefrIntMinute;
  105. CSpinButtonCtrl m_spinRefrIntHour;
  106. CSpinButtonCtrl m_spinRefrIntDay;
  107. CSpinButtonCtrl m_spinExtTmMinute;
  108. CSpinButtonCtrl m_spinExtTmHour;
  109. CSpinButtonCtrl m_spinExtTmDay;
  110. CSpinButtonCtrl m_spinExtIntMinute;
  111. CSpinButtonCtrl m_spinExtIntHour;
  112. CSpinButtonCtrl m_spinExtIntDay;
  113. CEdit m_editVerifyMinute;
  114. CEdit m_editVerifyHour;
  115. CEdit m_editVerifyDay;
  116. CEdit m_editRefrIntMinute;
  117. CEdit m_editRefrIntHour;
  118. CEdit m_editRefrIntDay;
  119. CEdit m_editExtTmHour;
  120. CEdit m_editExtTmMinute;
  121. CEdit m_editExtTmDay;
  122. CEdit m_editExtIntHour;
  123. CEdit m_editExtIntDay;
  124. int m_nExtintDay;
  125. int m_nExtIntHour;
  126. int m_nExtIntMinute;
  127. int m_nExtTmDay;
  128. int m_nExtTmHour;
  129. int m_nExtTmMinute;
  130. int m_nRenewDay;
  131. int m_nrenewMinute;
  132. int m_nRenewMinute;
  133. int m_nVerifyDay;
  134. int m_nVerifyHour;
  135. int m_nVerifyMinute;
  136. //}}AFX_DATA
  137. // Overrides
  138. // ClassWizard generate virtual function overrides
  139. //{{AFX_VIRTUAL(CServerPropDBRecord)
  140. public:
  141. virtual BOOL OnApply();
  142. virtual void OnOK();
  143. protected:
  144. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  145. //}}AFX_VIRTUAL
  146. // Implementation
  147. protected:
  148. // Generated message map functions
  149. //{{AFX_MSG(CServerPropDBRecord)
  150. virtual BOOL OnInitDialog();
  151. afx_msg void OnButtonSetDefault();
  152. afx_msg void OnChangeEditExtinctIntHour();
  153. //}}AFX_MSG
  154. DECLARE_MESSAGE_MAP()
  155. private :
  156. CConfiguration * m_pConfig;
  157. HRESULT GetConfig();
  158. void SetVerifyData();
  159. void SetExtTimeData();
  160. void SetExtIntData();
  161. DWORD CalculateRenewInt();
  162. DWORD CalculateExtTm();
  163. DWORD CalculateExtInt();
  164. DWORD CalculateVerifyInt();
  165. void SetDefaultRenewInt();
  166. void SetDefaultExtInt();
  167. void SetDefaultExtTm();
  168. void SetDefaultVerifyInt();
  169. void CalcDaysHoursMinutes(int nValue, int & nDays, int & nHours, int & nMinutes);
  170. HRESULT UpdateServerConfiguration();
  171. BOOL CheckValues();
  172. public:
  173. virtual DWORD * GetHelpMap() { return WinsGetHelpMap(CServerPropDBRecord::IDD);};
  174. };
  175. /////////////////////////////////////////////////////////////////////////////
  176. // CServerPropDBVerification dialog
  177. class CServerPropDBVerification : public CPropertyPageBase
  178. {
  179. DECLARE_DYNCREATE(CServerPropDBVerification)
  180. // Construction
  181. public:
  182. CServerPropDBVerification();
  183. ~CServerPropDBVerification();
  184. // Dialog Data
  185. //{{AFX_DATA(CServerPropDBVerification)
  186. enum { IDD = IDD_SERVER_PROP_DBVERIFICATION };
  187. CEdit m_editCCSecond;
  188. CEdit m_editCCMinute;
  189. CEdit m_editCCHour;
  190. CSpinButtonCtrl m_spinCCMinute;
  191. CEdit m_editCCInterval;
  192. CEdit m_editCCMaxChecked;
  193. CButton m_radioCheckOwner;
  194. CButton m_checkEnableCC;
  195. CSpinButtonCtrl m_spinCCSecond;
  196. CSpinButtonCtrl m_spinCCHour;
  197. BOOL m_fCCPeriodic;
  198. int m_nCCCheckRandom;
  199. int m_nCCHour;
  200. int m_nCCMinute;
  201. int m_nCCSecond;
  202. UINT m_nCCMaxChecked;
  203. UINT m_nCCTimeInterval;
  204. //}}AFX_DATA
  205. // Overrides
  206. // ClassWizard generate virtual function overrides
  207. //{{AFX_VIRTUAL(CServerPropDBVerification)
  208. public:
  209. virtual BOOL OnApply();
  210. virtual void OnOK();
  211. protected:
  212. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  213. //}}AFX_VIRTUAL
  214. // Implementation
  215. protected:
  216. // Generated message map functions
  217. //{{AFX_MSG(CServerPropDBVerification)
  218. virtual BOOL OnInitDialog();
  219. afx_msg void OnCheckPeriodicCc();
  220. afx_msg void OnChangeEditCcInterval();
  221. afx_msg void OnChangeEditCcMaxChecked();
  222. afx_msg void OnChangeEditCcStartHour();
  223. afx_msg void OnChangeEditCcStartMinute();
  224. afx_msg void OnChangeEditCcStartSecond();
  225. afx_msg void OnRadioCheckOwner();
  226. afx_msg void OnRadioCheckRandom();
  227. //}}AFX_MSG
  228. DECLARE_MESSAGE_MAP()
  229. private :
  230. CConfiguration * m_pConfig;
  231. HRESULT GetConfig();
  232. HRESULT UpdateServerConfiguration();
  233. void SetCCInfo();
  234. void UpdateCCControls();
  235. public:
  236. virtual DWORD * GetHelpMap() { return WinsGetHelpMap(CServerPropDBVerification::IDD);};
  237. };
  238. /////////////////////////////////////////////////////////////////////////////
  239. // CServerPropAdvanced dialog
  240. class CServerPropAdvanced : public CPropertyPageBase
  241. {
  242. DECLARE_DYNCREATE(CServerPropAdvanced)
  243. // Construction
  244. public:
  245. CServerPropAdvanced();
  246. ~CServerPropAdvanced();
  247. // Dialog Data
  248. //{{AFX_DATA(CServerPropAdvanced)
  249. enum { IDD = IDD_SERVER_PROP_ADVANCED };
  250. CButton m_buttonBrowse;
  251. CEdit m_editDbPath;
  252. CButton m_checkBurstHandling;
  253. CButton m_checkLanNames;
  254. CEdit m_editVersionCount;
  255. CButton m_checkLogDetailedEvents;
  256. BOOL m_fLogEvents;
  257. CString m_strStartVersion;
  258. BOOL m_fLanNames;
  259. BOOL m_fBurstHandling;
  260. int m_nQueSelection;
  261. CString m_strDbPath;
  262. //}}AFX_DATA
  263. // Overrides
  264. // ClassWizard generate virtual function overrides
  265. //{{AFX_VIRTUAL(CServerPropAdvanced)
  266. public:
  267. virtual void OnOK();
  268. virtual BOOL OnApply();
  269. protected:
  270. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  271. //}}AFX_VIRTUAL
  272. // Implementation
  273. protected:
  274. // Generated message map functions
  275. //{{AFX_MSG(CServerPropAdvanced)
  276. virtual BOOL OnInitDialog();
  277. afx_msg void OnCheckLannames();
  278. afx_msg void MarkDirty();
  279. afx_msg void OnCheckBurstHandling();
  280. afx_msg void OnRadioCustom();
  281. afx_msg void OnRadioHigh();
  282. afx_msg void OnRadioLow();
  283. afx_msg void OnRadioMedium();
  284. afx_msg void OnChangeEditCustomValue();
  285. afx_msg void OnButtonBrowseDatabase();
  286. afx_msg void OnChangeEditDatabasePath();
  287. //}}AFX_MSG
  288. DECLARE_MESSAGE_MAP()
  289. private:
  290. CConfiguration* m_pConfig;
  291. BOOL m_fRestart;
  292. // helper functions
  293. HRESULT GetConfig();
  294. CString GetVersionInfo(LONG lLowWord, LONG lHighWord);
  295. HRESULT UpdateServerConfiguration();
  296. void FillVersionInfo(LONG &lLowWord, LONG &lHighWord);
  297. void UpdateBurstHandling();
  298. void EnableQueSelection(BOOL bEnable);
  299. void EnableCustomEntry();
  300. void SetQueSize();
  301. DWORD GetQueSize();
  302. public:
  303. virtual DWORD * GetHelpMap() { return WinsGetHelpMap(CServerPropAdvanced::IDD);};
  304. };
  305. class CServerProperties : public CPropertyPageHolderBase
  306. {
  307. public:
  308. CServerProperties(ITFSNode * pNode,
  309. IComponentData * pComponentData,
  310. ITFSComponentData * pTFSCompData,
  311. LPCTSTR pszSheetName
  312. );
  313. virtual ~CServerProperties();
  314. ITFSComponentData * GetTFSCompData()
  315. {
  316. if (m_spTFSCompData)
  317. m_spTFSCompData->AddRef();
  318. return m_spTFSCompData;
  319. }
  320. void SetConfig(CConfiguration * pConfig)
  321. {
  322. m_Config = *pConfig;
  323. }
  324. CConfiguration * GetConfig()
  325. {
  326. return &m_Config;
  327. }
  328. public:
  329. CServerPropGeneral m_pageGeneral;
  330. CServerPropDBRecord m_pageDBRecord;
  331. CServerPropDBVerification m_pageDBVerification;
  332. CServerPropAdvanced m_pageAdvanced;
  333. CConfiguration m_Config;
  334. protected:
  335. SPITFSComponentData m_spTFSCompData;
  336. WINSINTF_RESULTS_T m_wrResults;
  337. handle_t m_hBinding;
  338. DWORD m_dwStatus;
  339. };
  340. //{{AFX_INSERT_LOCATION}}
  341. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  342. #endif // !defined(AFX_SRVLATPP_H__35B59246_47F9_11D1_B9A6_00C04FBF914A__INCLUDED_)