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.

86 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name :
  4. eventlog.hxx
  5. Abstract:
  6. This file defines functions and types required for
  7. logging events to the event logger.
  8. Author:
  9. Murali R. Krishnan ( MuraliK ) 27-Sept-1994
  10. Revision History:
  11. MuraliK 21-Nov-1994 Ported to common dll
  12. --*/
  13. # ifndef _EVENTLOG_HXX_
  14. # define _EVENTLOG_HXX_
  15. #include <windows.h>
  16. #include <irtlmisc.h>
  17. /***********************************************************
  18. * Type Definitions
  19. ************************************************************/
  20. /*********************************************
  21. * class EVENT_LOG
  22. *
  23. * Declares a event log object.
  24. * This object provides an interface for logging messages
  25. * to the System EventLog file globally for given program.
  26. *
  27. ************************************************/
  28. class IRTL_DLLEXP EVENT_LOG {
  29. private:
  30. DWORD m_ErrorCode; // error code for last operation
  31. HANDLE m_hEventSource; // handle for reporting events
  32. public:
  33. EVENT_LOG( IN LPCWSTR lpszSourceName); // name of source for event log
  34. ~EVENT_LOG( VOID);
  35. VOID
  36. LogEvent(
  37. IN DWORD idMessage, // id for log message
  38. IN WORD cSubStrings, // count of substrings
  39. IN const WCHAR * apszSubStrings[], // substrings in the message
  40. IN DWORD errCode = 0); // error code if any
  41. BOOL Success( VOID) const
  42. { return ( m_ErrorCode == NO_ERROR); }
  43. DWORD GetErrorCode( VOID) const
  44. { return ( m_ErrorCode); }
  45. private:
  46. VOID
  47. LogEventPrivate(
  48. IN DWORD idMessage,
  49. IN WORD wEventType,
  50. IN WORD cSubStrings,
  51. IN const WCHAR * apszSubStrings[],
  52. IN DWORD errCode);
  53. };
  54. typedef EVENT_LOG * LPEVENT_LOG;
  55. # endif // _EVENTLOG_HXX_