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.

106 lines
2.4 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1998 **/
  4. /**********************************************************************/
  5. /*
  6. svrstats.h
  7. The server statistics dialog
  8. FILE HISTORY:
  9. */
  10. #ifndef _SVRSTATS_H
  11. #define _SVRSTATS_H
  12. #if _MSC_VER >= 1000
  13. #pragma once
  14. #endif // _MSC_VER >= 1000
  15. #ifndef _STATSDLG_H
  16. #include "statsdlg.h"
  17. #endif
  18. #ifndef _WINSSNAP_H
  19. #include "winssnap.h"
  20. #endif
  21. #ifndef _LISTVIEW_H
  22. #include "listview.h"
  23. #endif
  24. // WINS Service file
  25. extern "C" {
  26. #include "winsintf.h"
  27. #include "ipaddr.h"
  28. }
  29. #define SERVER_STATS_DEFAULT_WIDTH 450
  30. #define SERVER_STATS_DEFAULT_HEIGHT 300
  31. class CServerStatsFrame;
  32. // structure used for the back ground thread in refreshing the stats
  33. struct ThreadInfo
  34. {
  35. DWORD dwInterval;
  36. CServerStatsFrame* pDlg;
  37. };
  38. class CServerStatsFrame : public StatsDialog
  39. {
  40. public:
  41. CServerStatsFrame();
  42. ~CServerStatsFrame();
  43. // Override the OnInitDialog so that we can set the caption
  44. virtual BOOL OnInitDialog();
  45. // Override the RefreshData to provide sample data
  46. virtual HRESULT RefreshData(BOOL fGrabNewData);
  47. // Override the Sort to provide the ability to do sorting
  48. virtual void Sort(UINT nColumnId);
  49. // custom methods
  50. afx_msg long OnNewStatsAvailable(UINT wParam, LONG lParam);
  51. afx_msg long OnUpdateStats(UINT wParam, LONG lParam);
  52. void UpdateWindow(PWINSINTF_RESULTS_T pwrResults);
  53. DWORD GetStats();
  54. void SetNode(ITFSNode * pNode) { m_spNode.Set(pNode); }
  55. void SetServer(LPCTSTR pServer) { m_strServerAddress = pServer; }
  56. // message handlers
  57. afx_msg void OnDestroy();
  58. afx_msg void OnClear();
  59. DECLARE_MESSAGE_MAP()
  60. protected:
  61. CString m_strServerAddress;
  62. SPITFSNode m_spNode;
  63. CWinThread * m_pRefreshThread;
  64. HANDLE m_hmutStatistics;
  65. // helper functions
  66. void StartRefresherThread();
  67. void UpdatePartnerStats();
  68. public:
  69. WINSINTF_RESULTS_T m_wrResults;
  70. HANDLE m_hAbortEvent;
  71. DWORD GetRefreshInterval();
  72. void ReInitRefresherThread();
  73. void KillRefresherThread();
  74. // Context Help Support
  75. virtual DWORD * GetHelpMap() { return WinsGetHelpMap(IDD_STATS_NARROW); }
  76. };
  77. #endif _SERVSTAT_H