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.

113 lines
2.6 KiB

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