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.

102 lines
3.1 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // LoggerStream.h
  7. //
  8. // Description:
  9. // ClCfgSrv Logger definition.
  10. //
  11. // Maintained By:
  12. // David Potter (DavidP) 11-DEC-2000
  13. //
  14. //////////////////////////////////////////////////////////////////////////////
  15. // Make sure that this file is included only once per compile path.
  16. #pragma once
  17. //////////////////////////////////////////////////////////////////////////////
  18. // Forward Class Definitions
  19. //////////////////////////////////////////////////////////////////////////////
  20. class CClCfgSrvLogger;
  21. //////////////////////////////////////////////////////////////////////////////
  22. // Constant Definitions
  23. //////////////////////////////////////////////////////////////////////////////
  24. //////////////////////////////////////////////////////////////////////////////
  25. //++
  26. //
  27. // class CClCfgSrvLogger
  28. //
  29. // Description:
  30. // Manages a logging stream to a file.
  31. //
  32. //--
  33. //////////////////////////////////////////////////////////////////////////////
  34. class CClCfgSrvLogger
  35. : public ILogger
  36. {
  37. private:
  38. // IUnknown
  39. LONG m_cRef; // Reference counter.
  40. // ILogger
  41. static IGlobalInterfaceTable * sm_pgit; // Global Interface Table.
  42. static CRITICAL_SECTION * sm_pcritsec; // Critical section for Release.
  43. static bool sm_fRevokingFromGIT;// Currently revoking interface from GIT.
  44. static DWORD sm_cookieGITLogger; // Cookie for this logger interface.
  45. private: // Methods
  46. //
  47. // Constructors, destructors, and initializers
  48. //
  49. CClCfgSrvLogger( void );
  50. ~CClCfgSrvLogger( void );
  51. STDMETHOD( HrInit )( void );
  52. // Private copy constructor to prevent copying.
  53. CClCfgSrvLogger( const CClCfgSrvLogger & rccslSrcIn );
  54. // Private assignment operator to prevent copying.
  55. const CClCfgSrvLogger & operator=( const CClCfgSrvLogger & rccslSrcIn );
  56. public: // Methods
  57. static HRESULT
  58. S_HrCreateInstance( IUnknown ** ppunkOut );
  59. // IUnknown Interfaces
  60. STDMETHOD( QueryInterface )( REFIID riidIn, void ** ppvOut );
  61. STDMETHOD_( ULONG, AddRef )( void );
  62. STDMETHOD_( ULONG, Release )( void );
  63. // ILogger
  64. STDMETHOD( LogMsg )( LPCWSTR pcszMsgIn );
  65. static HRESULT
  66. S_HrGetLogger( ILogger ** pplLoggerOut );
  67. static HRESULT
  68. S_HrLogStatusReport(
  69. ILogger * plLogger
  70. , LPCWSTR pcszNodeNameIn
  71. , CLSID clsidTaskMajorIn
  72. , CLSID clsidTaskMinorIn
  73. , ULONG ulMinIn
  74. , ULONG ulMaxIn
  75. , ULONG ulCurrentIn
  76. , HRESULT hrStatusIn
  77. , LPCWSTR pcszDescriptionIn
  78. , FILETIME * pftTimeIn
  79. , LPCWSTR pcszReferenceIn
  80. );
  81. }; //*** class CClCfgSrvLogger
  82. //////////////////////////////////////////////////////////////////////////////
  83. // Global Function Prototypes
  84. //////////////////////////////////////////////////////////////////////////////