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.

75 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 2000-2001 Microsoft Corporation
  3. Module Name:
  4. vststntlog.hxx
  5. Abstract:
  6. Wrapper class for the test team's ntlog suite of APIs and VolSnap test harness.
  7. Author:
  8. Stefan R. Steiner [ssteiner] 06-05-2000
  9. Revision History:
  10. --*/
  11. #ifndef __HXX_VSTSTNTLOG_
  12. #define __HXX_VSTSTNTLOG_
  13. #include "bsstring.hxx"
  14. #define VS_TST_DEFAULT_NTLOG_FILENAME L"vstestharness.log"
  15. enum EVsTstNtLogSeverityLevel
  16. {
  17. eSevLev_Info = 1,
  18. eSevLev_Pass = 2,
  19. eSevLev_Warning = 3,
  20. eSevLev_Severe = 4
  21. };
  22. class CVsTstNtLog
  23. {
  24. public:
  25. CVsTstNtLog(
  26. IN LPCWSTR pwszLogFileName = VS_TST_DEFAULT_NTLOG_FILENAME
  27. );
  28. virtual ~CVsTstNtLog();
  29. // Call this when another thread needs access to logging object
  30. VOID AddParticipant();
  31. // Call this when a thread is finished accessing the logging object
  32. VOID RemoveParticipant();
  33. // Call this when a thread wants to start a new variation
  34. VOID StartVariation(
  35. IN LPCWSTR pwszVariationName
  36. );
  37. // Call this when a thread is done with a variation
  38. DWORD EndVariation();
  39. // Call this to log a message to the nttest log.
  40. VOID Log(
  41. IN EVsTstNtLogSeverityLevel eSevLev,
  42. IN LPCWSTR pwszFormat,
  43. IN ... );
  44. private:
  45. HANDLE m_hNtLog; // Handle to the TE ntlog mechanism
  46. CBsString m_cwsNtLogFileName; // Name of the log file
  47. BOOL m_bInVariation; // TRUE if in a variation. Doesn't expect multiple threads
  48. // in same variation.
  49. CBsString m_cwsVariationName; // If in a variation, the name of the variation
  50. DWORD m_dwHighestLogLev; // Highest log level during run.
  51. };
  52. #endif // __HXX_VSTSTNTLOG_