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.

176 lines
5.1 KiB

  1. /*++
  2. Copyright (C) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. alrtgenp.h
  5. Abstract:
  6. Header file for the alerts general property page.
  7. --*/
  8. #if !defined(_AFX_ALRTGENP_H__INCLUDED_)
  9. #define _AFX_ALRTGENP_H__INCLUDED_
  10. #if _MSC_VER >= 1000
  11. #pragma once
  12. #endif // _MSC_VER >= 1000
  13. #include "smalrtq.h" // For PALERT_ACTION_INFO
  14. #include "smproppg.h" // Base class
  15. #include "smcfghlp.h"
  16. // define entries in the Over/Under combo box here
  17. #define OU_OVER 0
  18. #define OU_UNDER 1
  19. // resource definitions
  20. #define IDD_ALERT_GENERAL_PROP 1500
  21. #define IDC_ALRTS_START_STRING 1501
  22. #define IDC_ALRTS_SAMPLE_CAPTION 1502
  23. #define IDC_ALRTS_SAMPLE_INTERVAL_CAPTION 1503
  24. #define IDC_ALRTS_SAMPLE_UNITS_CAPTION 1504
  25. #define IDC_ALRTS_TRIGGER_CAPTION 1505
  26. #define IDC_ALRTS_TRIGGER_VALUE_CAPTION 1506
  27. #define IDC_ALRTS_FIRST_HELP_CTRL_ID 1507
  28. #define IDC_ALRTS_COUNTER_LIST 1507
  29. #define IDC_ALRTS_ADD_BTN 1508
  30. #define IDC_ALRTS_REMOVE_BTN 1509
  31. #define IDC_ALRTS_OVER_UNDER 1510
  32. #define IDC_ALRTS_VALUE_EDIT 1511
  33. #define IDC_ALRTS_COMMENT_EDIT 1512
  34. #define IDC_ALRTS_SAMPLE_EDIT 1513
  35. #define IDC_ALRTS_SAMPLE_SPIN 1514
  36. #define IDC_ALRTS_SAMPLE_UNITS_COMBO 1515
  37. /////////////////////////////////////////////////////////////////////////////
  38. // CAlertGenProp dialog
  39. class CAlertGenProp : public CSmPropertyPage
  40. {
  41. DECLARE_DYNCREATE(CAlertGenProp)
  42. // Construction
  43. public:
  44. CAlertGenProp();
  45. CAlertGenProp(MMC_COOKIE mmcCookie, LONG_PTR hConsole);
  46. virtual ~CAlertGenProp();
  47. enum eConstants {
  48. eInvalidLimit = -1
  49. };
  50. // Dialog Data
  51. //{{AFX_DATA(CAlertGenProp)
  52. enum { IDD = IDD_ALERT_GENERAL_PROP };
  53. int m_nSampleUnits;
  54. CComboBox m_SampleUnitsCombo;
  55. CComboBox m_OverUnderCombo;
  56. CListBox m_CounterList;
  57. double m_dLimitValue;
  58. CString m_strComment;
  59. CString m_strStartDisplay;
  60. //}}AFX_DATA
  61. // Overrides
  62. // ClassWizard generate virtual function overrides
  63. //{{AFX_VIRTUAL(CAlertGenProp)
  64. public:
  65. protected:
  66. virtual BOOL OnApply();
  67. virtual BOOL OnSetActive();
  68. virtual BOOL OnKillActive();
  69. virtual void OnCancel();
  70. virtual BOOL OnInitDialog();
  71. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  72. virtual void PostNcDestroy();
  73. //}}AFX_VIRTUAL
  74. // Implementation
  75. public:
  76. void PublicOnSelchangeCounterList(void);
  77. // All of these members are Public to be accessed by the callback routine.
  78. LPWSTR m_szCounterListBuffer;
  79. DWORD m_dwCounterListBufferSize;
  80. DWORD m_dwMaxHorizListExtent;
  81. PDH_BROWSE_DLG_CONFIG m_dlgConfig;
  82. CSmAlertQuery *m_pAlertQuery; // Public for callback function
  83. // buffers used to pass data to/from property page
  84. LPWSTR m_szAlertCounterList; // MSZ list of alert items
  85. DWORD m_cchAlertCounterListSize; // size of buffer in characters
  86. protected:
  87. virtual INT GetFirstHelpCtrlId ( void ) { return IDC_ALRTS_FIRST_HELP_CTRL_ID; };
  88. virtual BOOL IsValidLocalData();
  89. // Generated message map functions
  90. //{{AFX_MSG(CAlertGenProp)
  91. afx_msg void OnDeltaposSampleSpin(NMHDR* pNMHDR, LRESULT* pResult);
  92. afx_msg void OnAddBtn();
  93. afx_msg void OnRemoveBtn();
  94. afx_msg void OnDblclkAlrtsCounterList();
  95. afx_msg void OnChangeAlertValueEdit();
  96. afx_msg void OnSelchangeCounterList();
  97. afx_msg void OnClose();
  98. afx_msg void OnCommentEditChange();
  99. afx_msg void OnSampleTimeChanged();
  100. afx_msg void OnKillFocusUpdateAlertData();
  101. afx_msg void OnCommentEditKillFocus();
  102. afx_msg void OnSelendokSampleUnitsCombo();
  103. afx_msg void OnPwdBtn();
  104. afx_msg void OnChangeUser();
  105. //}}AFX_MSG
  106. DECLARE_MESSAGE_MAP()
  107. INT m_ndxCurrentItem;
  108. BOOL SaveAlertItemData (void);
  109. BOOL LoadAlertItemData (INT nIndex);
  110. BOOL SetButtonState (void);
  111. BOOL LoadDlgFromList ( void );
  112. BOOL LoadListFromDlg ( INT *piInvalidIndex, BOOL bValidateOnly = FALSE );
  113. private:
  114. enum eValueRange {
  115. eMinSampleInterval = 1,
  116. eMaxSampleInterval = 999999,
  117. eHashTableSize = 257
  118. };
  119. // Counter Name Multi-SZ Hash Table
  120. typedef struct _HASH_ENTRY {
  121. struct _HASH_ENTRY * pNext;
  122. PPDH_COUNTER_PATH_ELEMENTS pCounter;
  123. DWORD dwFlags;
  124. double dLimit;
  125. } HASH_ENTRY, *PHASH_ENTRY;
  126. void InitAlertHashTable ( void );
  127. void ClearAlertHashTable ( void );
  128. ULONG HashCounter ( LPWSTR szCounterName, ULONG lHashSize );
  129. PDH_STATUS InsertAlertToHashTable ( PALERT_INFO_BLOCK paibInfo );
  130. void ImplementAdd ( void );
  131. void InitAfxDataItems (void);
  132. void UpdateAlertStartString ( void );
  133. PHASH_ENTRY m_HashTable[257];
  134. };
  135. //{{AFX_INSERT_LOCATION}}
  136. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  137. #endif // !defined(_AFX_ALRTGENP_H__INCLUDED_)