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.

163 lines
4.5 KiB

  1. /*++
  2. Copyright (C) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. ctrsprop.h
  5. Abstract:
  6. Header file for the counters general property page
  7. --*/
  8. #ifndef _CTRSPROP_H_
  9. #define _CTRSPROP_H_
  10. #if _MSC_VER >= 1000
  11. #pragma once
  12. #endif // _MSC_VER >= 1000
  13. #include "smproppg.h" // Base class
  14. #include "smcfghlp.h"
  15. // Dialog controls
  16. #define IDD_COUNTERS_PROP 800
  17. #define IDC_CTRS_FILENAME_CAPTION 801
  18. #define IDC_CTRS_LOG_SCHED_TEXT 802
  19. #define IDC_CTRS_SAMPLE_CAPTION 803
  20. #define IDC_CTRS_SAMPLE_INTERVAL_CAPTION 804
  21. #define IDC_CTRS_SAMPLE_UNITS_CAPTION 805
  22. #define IDC_CTRS_FIRST_HELP_CTRL_ID 806 // First control with Help text.
  23. #define IDC_CTRS_COUNTER_LIST 806
  24. #define IDC_CTRS_ADD_OBJ_BTN 807
  25. #define IDC_CTRS_ADD_BTN 808
  26. #define IDC_CTRS_REMOVE_BTN 809
  27. #define IDC_CTRS_FILENAME_DISPLAY 810
  28. #define IDC_CTRS_SAMPLE_SPIN 811
  29. #define IDC_CTRS_SAMPLE_UNITS_COMBO 812
  30. #define IDC_CTRS_SAMPLE_EDIT 813
  31. #define PDLCNFIG_LISTBOX_STARS_YES 1
  32. class CSmCounterLogQuery;
  33. /////////////////////////////////////////////////////////////////////////////
  34. // CCountersProperty dialog
  35. class CCountersProperty : public CSmPropertyPage
  36. {
  37. DECLARE_DYNCREATE(CCountersProperty)
  38. // Construction
  39. public:
  40. CCountersProperty();
  41. CCountersProperty(MMC_COOKIE mmcCookie, LONG_PTR hConsole);
  42. virtual ~CCountersProperty();
  43. public:
  44. // Dialog Data
  45. //{{AFX_DATA(CCountersProperty)
  46. enum { IDD = IDD_COUNTERS_PROP };
  47. int m_nSampleUnits;
  48. CString m_strFileNameDisplay;
  49. CString m_strStartDisplay;
  50. //}}AFX_DATA
  51. // Overrides
  52. // ClassWizard generate virtual function overrides
  53. //{{AFX_VIRTUAL(CCountersProperty)
  54. public:
  55. protected:
  56. virtual void OnFinalRelease();
  57. virtual BOOL OnInitDialog();
  58. virtual BOOL OnSetActive();
  59. virtual BOOL OnKillActive();
  60. virtual BOOL OnApply();
  61. virtual void OnCancel();
  62. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  63. virtual void PostNcDestroy();
  64. //}}AFX_VIRTUAL
  65. public:
  66. // All of these members are Public to be accessed by the callback routine.
  67. LPWSTR m_szCounterListBuffer;
  68. DWORD m_dwCounterListBufferSize;
  69. long m_lCounterListHasStars;
  70. DWORD m_dwMaxHorizListExtent;
  71. PDH_BROWSE_DLG_CONFIG m_dlgConfig;
  72. CSmCounterLogQuery *m_pCtrLogQuery;
  73. // Implementation
  74. protected:
  75. virtual INT GetFirstHelpCtrlId ( void )
  76. {
  77. return IDC_CTRS_FIRST_HELP_CTRL_ID;
  78. }; // Subclass must override.
  79. virtual BOOL IsValidLocalData ();
  80. // Generated message map functions
  81. //{{AFX_MSG(CCountersProperty)
  82. afx_msg void OnCtrsAddBtn();
  83. afx_msg void OnCtrsAddObjBtn();
  84. afx_msg void OnCtrsRemoveBtn();
  85. afx_msg void OnPwdBtn();
  86. afx_msg void OnDblclkCtrsCounterList();
  87. afx_msg void OnKillfocusSchedSampleEdit();
  88. afx_msg void OnDeltaposSchedSampleSpin(NMHDR* pNMHDR, LRESULT* pResult);
  89. afx_msg void OnSelendokSampleUnitsCombo();
  90. afx_msg void OnChangeUser();
  91. //}}AFX_MSG
  92. DECLARE_MESSAGE_MAP()
  93. // Generated OLE dispatch map functions
  94. //{{AFX_DISPATCH(CCountersProperty)
  95. // NOTE - the ClassWizard will add and remove member functions here.
  96. //}}AFX_DISPATCH
  97. DECLARE_DISPATCH_MAP()
  98. DECLARE_INTERFACE_MAP()
  99. private:
  100. enum eValueRange {
  101. eMinSampleInterval = 1,
  102. eMaxSampleInterval = 999999,
  103. eHashTableSize = 257
  104. };
  105. typedef struct _HASH_ENTRY {
  106. struct _HASH_ENTRY * pNext;
  107. PPDH_COUNTER_PATH_ELEMENTS pCounter;
  108. } HASH_ENTRY, *PHASH_ENTRY;
  109. PHASH_ENTRY m_HashTable[257];
  110. ULONG HashCounter ( LPWSTR szCounterName );
  111. void ImplementAdd ( BOOL bShowObjects );
  112. void UpdateFileNameString ( void );
  113. void UpdateLogStartString ( void );
  114. void SetButtonState( void );
  115. public:
  116. DWORD CheckDuplicate( PPDH_COUNTER_PATH_ELEMENTS pCounter);
  117. BOOL RemoveCounterFromHashTable( LPWSTR szCounterName, PPDH_COUNTER_PATH_ELEMENTS pCounterPath);
  118. void ClearCountersHashTable ( void );
  119. PPDH_COUNTER_PATH_ELEMENTS InsertCounterToHashTable ( LPWSTR szCounterName );
  120. };
  121. //{{AFX_INSERT_LOCATION}}
  122. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  123. #endif // _CTRSPROP_H_