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.

106 lines
2.5 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. eventlog.h
  5. Abstract:
  6. This file defines functions and types required for logging events to the event logger.
  7. Author:
  8. Vlad Sadovsky (vlads) 10-Jan-1997
  9. Environment:
  10. User Mode - Win32
  11. Revision History:
  12. 26-Jan-1997 VladS created
  13. --*/
  14. # ifndef _EVENTLOG_H_
  15. # define _EVENTLOG_H_
  16. # include <windows.h>
  17. /***********************************************************
  18. * Type Definitions
  19. ************************************************************/
  20. class EVENT_LOG {
  21. private:
  22. DWORD m_ErrorCode; // error code for last operation
  23. HANDLE m_hEventSource; // handle for reporting events
  24. LPCTSTR m_lpszSource; // source name for event log
  25. public:
  26. dllexp
  27. EVENT_LOG( IN LPCTSTR lpszSourceName); // name of source for event log
  28. dllexp
  29. ~EVENT_LOG( VOID);
  30. dllexp
  31. VOID
  32. LogEvent(
  33. IN DWORD idMessage, // id for log message
  34. IN WORD cSubStrings, // count of substrings
  35. IN const CHAR * apszSubStrings[], // substrings in the message
  36. IN DWORD errCode = 0); // error code if any
  37. VOID
  38. LogEvent(
  39. IN DWORD idMessage, // id for log message
  40. IN WORD cSubStrings, // count of substrings
  41. IN CHAR * apszSubStrings[], // substrings in the message
  42. IN DWORD errCode = 0) // error code if any
  43. {
  44. LogEvent(idMessage, cSubStrings,
  45. (const CHAR **) apszSubStrings, errCode);
  46. }
  47. dllexp
  48. VOID
  49. LogEvent(
  50. IN DWORD idMessage, // id for log message
  51. IN WORD cSubStrings, // count of substrings
  52. IN WCHAR * apszSubStrings[], // substrings in the message
  53. IN DWORD errCode = 0); // error code if any
  54. BOOL Success( VOID) const
  55. { return ( m_ErrorCode == NO_ERROR); }
  56. DWORD GetErrorCode( VOID) const
  57. { return ( m_ErrorCode); }
  58. private:
  59. dllexp VOID
  60. LogEventPrivate(
  61. IN DWORD idMessage,
  62. IN WORD wEventType,
  63. IN WORD cSubStrings,
  64. IN const CHAR * apszSubStrings[],
  65. IN DWORD errCode);
  66. };
  67. typedef EVENT_LOG * LPEVENT_LOG;
  68. VOID
  69. WINAPI
  70. RegisterStiEventSources(VOID);
  71. # endif // _EVENTLOG_H_
  72. /************************ End of File ***********************/