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.

432 lines
10 KiB

  1. /*++
  2. Copyright (c) 1994-2000 Microsoft Corporation
  3. Module Name :
  4. app_pool_sheet.h
  5. Abstract:
  6. Application Pool Property Sheet
  7. Author:
  8. Sergei Antonov (sergeia)
  9. Project:
  10. Internet Services Manager
  11. Revision History:
  12. --*/
  13. #ifndef _APP_POOL_SHEET_H
  14. #define _APP_POOL_SHEET_H
  15. class CAppPoolProps : public CMetaProperties
  16. {
  17. public:
  18. CAppPoolProps(CComAuthInfo * pAuthInfo, LPCTSTR meta_path, BOOL fInherit = TRUE);
  19. CAppPoolProps(CMetaInterface * pInterface, LPCTSTR meta_path, BOOL fInherit = TRUE);
  20. CAppPoolProps(CMetaKey * pInterface, LPCTSTR meta_path, BOOL fInherit = TRUE);
  21. virtual HRESULT WriteDirtyProps();
  22. void InitFromModel(CAppPoolProps& model);
  23. HRESULT ChangeState(DWORD dwCommand);
  24. protected:
  25. virtual void ParseFields();
  26. public:
  27. MP_CString m_strTemplateName;
  28. MP_DWORD m_dwPeriodicRestartTime;
  29. MP_DWORD m_dwRestartRequestCount;
  30. MP_DWORD m_dwPeriodicRestartVMemory;
  31. MP_DWORD m_dwPeriodicRestartUMemory;
  32. MP_CStringListEx m_RestartSchedule;
  33. MP_DWORD m_dwIdleTimeout;
  34. MP_DWORD m_dwQueueSize;
  35. MP_DWORD m_dwMaxCPU_Use;
  36. MP_DWORD m_dwRefreshTime;
  37. MP_DWORD m_ActionIndex;
  38. MP_DWORD m_dwMaxProcesses;
  39. MP_BOOL m_fDoEnablePing;
  40. MP_DWORD m_dwPingInterval;
  41. MP_BOOL m_fDoEnableRapidFail;
  42. MP_DWORD m_dwCrashesCount;
  43. MP_DWORD m_dwCheckInterval;
  44. MP_DWORD m_dwStartupLimit;
  45. MP_DWORD m_dwShutdownLimit;
  46. MP_BOOL m_fDoEnableDebug;
  47. MP_CString m_DebuggerFileName;
  48. MP_CString m_DebuggerParams;
  49. MP_DWORD m_dwIdentType;
  50. MP_CString m_strUserName;
  51. MP_CStrPassword m_strUserPass;
  52. MP_DWORD m_dwState;
  53. MP_DWORD m_dwWin32Error;
  54. };
  55. class CAppPoolSheet : public CInetPropertySheet
  56. {
  57. DECLARE_DYNAMIC(CAppPoolSheet)
  58. public:
  59. CAppPoolSheet(
  60. CComAuthInfo * pAuthInfo,
  61. LPCTSTR lpszMetaPath,
  62. CWnd * pParentWnd = NULL,
  63. LPARAM lParam = 0L,
  64. LPARAM lParamParent = 0L,
  65. UINT iSelectPage = 0
  66. );
  67. virtual ~CAppPoolSheet();
  68. public:
  69. // The following methods have predefined names to be compatible with
  70. // BEGIN_META_INST_READ and other macros.
  71. HRESULT QueryInstanceResult() const;
  72. CAppPoolProps & GetInstanceProperties() { return *m_pprops; }
  73. virtual HRESULT LoadConfigurationParameters();
  74. virtual void FreeConfigurationParameters();
  75. //{{AFX_MSG(CAppPoolSheet)
  76. //}}AFX_MSG
  77. DECLARE_MESSAGE_MAP()
  78. private:
  79. BOOL m_fUseTemplate;
  80. CAppPoolProps * m_pprops;
  81. };
  82. class CAppPoolRecycle : public CInetPropertyPage
  83. {
  84. DECLARE_DYNCREATE(CAppPoolRecycle)
  85. public:
  86. CAppPoolRecycle(CInetPropertySheet * pSheet = NULL);
  87. virtual ~CAppPoolRecycle();
  88. //
  89. // Dialog Data
  90. //
  91. protected:
  92. //{{AFX_DATA(CAppPoolRecycle)
  93. enum { IDD = IDD_APP_POOL_RECYCLE };
  94. BOOL m_fDoRestartOnTime;
  95. CButton m_bnt_DoRestartOnTime;
  96. DWORD m_dwPeriodicRestartTime;
  97. CEdit m_Timespan;
  98. CSpinButtonCtrl m_TimespanSpin;
  99. BOOL m_fDoRestartOnCount;
  100. CButton m_btn_DoRestartOnCount;
  101. DWORD m_dwRestartRequestCount;
  102. CEdit m_Requests;
  103. CSpinButtonCtrl m_RequestsSpin;
  104. BOOL m_fDoRestartOnSchedule;
  105. CButton m_btn_DoRestartOnSchedule;
  106. CListBox m_lst_Schedule;
  107. CButton m_btn_Add;
  108. CButton m_btn_Remove;
  109. CButton m_btn_Edit;
  110. BOOL m_fDoRestartOnVMemory;
  111. CButton m_btn_DoRestartOnVMemory;
  112. DWORD m_dwPeriodicRestartVMemoryDisplay;
  113. CEdit m_VMemoryLimit;
  114. CSpinButtonCtrl m_VMemoryLimitSpin;
  115. BOOL m_fDoRestartOnUMemory;
  116. CButton m_btn_DoRestartOnUMemory;
  117. DWORD m_dwPeriodicRestartUMemoryDisplay;
  118. CEdit m_UMemoryLimit;
  119. CSpinButtonCtrl m_UMemoryLimitSpin;
  120. //}}AFX_DATA
  121. CStringListEx m_RestartSchedule;
  122. DWORD m_dwPeriodicRestartVMemory;
  123. DWORD m_dwPeriodicRestartUMemory;
  124. //{{AFX_MSG(CAppPoolRecycle)
  125. virtual BOOL OnInitDialog();
  126. afx_msg int OnCompareItem(UINT nID, LPCOMPAREITEMSTRUCT cmpi);
  127. afx_msg void OnMeasureItem(UINT nID, LPMEASUREITEMSTRUCT mi);
  128. afx_msg void OnDrawItem(UINT nID, LPDRAWITEMSTRUCT di);
  129. afx_msg void OnDoRestartOnTime();
  130. afx_msg void OnDoRestartOnCount();
  131. afx_msg void OnDoRestartOnSchedule();
  132. afx_msg void OnDoRestartOnVMemory();
  133. afx_msg void OnDoRestartOnUMemory();
  134. afx_msg void OnAddTime();
  135. afx_msg void OnDeleteTime();
  136. afx_msg void OnChangeTime();
  137. afx_msg void OnItemChanged();
  138. //}}AFX_MSG
  139. DECLARE_MESSAGE_MAP()
  140. //
  141. // Overrides
  142. //
  143. protected:
  144. //{{AFX_VIRTUAL(CAppPoolRecycle)
  145. virtual void DoDataExchange(CDataExchange * pDX);
  146. //}}AFX_VIRTUAL
  147. virtual HRESULT FetchLoadedValues();
  148. virtual HRESULT SaveInfo();
  149. void SetControlsState();
  150. };
  151. class CAppPoolPerf : public CInetPropertyPage
  152. {
  153. DECLARE_DYNCREATE(CAppPoolPerf)
  154. public:
  155. CAppPoolPerf(CInetPropertySheet * pSheet = NULL);
  156. virtual ~CAppPoolPerf();
  157. //
  158. // Dialog Data
  159. //
  160. protected:
  161. //{{AFX_DATA(CAppPoolPerf)
  162. enum { IDD = IDD_APP_POOL_PERF };
  163. BOOL m_fDoIdleShutdown;
  164. CButton m_bnt_DoIdleShutdown;
  165. DWORD m_dwIdleTimeout;
  166. CEdit m_IdleTimeout;
  167. CSpinButtonCtrl m_IdleTimeoutSpin;
  168. BOOL m_fDoLimitQueue;
  169. CButton m_btn_DoLimitQueue;
  170. DWORD m_dwQueueSize;
  171. CEdit m_QueueSize;
  172. CSpinButtonCtrl m_QueueSizeSpin;
  173. BOOL m_fDoEnableCPUAccount;
  174. CButton m_btn_DoEnableCPUAccount;
  175. DWORD m_dwMaxCPU_UseVisual;
  176. CEdit m_MaxCPU_Use;
  177. CSpinButtonCtrl m_MaxCPU_UseSpin;
  178. DWORD m_dwRefreshTime;
  179. CEdit m_RefreshTime;
  180. CSpinButtonCtrl m_RefreshTimeSpin;
  181. int m_ActionIndex;
  182. CComboBox m_Action;
  183. DWORD m_dwMaxProcesses;
  184. CEdit m_MaxProcesses;
  185. CSpinButtonCtrl m_MaxProcessesSpin;
  186. //}}AFX_DATA
  187. //{{AFX_MSG(CAppPoolPerf)
  188. virtual BOOL OnInitDialog();
  189. afx_msg void OnDoIdleShutdown();
  190. afx_msg void OnDoLimitQueue();
  191. afx_msg void OnDoEnableCPUAccount();
  192. afx_msg void OnItemChanged();
  193. //}}AFX_MSG
  194. DECLARE_MESSAGE_MAP()
  195. DWORD m_dwMaxCPU_Use;
  196. //
  197. // Overrides
  198. //
  199. protected:
  200. //{{AFX_VIRTUAL(CAppPoolPerf)
  201. virtual void DoDataExchange(CDataExchange * pDX);
  202. //}}AFX_VIRTUAL
  203. virtual HRESULT FetchLoadedValues();
  204. virtual HRESULT SaveInfo();
  205. void SetControlsState();
  206. };
  207. class CAppPoolHealth : public CInetPropertyPage
  208. {
  209. DECLARE_DYNCREATE(CAppPoolHealth)
  210. public:
  211. CAppPoolHealth(CInetPropertySheet * pSheet = NULL);
  212. virtual ~CAppPoolHealth();
  213. //
  214. // Dialog Data
  215. //
  216. protected:
  217. //{{AFX_DATA(CAppPoolHealth)
  218. enum { IDD = IDD_APP_POOL_HEALTH };
  219. BOOL m_fDoEnablePing;
  220. CButton m_bnt_DoEnablePing;
  221. DWORD m_dwPingInterval;
  222. CEdit m_PingInterval;
  223. CSpinButtonCtrl m_PingIntervalSpin;
  224. BOOL m_fDoEnableRapidFail;
  225. CButton m_btn_DoEnableRapidFail;
  226. DWORD m_dwCrashesCount;
  227. CEdit m_CrashesCount;
  228. CSpinButtonCtrl m_CrashesCountSpin;
  229. DWORD m_dwCheckInterval;
  230. CEdit m_CheckInterval;
  231. CSpinButtonCtrl m_CheckIntervalSpin;
  232. DWORD m_dwStartupLimit;
  233. CEdit m_StartupLimit;
  234. CSpinButtonCtrl m_StartupLimitSpin;
  235. DWORD m_dwShutdownLimit;
  236. CEdit m_ShutdownLimit;
  237. CSpinButtonCtrl m_ShutdownLimitSpin;
  238. //}}AFX_DATA
  239. //{{AFX_MSG(CAppPoolPerf)
  240. virtual BOOL OnInitDialog();
  241. afx_msg void OnDoEnablePinging();
  242. afx_msg void OnDoEnableRapidFail();
  243. afx_msg void OnItemChanged();
  244. //}}AFX_MSG
  245. DECLARE_MESSAGE_MAP()
  246. //
  247. // Overrides
  248. //
  249. protected:
  250. //{{AFX_VIRTUAL(CAppPoolPerf)
  251. virtual void DoDataExchange(CDataExchange * pDX);
  252. //}}AFX_VIRTUAL
  253. virtual HRESULT FetchLoadedValues();
  254. virtual HRESULT SaveInfo();
  255. };
  256. #if 0
  257. class CAppPoolDebug : public CInetPropertyPage
  258. {
  259. DECLARE_DYNCREATE(CAppPoolDebug)
  260. public:
  261. CAppPoolDebug(CInetPropertySheet * pSheet = NULL);
  262. virtual ~CAppPoolDebug();
  263. //
  264. // Dialog Data
  265. //
  266. protected:
  267. //{{AFX_DATA(CAppPoolDebug)
  268. enum { IDD = IDD_APP_POOL_DEBUG };
  269. BOOL m_fDoEnableDebug;
  270. CButton m_bnt_DoEnableDebug;
  271. CString m_DebuggerFileName;
  272. CEdit m_FileName;
  273. CButton m_Browse;
  274. CString m_DebuggerParams;
  275. CEdit m_Params;
  276. //}}AFX_DATA
  277. //{{AFX_MSG(CAppPoolPerf)
  278. virtual BOOL OnInitDialog();
  279. afx_msg void OnDoEnableDebug();
  280. afx_msg void OnBrowse();
  281. //}}AFX_MSG
  282. DECLARE_MESSAGE_MAP()
  283. //
  284. // Overrides
  285. //
  286. protected:
  287. //{{AFX_VIRTUAL(CAppPoolPerf)
  288. virtual void DoDataExchange(CDataExchange * pDX);
  289. afx_msg void OnItemChanged();
  290. //}}AFX_VIRTUAL
  291. virtual HRESULT FetchLoadedValues();
  292. virtual HRESULT SaveInfo();
  293. void SetControlState();
  294. };
  295. #endif
  296. class CAppPoolIdent : public CInetPropertyPage
  297. {
  298. DECLARE_DYNCREATE(CAppPoolIdent)
  299. public:
  300. CAppPoolIdent(CInetPropertySheet * pSheet = NULL);
  301. virtual ~CAppPoolIdent();
  302. //
  303. // Dialog Data
  304. //
  305. protected:
  306. //{{AFX_DATA(CAppPoolIdent)
  307. enum { IDD = IDD_APP_POOL_IDENT };
  308. CButton m_bnt_Predefined;
  309. CButton m_bnt_Configurable;
  310. CComboBox m_PredefList;
  311. int m_PredefIndex;
  312. CString m_strUserName;
  313. CStrPassword m_strUserPass;
  314. CEdit m_UserName;
  315. CEdit m_UserPass;
  316. CButton m_Browse;
  317. //}}AFX_DATA
  318. BOOL m_fPredefined;
  319. DWORD m_dwIdentType;
  320. //{{AFX_MSG(CAppPoolPerf)
  321. virtual BOOL OnInitDialog();
  322. afx_msg void OnPredefined();
  323. afx_msg void OnBrowse();
  324. //}}AFX_MSG
  325. DECLARE_MESSAGE_MAP()
  326. //
  327. // Overrides
  328. //
  329. protected:
  330. //{{AFX_VIRTUAL(CAppPoolPerf)
  331. virtual void DoDataExchange(CDataExchange * pDX);
  332. afx_msg void OnItemChanged();
  333. afx_msg void OnSysAccountChanged();
  334. //}}AFX_VIRTUAL
  335. virtual HRESULT FetchLoadedValues();
  336. virtual HRESULT SaveInfo();
  337. void SetControlState();
  338. BOOL m_bAssCovered;
  339. };
  340. #if 0
  341. class CAppPoolCache : public CAppCache
  342. {
  343. public:
  344. CAppPoolCache(CInetPropertySheet * pSheet)
  345. : CAppCache(pSheet)
  346. {
  347. }
  348. virtual ~CAppPoolCache()
  349. {
  350. }
  351. protected:
  352. virtual HRESULT FetchLoadedValues();
  353. virtual HRESULT SaveInfo();
  354. };
  355. class CPoolProcessOpt : public CProcessOptPage
  356. {
  357. public:
  358. CPoolProcessOpt(CInetPropertySheet * pSheet)
  359. : CProcessOptPage(pSheet)
  360. {
  361. }
  362. virtual ~CPoolProcessOpt()
  363. {
  364. }
  365. protected:
  366. virtual HRESULT FetchLoadedValues();
  367. virtual HRESULT SaveInfo();
  368. };
  369. #endif
  370. //
  371. // BUGBUG: Returns S_OK if object not present
  372. //
  373. inline HRESULT CAppPoolSheet::QueryInstanceResult() const
  374. {
  375. return m_pprops ? m_pprops->QueryResult() : S_OK;
  376. }
  377. #endif //_APP_POOL_SHEET_H