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.

85 lines
2.1 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 "datetime.hxx" // for Win95 object
  17. # include "irtlmisc.h"
  18. /***********************************************************
  19. * Type Definitions
  20. ************************************************************/
  21. /*********************************************
  22. * class EVENT_LOG
  23. *
  24. * Declares a event log object.
  25. * This object provides an interface for logging messages
  26. * to the System EventLog file globally for given program.
  27. *
  28. ************************************************/
  29. class IRTL_DLLEXP EVENT_LOG {
  30. private:
  31. DWORD m_ErrorCode; // error code for last operation
  32. HANDLE m_hEventSource; // handle for reporting events
  33. public:
  34. EVENT_LOG( IN LPCTSTR lpszSourceName); // name of source for event log
  35. ~EVENT_LOG( VOID);
  36. VOID
  37. LogEvent(
  38. IN DWORD idMessage, // id for log message
  39. IN WORD cSubStrings, // count of substrings
  40. IN const CHAR * apszSubStrings[], // substrings in the message
  41. IN DWORD errCode = 0); // error code if any
  42. BOOL Success( VOID) const
  43. { return ( m_ErrorCode == NO_ERROR); }
  44. DWORD GetErrorCode( VOID) const
  45. { return ( m_ErrorCode); }
  46. private:
  47. VOID
  48. LogEventPrivate(
  49. IN DWORD idMessage,
  50. IN WORD wEventType,
  51. IN WORD cSubStrings,
  52. IN const CHAR * apszSubStrings[],
  53. IN DWORD errCode);
  54. };
  55. typedef EVENT_LOG * LPEVENT_LOG;
  56. # endif // _EVENTLOG_HXX_