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.

412 lines
11 KiB

  1. /*******************************************************************************
  2. *
  3. * servpgs.h
  4. *
  5. * - declarations for the Server info pages
  6. * - the server info pages are all CFormView derivatives
  7. * based on dialog templates
  8. *
  9. * copyright notice: Copyright 1997, Citrix Systems Inc.
  10. * Copyright (c) 1998 - 1999 Microsoft Corporation
  11. *
  12. * $Author: donm $ Don Messerli
  13. *
  14. * $Log: N:\nt\private\utils\citrix\winutils\winadmin\VCS\servpgs.h $
  15. *
  16. * Rev 1.2 03 Nov 1997 15:30:16 donm
  17. * added descending sort
  18. *
  19. * Rev 1.1 13 Oct 1997 18:39:42 donm
  20. * update
  21. *
  22. * Rev 1.0 30 Jul 1997 17:12:32 butchd
  23. * Initial revision.
  24. *
  25. *******************************************************************************/
  26. #ifndef _SERVERPAGES_H
  27. #define _SERVERPAGES_H
  28. #include "Resource.h"
  29. #ifndef __AFXEXT_H__
  30. #include <afxext.h>
  31. #endif
  32. #include "winadmin.h"
  33. //////////////////////////
  34. // CLASS: CUsersPage
  35. //
  36. class CUsersPage : public CAdminPage
  37. {
  38. friend class CServerView;
  39. protected:
  40. CUsersPage(); // protected constructor used by dynamic creation
  41. DECLARE_DYNCREATE(CUsersPage)
  42. // Form Data
  43. public:
  44. //{{AFX_DATA(CUsersPage)
  45. enum { IDD = IDD_SERVER_USERS };
  46. CListCtrl m_UserList;
  47. //}}AFX_DATA
  48. // Attributes
  49. public:
  50. protected:
  51. CImageList m_ImageList; // image list associated with the tree control
  52. int m_idxUser; // index of User image
  53. int m_idxCurrentUser; // index of Current User image
  54. private:
  55. CServer* m_pServer; // pointer to current server's info
  56. int m_CurrentSortColumn;
  57. BOOL m_bSortAscending;
  58. CCriticalSection m_ListControlCriticalSection;
  59. // Operations
  60. public:
  61. void UpdateWinStations(CServer *pServer);
  62. virtual void ClearSelections();
  63. private:
  64. int AddIconToImageList(int); // adds an icon's image to the image list and returns the image's index
  65. void BuildImageList(); // builds the image list;
  66. void DisplayUsers();
  67. virtual void Reset(void *pServer);
  68. int AddUserToList(CWinStation *pWinStation);
  69. void LockListControl() { m_ListControlCriticalSection.Lock(); }
  70. void UnlockListControl() { m_ListControlCriticalSection.Unlock(); }
  71. // Overrides
  72. // ClassWizard generated virtual function overrides
  73. //{{AFX_VIRTUAL(CUsersPage)
  74. public:
  75. virtual void OnInitialUpdate();
  76. protected:
  77. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  78. //}}AFX_VIRTUAL
  79. // Implementation
  80. protected:
  81. virtual ~CUsersPage();
  82. #ifdef _DEBUG
  83. virtual void AssertValid() const;
  84. virtual void Dump(CDumpContext& dc) const;
  85. #endif
  86. // Generated message map functions
  87. //{{AFX_MSG(CUsersPage)
  88. afx_msg void OnSize(UINT nType, int cx, int cy);
  89. afx_msg void OnUserItemChanged(NMHDR* pNMHDR, LRESULT* pResult);
  90. afx_msg void OnColumnClick(NMHDR* pNMHDR, LRESULT* pResult);
  91. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  92. afx_msg void OnSetfocusUserList(NMHDR* pNMHDR, LRESULT* pResult);
  93. afx_msg void OnKillfocusUserList(NMHDR* pNMHDR, LRESULT* pResult);
  94. //}}AFX_MSG
  95. DECLARE_MESSAGE_MAP()
  96. }; // end class CUsersPage
  97. //////////////////////////
  98. // CLASS: CServerWinStationsPage
  99. //
  100. class CServerWinStationsPage : public CAdminPage
  101. {
  102. friend class CServerView;
  103. protected:
  104. CServerWinStationsPage(); // protected constructor used by dynamic creation
  105. DECLARE_DYNCREATE(CServerWinStationsPage)
  106. // Form Data
  107. public:
  108. //{{AFX_DATA(CServerWinStationsPage)
  109. enum { IDD = IDD_SERVER_WINSTATIONS };
  110. CListCtrl m_StationList;
  111. //}}AFX_DATA
  112. // Attributes
  113. public:
  114. protected:
  115. CImageList m_ImageList; // image list associated with the tree control
  116. int m_idxBlank; // index of Blank image
  117. int m_idxCitrix; // index of Citrix image
  118. int m_idxServer; // index of Server image
  119. int m_idxConsole; // index of Console image
  120. int m_idxNet; // index of Net image
  121. int m_idxAsync; // index of Async image
  122. int m_idxCurrentNet; // index of Current Net image
  123. int m_idxCurrentConsole;// index of Current Console image
  124. int m_idxCurrentAsync; // index of Current Async image
  125. int m_idxDirectAsync; // index of Direct Async image
  126. int m_idxCurrentDirectAsync; // index of Current Direct Async image
  127. private:
  128. CServer* m_pServer; // pointer to current server's info
  129. int m_CurrentSortColumn;
  130. BOOL m_bSortAscending;
  131. CCriticalSection m_ListControlCriticalSection;
  132. // Operations
  133. public:
  134. void UpdateWinStations(CServer *pServer);
  135. virtual void ClearSelections();
  136. private:
  137. int AddIconToImageList(int); // adds an icon's image to the image list and returns the image's index
  138. void BuildImageList(); // builds the image list;
  139. void DisplayStations();
  140. virtual void Reset(void *pServer);
  141. int AddWinStationToList(CWinStation *pWinStation);
  142. void LockListControl() { m_ListControlCriticalSection.Lock(); }
  143. void UnlockListControl() { m_ListControlCriticalSection.Unlock(); }
  144. // Overrides
  145. // ClassWizard generated virtual function overrides
  146. //{{AFX_VIRTUAL(CServerWinStationsPage)
  147. public:
  148. virtual void OnInitialUpdate();
  149. protected:
  150. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  151. //}}AFX_VIRTUAL
  152. // Implementation
  153. protected:
  154. virtual ~CServerWinStationsPage();
  155. #ifdef _DEBUG
  156. virtual void AssertValid() const;
  157. virtual void Dump(CDumpContext& dc) const;
  158. #endif
  159. // Generated message map functions
  160. //{{AFX_MSG(CServerWinStationsPage)
  161. afx_msg void OnSize(UINT nType, int cx, int cy);
  162. afx_msg void OnWinStationItemChanged(NMHDR* pNMHDR, LRESULT* pResult);
  163. afx_msg void OnColumnClick(NMHDR* pNMHDR, LRESULT* pResult);
  164. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  165. afx_msg void OnSetfocusWinstationList(NMHDR* pNMHDR, LRESULT* pResult);
  166. afx_msg void OnKillfocusWinstationList(NMHDR* pNMHDR, LRESULT* pResult);
  167. //}}AFX_MSG
  168. DECLARE_MESSAGE_MAP()
  169. }; // end class CServerWinStationsPage
  170. ////////////////////////////
  171. // CLASS: CServerProcessesPage
  172. //
  173. class CServerProcessesPage : public CAdminPage
  174. {
  175. friend class CServerView;
  176. protected:
  177. CServerProcessesPage(); // protected constructor used by dynamic creation
  178. DECLARE_DYNCREATE(CServerProcessesPage)
  179. // Form Data
  180. public:
  181. //{{AFX_DATA(CServerProcessesPage)
  182. enum { IDD = IDD_SERVER_PROCESSES };
  183. CListCtrl m_ProcessList;
  184. //}}AFX_DATA
  185. // Attributes
  186. public:
  187. private:
  188. CServer *m_pServer;
  189. int m_CurrentSortColumn;
  190. BOOL m_bSortAscending;
  191. CCriticalSection m_ListControlCriticalSection;
  192. // Operations
  193. public:
  194. void UpdateProcesses();
  195. void RemoveProcess(CProcess *pProcess);
  196. private:
  197. void DisplayProcesses();
  198. virtual void Reset(void *pServer);
  199. int AddProcessToList(CProcess *pProcess);
  200. void LockListControl() { m_ListControlCriticalSection.Lock(); }
  201. void UnlockListControl() { m_ListControlCriticalSection.Unlock(); }
  202. // Overrides
  203. // ClassWizard generated virtual function overrides
  204. //{{AFX_VIRTUAL(CServerProcessesPage)
  205. public:
  206. virtual void OnInitialUpdate();
  207. protected:
  208. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  209. //}}AFX_VIRTUAL
  210. // Implementation
  211. protected:
  212. virtual ~CServerProcessesPage();
  213. #ifdef _DEBUG
  214. virtual void AssertValid() const;
  215. virtual void Dump(CDumpContext& dc) const;
  216. #endif
  217. // Generated message map functions
  218. //{{AFX_MSG(CServerProcessesPage)
  219. afx_msg void OnSize(UINT nType, int cx, int cy);
  220. afx_msg void OnColumnClick(NMHDR* pNMHDR, LRESULT* pResult);
  221. afx_msg void OnProcessItemChanged(NMHDR* pNMHDR, LRESULT* pResult);
  222. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  223. afx_msg void OnSetfocusProcessList(NMHDR* pNMHDR, LRESULT* pResult);
  224. afx_msg void OnKillfocusProcessList(NMHDR* pNMHDR, LRESULT* pResult);
  225. //}}AFX_MSG
  226. DECLARE_MESSAGE_MAP()
  227. }; // end class CServerProcessesPage
  228. //////////////////////////
  229. // CLASS: CServerLicensesPage
  230. //
  231. class CServerLicensesPage : public CAdminPage
  232. {
  233. friend class CServerView;
  234. protected:
  235. CServerLicensesPage(); // protected constructor used by dynamic creation
  236. DECLARE_DYNCREATE(CServerLicensesPage)
  237. // Form Data
  238. public:
  239. //{{AFX_DATA(CServerLicencesPage)
  240. enum { IDD = IDD_SERVER_LICENSES };
  241. CListCtrl m_LicenseList;
  242. //}}AFX_DATA
  243. // Attributes
  244. public:
  245. protected:
  246. CImageList m_ImageList; // image list associated with the tree control
  247. int m_idxBase; // index of Base image
  248. int m_idxBump; // index of Bump image
  249. int m_idxEnabler; // index of Enabler image
  250. int m_idxUnknown; // index of Unknown image
  251. int m_idxBlank; // index of Blank image
  252. private:
  253. CServer* m_pServer; // pointer to current server's info
  254. int m_CurrentSortColumn;
  255. BOOL m_bSortAscending;
  256. // Operations
  257. public:
  258. private:
  259. int AddIconToImageList(int); // adds an icon's image to the image list and returns the image's index
  260. void BuildImageList(); // builds the image list;
  261. void DisplayLicenses();
  262. void DisplayLicenseCounts();
  263. virtual void Reset(void *pServer);
  264. // Overrides
  265. // ClassWizard generated virtual function overrides
  266. //{{AFX_VIRTUAL(CServerLicensesPage)
  267. public:
  268. virtual void OnInitialUpdate();
  269. protected:
  270. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  271. //}}AFX_VIRTUAL
  272. // Implementation
  273. protected:
  274. virtual ~CServerLicensesPage();
  275. #ifdef _DEBUG
  276. virtual void AssertValid() const;
  277. virtual void Dump(CDumpContext& dc) const;
  278. #endif
  279. // Generated message map functions
  280. //{{AFX_MSG(CServerLicensesPage)
  281. afx_msg void OnSize(UINT nType, int cx, int cy);
  282. afx_msg void OnColumnClick(NMHDR* pNMHDR, LRESULT* pResult);
  283. afx_msg void OnSetfocusLicenseList(NMHDR* pNMHDR, LRESULT* pResult);
  284. afx_msg void OnKillfocusLicenseList(NMHDR* pNMHDR, LRESULT* pResult);
  285. //}}AFX_MSG
  286. DECLARE_MESSAGE_MAP()
  287. }; // end class CServerLicensesPage
  288. //////////////////////////
  289. // CLASS: CServerInfoPage
  290. //
  291. class CServerInfoPage : public CAdminPage
  292. {
  293. friend class CServerView;
  294. protected:
  295. CServerInfoPage(); // protected constructor used by dynamic creation
  296. DECLARE_DYNCREATE(CServerInfoPage)
  297. // Form Data
  298. public:
  299. //{{AFX_DATA(CServerInfoPage)
  300. enum { IDD = IDD_SERVER_INFO };
  301. CListCtrl m_HotfixList;
  302. //}}AFX_DATA
  303. // Attributes
  304. public:
  305. protected:
  306. CImageList m_StateImageList;
  307. int m_idxNotSign; // index of Not Sign image (for non-valid hotfixes - state)
  308. private:
  309. CServer* m_pServer; // pointer to current server's info
  310. int m_CurrentSortColumn;
  311. BOOL m_bSortAscending;
  312. // Operations
  313. public:
  314. private:
  315. void DisplayInfo();
  316. virtual void Reset(void *pServer);
  317. void BuildImageList(); // builds the image list;
  318. void TSAdminDateTimeString(LONG InstallDate, LPTSTR TimeString, BOOL LongDate=FALSE);
  319. // Overrides
  320. // ClassWizard generated virtual function overrides
  321. //{{AFX_VIRTUAL(CServerInfoPage)
  322. public:
  323. virtual void OnInitialUpdate();
  324. protected:
  325. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  326. //}}AFX_VIRTUAL
  327. // Implementation
  328. protected:
  329. virtual ~CServerInfoPage();
  330. #ifdef _DEBUG
  331. virtual void AssertValid() const;
  332. virtual void Dump(CDumpContext& dc) const;
  333. #endif
  334. // Generated message map functions
  335. //{{AFX_MSG(CServerInfoPage)
  336. afx_msg void OnSize(UINT nType, int cx, int cy);
  337. afx_msg void OnColumnClick(NMHDR* pNMHDR, LRESULT* pResult);
  338. afx_msg void OnSetfocusHotfixList(NMHDR* pNMHDR, LRESULT* pResult);
  339. afx_msg void OnKillfocusHotfixList(NMHDR* pNMHDR, LRESULT* pResult);
  340. afx_msg void OnCommandHelp(void);
  341. //}}AFX_MSG
  342. DECLARE_MESSAGE_MAP()
  343. }; // end class CServerInfoPage
  344. #endif // _SERVERPAGES_H