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.

79 lines
1.9 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // NTEventLog.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // This file describes the class NTEventLog
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 08/05/1997 Original version.
  16. // 04/19/1998 New trigger/filter model.
  17. // 08/11/1998 Convert to IASTL.
  18. // 04/23/1999 Simplify filtering.
  19. // 02/16/2000 Log Success at the same level as warnings.
  20. //
  21. ///////////////////////////////////////////////////////////////////////////////
  22. #ifndef _NTEVENTLOG_H_
  23. #define _NTEVENTLOG_H_
  24. #include <auditor.h>
  25. #include <resource.h>
  26. ///////////////////////////////////////////////////////////////////////////////
  27. //
  28. // CLASS
  29. //
  30. // NTEventLog
  31. //
  32. // DESCRIPTION
  33. //
  34. // The NTEventLog listens to an EventChannel and logs all received events
  35. // to the NT Event Log.
  36. //
  37. ///////////////////////////////////////////////////////////////////////////////
  38. class ATL_NO_VTABLE NTEventLog
  39. : public Auditor,
  40. public CComCoClass<NTEventLog, &__uuidof(NTEventLog)>
  41. {
  42. public:
  43. IAS_DECLARE_REGISTRY(NTEventLog, 1, 0, IASCoreLib)
  44. NTEventLog() throw ()
  45. : eventLog(NULL)
  46. { }
  47. ~NTEventLog() throw ()
  48. { if (eventLog) { DeregisterEventSource(eventLog); } }
  49. //////////
  50. // IIasComponent
  51. //////////
  52. STDMETHOD(Initialize)();
  53. STDMETHOD(Shutdown)();
  54. STDMETHOD(PutProperty)(LONG Id, VARIANT *pValue);
  55. //////////
  56. // IAuditSink
  57. //////////
  58. STDMETHOD(AuditEvent)(ULONG ulEventID,
  59. ULONG ulNumStrings,
  60. ULONG ulDataSize,
  61. wchar_t** aszStrings,
  62. byte* pRawData);
  63. private:
  64. // NT event log.
  65. HANDLE eventLog;
  66. // Event types to be logged.
  67. BOOL shouldReport[4];
  68. };
  69. #endif // _NTEVENTLOG_H_