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.

175 lines
2.6 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 2000
  3. Module Name:
  4. Log
  5. Abstract:
  6. This module implements the logging capabilities of SCTest.
  7. Author:
  8. Eric Perlin (ericperl) 06/07/2000
  9. Environment:
  10. Win32
  11. Notes:
  12. ?Notes?
  13. --*/
  14. #ifndef _Log_H_DEF_
  15. #define _Log_H_DEF_
  16. #ifndef WIN32_LEAN_AND_MEAN
  17. #define WIN32_LEAN_AND_MEAN
  18. #endif
  19. #include <wchar.h>
  20. #include <tchar.h>
  21. #include <stdio.h>
  22. #ifndef _LPCBYTE_DEFINED
  23. #define _LPCBYTE_DEFINED
  24. typedef const BYTE *LPCBYTE;
  25. #endif
  26. #define LOGBUFFERSIZE 4096
  27. typedef struct {
  28. TCHAR *szLogCrt; // Current pointer in the buffer
  29. TCHAR szLogBuffer[LOGBUFFERSIZE]; // Buffering of the log
  30. } LOGCONTEXT, *PLOGCONTEXT;
  31. void LogInit(
  32. IN LPCTSTR szLogName,
  33. IN BOOL fVerbose
  34. );
  35. void LogClose(
  36. );
  37. void LogLock(
  38. );
  39. void LogUnlock(
  40. );
  41. PLOGCONTEXT LogStart(
  42. );
  43. void LogStop(
  44. IN PLOGCONTEXT pLogCtx,
  45. IN BOOL fExpected = TRUE
  46. );
  47. void LogString2FP(
  48. IN FILE *fp,
  49. IN LPCSTR szMsg
  50. );
  51. void LogString2FP(
  52. IN FILE *fp,
  53. IN LPCWSTR szMsg
  54. );
  55. void LogThisOnly(
  56. IN LPCSTR szMsg,
  57. IN BOOL fExpected = TRUE
  58. );
  59. void LogThisOnly(
  60. IN LPCWSTR szMsg,
  61. IN BOOL fExpected = TRUE
  62. );
  63. PLOGCONTEXT LogStart(
  64. IN LPCTSTR szFunctionName,
  65. IN DWORD dwGLE,
  66. IN DWORD dwExpected,
  67. IN LPSYSTEMTIME pxStartST,
  68. IN LPSYSTEMTIME pxEndST
  69. );
  70. PLOGCONTEXT LogVerification(
  71. IN LPCTSTR szFunctionName,
  72. IN BOOL fSucceeded
  73. );
  74. void LogNiceError(
  75. IN PLOGCONTEXT pLogCtx,
  76. IN DWORD dwRet,
  77. IN LPCTSTR szHeader = NULL
  78. );
  79. void LogString(
  80. IN PLOGCONTEXT pLogCtx,
  81. IN LPCSTR szS
  82. );
  83. void LogString(
  84. IN PLOGCONTEXT pLogCtx,
  85. IN LPCWSTR szS
  86. );
  87. void LogString(
  88. IN PLOGCONTEXT pLogCtx,
  89. IN LPCSTR szHeader,
  90. IN LPCSTR szS
  91. );
  92. void LogString(
  93. IN PLOGCONTEXT pLogCtx,
  94. IN LPCWSTR szHeader,
  95. IN LPCWSTR szS
  96. );
  97. void LogMultiString(
  98. IN PLOGCONTEXT pLogCtx,
  99. IN LPCSTR szMS,
  100. IN LPCSTR szHeader = NULL
  101. );
  102. void LogMultiString(
  103. IN PLOGCONTEXT pLogCtx,
  104. IN LPCWSTR szMS,
  105. IN LPCWSTR szHeader = NULL
  106. );
  107. void LogBinaryData(
  108. IN PLOGCONTEXT pLogCtx,
  109. IN LPCBYTE rgData,
  110. IN DWORD dwSize,
  111. IN LPCTSTR szHeader = NULL
  112. );
  113. void LogDWORD(
  114. IN PLOGCONTEXT pLogCtx,
  115. IN DWORD dwDW,
  116. IN LPCTSTR szHeader = NULL
  117. );
  118. void LogPtr(
  119. IN PLOGCONTEXT pLogCtx,
  120. IN LPCVOID lpv,
  121. IN LPCTSTR szHeader
  122. );
  123. void LogDecimal(
  124. IN PLOGCONTEXT pLogCtx,
  125. IN DWORD dwDW,
  126. IN LPCTSTR szHeader = NULL
  127. );
  128. void LogResetCounters(
  129. );
  130. DWORD LogGetErrorCounter(
  131. );
  132. #endif // _Log_H_DEF_