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.

127 lines
4.0 KiB

  1. /*++
  2. Copyright (C) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. smtraceq.h
  5. Abstract:
  6. Class definitions for the trace log query class.
  7. --*/
  8. #ifndef _CLASS_SMTRACEQ_
  9. #define _CLASS_SMTRACEQ_
  10. #include "smlogqry.h"
  11. // open method flags
  12. // only open an existing entry
  13. #define SLQ_OPEN_EXISTING 0
  14. // always create a new and uninitialized entry
  15. #define SLQ_CREATE_NEW 1
  16. // open an existing entry if it exists or create an empty one if not
  17. #define SLQ_OPEN_ALWAYS 2
  18. typedef struct _SLQ_TRACE_LOG_INFO {
  19. DWORD dwBufferSize; // in K bytes
  20. DWORD dwMinimumBuffers;
  21. DWORD dwMaximumBuffers;
  22. DWORD dwBufferFlushInterval; // in seconds
  23. DWORD dwBufferFlags; // defined in common.h
  24. } SLQ_TRACE_LOG_INFO, *PSLQ_TRACE_LOG_INFO;
  25. //
  26. // This object is used to represent trace log queries
  27. //
  28. //
  29. class CSmTraceLogQuery : public CSmLogQuery
  30. {
  31. // constructor/destructor
  32. public:
  33. CSmTraceLogQuery( CSmLogService* );
  34. virtual ~CSmTraceLogQuery( void );
  35. // public methods
  36. public:
  37. enum eProviderState {
  38. eNotInQuery = 0,
  39. eInQuery = 1
  40. };
  41. virtual DWORD Open ( const CString& rstrName, HKEY hKeyQuery, BOOL bReadOnly);
  42. virtual DWORD Close ( void );
  43. virtual DWORD SyncWithRegistry ( void );
  44. HRESULT SyncGenProviders ( void );
  45. virtual BOOL GetLogTime ( PSLQ_TIME_INFO pTimeInfo, DWORD dwFlags );
  46. virtual BOOL SetLogTime ( PSLQ_TIME_INFO pTimeInfo, const DWORD dwFlags );
  47. virtual BOOL GetDefaultLogTime ( SLQ_TIME_INFO& rTimeInfo, DWORD dwFlags );
  48. virtual DWORD GetLogType ( void );
  49. BOOL GetTraceLogInfo ( PSLQ_TRACE_LOG_INFO pptlInfo );
  50. BOOL SetTraceLogInfo ( PSLQ_TRACE_LOG_INFO pptlInfo );
  51. BOOL GetKernelFlags ( DWORD& rdwFlags );
  52. BOOL SetKernelFlags ( DWORD dwFlags );
  53. DWORD InitGenProvidersArray ( void );
  54. LPCWSTR GetProviderDescription ( INT iProvIndex );
  55. LPCWSTR GetProviderGuid ( INT iProvIndex );
  56. BOOL IsEnabledProvider ( INT iProvIndex );
  57. BOOL IsActiveProvider ( INT iProvIndex );
  58. DWORD GetGenProviderCount ( INT& iCount );
  59. LPCWSTR GetKernelProviderDescription ( void );
  60. BOOL GetKernelProviderEnabled ( void );
  61. INT GetFirstInactiveIndex ( void );
  62. INT GetNextInactiveIndex ( void );
  63. BOOL ActiveProviderExists ( void );
  64. DWORD GetInQueryProviders ( CArray<eProviderState, eProviderState&>& );
  65. DWORD SetInQueryProviders ( CArray<eProviderState, eProviderState&>& );
  66. virtual HRESULT LoadFromPropertyBag ( IPropertyBag*, IErrorLog* );
  67. virtual HRESULT SaveToPropertyBag ( IPropertyBag*, BOOL fSaveAllProps );
  68. virtual CSmTraceLogQuery* CastToTraceLogQuery ( void ) { return this; };
  69. // protected methods
  70. protected:
  71. virtual DWORD UpdateRegistry();
  72. // private member variables
  73. private:
  74. VOID ResetInQueryProviderList ( void );
  75. BOOL AddInQueryProvider ( LPCWSTR szProviderPath);
  76. LPCWSTR GetFirstInQueryProvider ( void );
  77. LPCWSTR GetNextInQueryProvider ( void );
  78. LPWSTR m_szNextInQueryProvider;
  79. DWORD m_dwInQueryProviderListLength; // in chars including MSZ null
  80. CArray<eProviderState, eProviderState&> m_arrGenProviders;
  81. INT m_iNextInactiveIndex;
  82. // Registry Values
  83. LPWSTR mr_szInQueryProviderList;
  84. SLQ_TRACE_LOG_INFO mr_stlInfo;
  85. DWORD m_dwKernelFlags; // defined in common.h
  86. };
  87. typedef CSmTraceLogQuery SLTRACEQUERY;
  88. typedef CSmTraceLogQuery* PSLTRACEQUERY;
  89. #endif //_CLASS_SMTRACEQ_