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.

187 lines
4.5 KiB

  1. /*++
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. Module Name:
  4. traceprt.h
  5. Abstract:
  6. Trace formatting external definitions.
  7. Revision History:
  8. --*/
  9. #ifdef __cplusplus
  10. extern "C"{
  11. #endif
  12. #ifndef _TRACEPRT_
  13. #define _TRACEPRT_
  14. #define MAXLOGFILES 16
  15. #define MAXSTR 1024
  16. #define GUID_FILE _T("default")
  17. #define GUID_EXT _T("tmf")
  18. //
  19. // Now the routines we export
  20. //
  21. #ifndef TRACE_API
  22. #ifdef TRACE_EXPORTS
  23. #define TRACE_API __declspec(dllexport)
  24. #else
  25. #define TRACE_API __declspec(dllimport)
  26. #endif
  27. #endif
  28. #ifdef UNICODE
  29. #define FormatTraceEvent FormatTraceEventW
  30. #define GetTraceGuids GetTraceGuidsW
  31. #define SummaryTraceEventList SummaryTraceEventListW
  32. #else
  33. #define FormatTraceEvent FormatTraceEventA
  34. #define GetTraceGuids GetTraceGuidsA
  35. #define SummaryTraceEventList SummaryTraceEventListA
  36. #endif
  37. TRACE_API
  38. HRESULT
  39. InitializeCSharpDecoder();
  40. TRACE_API
  41. void
  42. UninitializeCSharpDecoder();
  43. TRACE_API SIZE_T
  44. WINAPI
  45. FormatTraceEventA(
  46. PLIST_ENTRY HeadEventList,
  47. PEVENT_TRACE pEvent,
  48. CHAR * EventBuf,
  49. ULONG SizeEventBuf,
  50. CHAR * pszMask
  51. );
  52. TRACE_API ULONG
  53. WINAPI
  54. GetTraceGuidsA(
  55. CHAR * GuidFile,
  56. PLIST_ENTRY * EventListHeader
  57. );
  58. TRACE_API void
  59. WINAPI
  60. SummaryTraceEventListA(
  61. CHAR * SummaryBlock ,
  62. ULONG SizeSummaryBlock ,
  63. PLIST_ENTRY EventListhead
  64. );
  65. TRACE_API SIZE_T
  66. WINAPI
  67. FormatTraceEventW(
  68. PLIST_ENTRY HeadEventList,
  69. PEVENT_TRACE pEvent,
  70. TCHAR * EventBuf,
  71. ULONG SizeEventBuf,
  72. TCHAR * pszMask
  73. );
  74. TRACE_API ULONG
  75. WINAPI
  76. GetTraceGuidsW(
  77. LPTSTR GuidFile,
  78. PLIST_ENTRY * EventListHeader
  79. );
  80. TRACE_API void
  81. WINAPI
  82. SummaryTraceEventListW(
  83. TCHAR * SummaryBlock,
  84. ULONG SizeSummaryBlock,
  85. PLIST_ENTRY EventListhead
  86. );
  87. TRACE_API void
  88. WINAPI
  89. CleanupTraceEventList(
  90. PLIST_ENTRY EventListHead
  91. );
  92. TRACE_API void
  93. WINAPI
  94. GetTraceElapseTime(
  95. __int64 * pElpaseTime
  96. );
  97. #define TRACEPRT_INTERFACE_VERSION 1
  98. typedef enum _PARAM_TYPE
  99. {
  100. ParameterINDENT,
  101. ParameterSEQUENCE,
  102. ParameterGMT,
  103. ParameterTraceFormatSearchPath,
  104. ParameterInterfaceVersion,
  105. ParameterUsePrefix,
  106. ParameterSetPrefix,
  107. ParameterStructuredFormat,
  108. ParameterDebugPrint
  109. } PARAMETER_TYPE ;
  110. TRACE_API ULONG
  111. WINAPI
  112. SetTraceFormatParameter(
  113. PARAMETER_TYPE Parameter ,
  114. PVOID ParameterValue
  115. );
  116. TRACE_API ULONG
  117. WINAPI
  118. GetTraceFormatParameter(
  119. PARAMETER_TYPE Parameter ,
  120. PVOID ParameterValue
  121. );
  122. TRACE_API LPTSTR
  123. WINAPI
  124. GetTraceFormatSearchPath(void);
  125. #define NAMESIZE 256
  126. #define STRUCTUREDMESSAGEVERSION 0
  127. typedef struct _STRUCTUREDMESSAGE {
  128. ULONG Version ; // Structure Version Number
  129. GUID TraceGuid ; // Message Guid
  130. ULONG GuidName ; // %1 Guid Friendly Name Offset
  131. ULONG GuidTypeName ; // %2 Guid Type Name Offset
  132. ULONG ThreadId ; // %3 Thread ID Value
  133. SYSTEMTIME SystemTime ; // %4 System Time Value
  134. ULONG UserTime ; // %5 Kernel Time Value
  135. ULONG KernelTime ; // %6 User Time Value
  136. ULONG SequenceNum ; // %7 Sequence Number Value
  137. ULONG ProcessId ; // %8 Process ID Value
  138. ULONG CpuNumber ; // %9 CPU Number Value
  139. ULONG Indent ; // Indentation level Value
  140. ULONG FlagsName ; // Trace Flag settings Name Offset
  141. ULONG LevelName ; // Trace Level Name Offset
  142. ULONG FunctionName ; // Function Name Offset
  143. ULONG ComponentName ; // Component Name Offset
  144. ULONG SubComponentName ; // Sub Component Name Offset
  145. ULONG FormattedString ; // Formatted String Offset
  146. // Version 0 values before this comment, all new values after this point.
  147. } STRUCTUREDMESSAGE, *PSTRUCTUREDMESSAGE ;
  148. #define TRACEPRINT(a,b) {PVOID lTracePrint ; if(!((lTracePrint = TracePrint) != NULL)) { *(lTracePrint) b } };
  149. #endif // #ifndef _TRACEPRT_
  150. #ifdef __cplusplus
  151. }
  152. #endif