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.

214 lines
6.4 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1999 **/
  4. /**********************************************************************/
  5. /*
  6. Servpp.h
  7. Server properties header file
  8. FILE HISTORY:
  9. */
  10. #if !defined(AFX_SERVPP_H__037BF46A_6E87_11D1_93B6_00C04FC3357A__INCLUDED_)
  11. #define AFX_SERVPP_H__037BF46A_6E87_11D1_93B6_00C04FC3357A__INCLUDED_
  12. #ifndef _TAPIDB_H
  13. #include "tapidb.h"
  14. #endif
  15. #if _MSC_VER >= 1000
  16. #pragma once
  17. #endif // _MSC_VER >= 1000
  18. #define AUTO_REFRESH_HOURS_MAX 23
  19. #define AUTO_REFRESH_MINUTES_MAX 59
  20. #include "rrasutil.h"
  21. BOOL IsLocalSystemAccount(LPCTSTR pszAccount);
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CServerPropRefresh dialog
  24. class CServerPropRefresh : public CPropertyPageBase
  25. {
  26. DECLARE_DYNCREATE(CServerPropRefresh)
  27. // Construction
  28. public:
  29. CServerPropRefresh();
  30. ~CServerPropRefresh();
  31. // Dialog Data
  32. //{{AFX_DATA(CServerPropRefresh)
  33. enum { IDD = IDP_SERVER_REFRESH };
  34. CEdit m_editMinutes;
  35. CEdit m_editHours;
  36. CSpinButtonCtrl m_spinMinutes;
  37. CSpinButtonCtrl m_spinHours;
  38. CButton m_checkEnableStats;
  39. //}}AFX_DATA
  40. void UpdateButtons();
  41. void ValidateHours();
  42. void ValidateMinutes();
  43. virtual BOOL OnPropertyChange(BOOL bScope, LONG_PTR *ChangeMask);
  44. // Context Help Support
  45. virtual DWORD * GetHelpMap() { return (DWORD *) &g_aHelpIDs_SERVER_REFRESH[0]; }
  46. BOOL m_bAutoRefresh;
  47. DWORD m_dwRefreshInterval;
  48. // Overrides
  49. // ClassWizard generate virtual function overrides
  50. //{{AFX_VIRTUAL(CServerPropRefresh)
  51. public:
  52. virtual BOOL OnApply();
  53. protected:
  54. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  55. //}}AFX_VIRTUAL
  56. // Implementation
  57. protected:
  58. // Generated message map functions
  59. //{{AFX_MSG(CServerPropRefresh)
  60. virtual BOOL OnInitDialog();
  61. afx_msg void OnCheckEnableStats();
  62. afx_msg void OnKillfocusEditHours();
  63. afx_msg void OnKillfocusEditMinutes();
  64. afx_msg void OnChangeEditHours();
  65. afx_msg void OnChangeEditMinutes();
  66. //}}AFX_MSG
  67. DECLARE_MESSAGE_MAP()
  68. };
  69. /////////////////////////////////////////////////////////////////////////////
  70. // CServerPropSetup dialog
  71. class CServerPropSetup : public CPropertyPageBase
  72. {
  73. DECLARE_DYNCREATE(CServerPropSetup)
  74. // Construction
  75. public:
  76. CServerPropSetup();
  77. ~CServerPropSetup();
  78. // Dialog Data
  79. //{{AFX_DATA(CServerPropSetup)
  80. enum { IDD = IDP_SERVER_SETUP };
  81. CListBox m_listAdmins;
  82. //}}AFX_DATA
  83. void EnableButtons(BOOL fIsNtServer = TRUE);
  84. virtual BOOL OnPropertyChange(BOOL bScope, LONG_PTR *ChangeMask);
  85. // Context Help Support
  86. virtual DWORD * GetHelpMap() { return (DWORD *) &g_aHelpIDs_SERVER_SETUP[0]; }
  87. HRESULT UpdateSvcHostInfo(LPCTSTR pszMachine, BOOL fLocalSystemAccount);
  88. DWORD RestartService();
  89. void StartRefresh();
  90. // Overrides
  91. // ClassWizard generate virtual function overrides
  92. //{{AFX_VIRTUAL(CServerPropSetup)
  93. public:
  94. virtual BOOL OnApply();
  95. protected:
  96. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  97. //}}AFX_VIRTUAL
  98. // Implementation
  99. protected:
  100. // Generated message map functions
  101. //{{AFX_MSG(CServerPropSetup)
  102. afx_msg void OnButtonAdd();
  103. afx_msg void OnButtonChooseUser();
  104. afx_msg void OnButtonRemove();
  105. afx_msg void OnCheckEnableServer();
  106. afx_msg void OnChangeEditName();
  107. afx_msg void OnChangeEditPassword();
  108. virtual BOOL OnInitDialog();
  109. afx_msg void OnSelchangeListAdmins();
  110. //}}AFX_MSG
  111. DECLARE_MESSAGE_MAP()
  112. CTapiConfigInfo m_tapiConfigInfo;
  113. DWORD m_dwNewFlags;
  114. DWORD m_dwInitFlags;
  115. BOOL m_fRestartService;
  116. };
  117. //{{AFX_INSERT_LOCATION}}
  118. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  119. //}}AFX
  120. class CServerProperties : public CPropertyPageHolderBase
  121. {
  122. friend class CServerPropRefresh;
  123. public:
  124. CServerProperties(ITFSNode * pNode,
  125. IComponentData * pComponentData,
  126. ITFSComponentData * pTFSCompData,
  127. ITapiInfo * pTapiInfo,
  128. LPCTSTR pszSheetName,
  129. BOOL fTapiInfoLoaded);
  130. virtual ~CServerProperties();
  131. ITFSComponentData * GetTFSCompData()
  132. {
  133. if (m_spTFSCompData)
  134. m_spTFSCompData->AddRef();
  135. return m_spTFSCompData;
  136. }
  137. HRESULT GetTapiInfo(ITapiInfo ** ppTapiInfo)
  138. {
  139. Assert(ppTapiInfo);
  140. *ppTapiInfo = NULL;
  141. SetI((LPUNKNOWN *) ppTapiInfo, m_spTapiInfo);
  142. return hrOK;
  143. }
  144. BOOL FInit();
  145. BOOL FOpenScManager();
  146. VOID FCheckLSAAccount();
  147. BOOL FUpdateServiceInfo(LPCTSTR pszName, LPCTSTR pszPassword, DWORD dwStartType);
  148. BOOL FIsServiceRunning() { return (m_SS.dwCurrentState == SERVICE_RUNNING); }
  149. BOOL FHasServiceControl();
  150. BOOL FIsTapiInfoLoaded() { return m_fTapiInfoLoaded; }
  151. BOOL FIsAdmin() { return m_spTapiInfo->IsAdmin(); }
  152. LPCTSTR GetServiceAccountName() { return m_strLogOnAccountName; }
  153. LPCTSTR GetServiceDisplayName() { return m_strServiceDisplayName; }
  154. public:
  155. CServerPropSetup m_pageSetup;
  156. CServerPropRefresh m_pageRefresh;
  157. CString m_strMachineName;
  158. CONST TCHAR * m_pszServiceName;
  159. protected:
  160. SPITFSComponentData m_spTFSCompData;
  161. SPITapiInfo m_spTapiInfo;
  162. SC_HANDLE m_hScManager;
  163. UINT m_uFlags; // Flags about which fields are dirty
  164. SERVICE_STATUS m_SS; // Service Status structure
  165. QUERY_SERVICE_CONFIG * m_paQSC; // Pointer to allocated QSC structure
  166. CString m_strServiceDisplayName;
  167. CString m_strLogOnAccountName;
  168. BOOL m_fTapiInfoLoaded;
  169. };
  170. #endif // !defined(AFX_SERVPP_H__037BF46A_6E87_11D1_93B6_00C04FC3357A__INCLUDED_)