Source code of Windows XP (NT5)
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.

109 lines
3.5 KiB

  1. /*++
  2. Copyright (C) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. smalrtq.h
  5. Abstract:
  6. This object is used to represent performance alert queries (a.k.a.
  7. sysmon alert queries).
  8. --*/
  9. #ifndef _CLASS_SMALRTQ_
  10. #define _CLASS_SMALRTQ_
  11. #include "smlogqry.h"
  12. typedef struct _ALERT_ACTION_INFO {
  13. DWORD dwSize;
  14. DWORD dwActionFlags;
  15. LPWSTR szNetName;
  16. LPWSTR szCmdFilePath;
  17. LPWSTR szUserText;
  18. LPWSTR szLogName;
  19. } ALERT_ACTION_INFO, *PALERT_ACTION_INFO;
  20. class CSmLogService;
  21. class CSmAlertQuery : public CSmLogQuery
  22. {
  23. // constructor/destructor
  24. public:
  25. CSmAlertQuery( CSmLogService* );
  26. virtual ~CSmAlertQuery( void );
  27. // public methods
  28. public:
  29. virtual DWORD Open ( const CString& rstrName, HKEY hKeyQuery, BOOL bReadOnly);
  30. virtual DWORD Close ( void );
  31. virtual DWORD UpdateRegistry( void ); // load reg. w/ internal values
  32. virtual DWORD SyncWithRegistry( void );
  33. virtual BOOL GetLogTime(PSLQ_TIME_INFO pTimeInfo, DWORD dwFlags);
  34. virtual BOOL SetLogTime(PSLQ_TIME_INFO pTimeInfo, const DWORD dwFlags);
  35. virtual BOOL GetDefaultLogTime(SLQ_TIME_INFO& rTimeInfo, DWORD dwFlags);
  36. virtual DWORD GetLogType( void );
  37. virtual const CString& GetLogFileType ( void );
  38. virtual void GetLogFileType ( DWORD& );
  39. virtual BOOL SetLogFileType ( const DWORD );
  40. virtual const CString& GetLogFileName( BOOL bLatestRunning = FALSE );
  41. // Methods specific to this query type
  42. LPCWSTR GetCounterList( LPDWORD pcchListSize );
  43. BOOL SetCounterList( LPCWSTR mszCounterList, DWORD cchListSize );
  44. LPCWSTR GetFirstCounter( void );
  45. LPCWSTR GetNextCounter( void );
  46. VOID ResetCounterList( void );
  47. BOOL AddCounter(LPCWSTR szCounterPath);
  48. BOOL GetActionInfo( PALERT_ACTION_INFO pInfo, LPDWORD pdwInfoBufSize);
  49. DWORD SetActionInfo( PALERT_ACTION_INFO pInfo );
  50. virtual HRESULT LoadFromPropertyBag ( IPropertyBag*, IErrorLog* );
  51. virtual HRESULT SaveToPropertyBag ( IPropertyBag*, BOOL fSaveAllProps );
  52. virtual HRESULT LoadCountersFromPropertyBag ( IPropertyBag*, IErrorLog* );
  53. virtual HRESULT SaveCountersToPropertyBag ( IPropertyBag* );
  54. virtual HRESULT TranslateMSZAlertCounterList( LPTSTR pszCounterList,
  55. LPTSTR pBuffer,
  56. LPDWORD pdwBufferSize,
  57. BOOL bFlag);
  58. virtual CSmAlertQuery* CastToAlertQuery( void ) { return this; };
  59. // protected methods
  60. protected:
  61. // private member variables
  62. private:
  63. LPWSTR m_szNextCounter;
  64. DWORD m_dwCounterListLength; // in chars including MSZ null
  65. // Registry Values
  66. LPWSTR mr_szCounterList;
  67. DWORD mr_dwActionFlags;
  68. CString mr_strNetName;
  69. CString mr_strCmdFileName;
  70. CString mr_strCmdUserText;
  71. CString mr_strCmdUserTextIndirect;
  72. CString mr_strPerfLogName;
  73. };
  74. typedef CSmAlertQuery SLALERTQUERY;
  75. typedef CSmAlertQuery* PSLALERTQUERY;
  76. #endif //_CLASS_SMALRTQ_