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.

274 lines
4.2 KiB

  1. /*-- BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. wmi.h
  5. Abstract:
  6. This module contains the public data structures and procedure
  7. prototypes for the WMI subsystem.
  8. Author:
  9. Jee Fung Pang (JeePang) 01-Jan-2000
  10. Revision History:
  11. --*/
  12. #ifndef _WMI_
  13. #define _WMI_
  14. #ifndef _WMIKM_
  15. #define _WMIKM_
  16. #endif
  17. #ifndef RUN_WPP
  18. #define RUN_WPP
  19. #endif
  20. // begin_ntddk begin_wdm
  21. #ifdef RUN_WPP
  22. #include <evntrace.h>
  23. #include <stdarg.h>
  24. #endif // #ifdef RUN_WPP
  25. // end_ntddk end_wdm
  26. #include <wmistr.h>
  27. #include <ntwmi.h>
  28. typedef
  29. __int64
  30. (*WMI_GET_CPUCLOCK_ROUTINE) (
  31. VOID
  32. );
  33. extern WMI_GET_CPUCLOCK_ROUTINE WmiGetCpuClock;
  34. extern ULONG WmiUsePerfClock;
  35. typedef
  36. VOID
  37. (*WMI_TRACE_BUFFER_CALLBACK) (
  38. IN PWMI_BUFFER_HEADER Buffer,
  39. IN PVOID Context
  40. );
  41. // begin_wmikm
  42. typedef enum tagWMI_CLOCK_TYPE {
  43. WMICT_DEFAULT,
  44. WMICT_SYSTEMTIME,
  45. WMICT_PERFCOUNTER,
  46. WMICT_PROCESS,
  47. WMICT_THREAD,
  48. WMICT_CPUCYCLE
  49. } WMI_CLOCK_TYPE;
  50. //
  51. // Trace Control APIs
  52. //
  53. NTKERNELAPI
  54. NTSTATUS
  55. WmiStartTrace(
  56. IN OUT PWMI_LOGGER_INFORMATION LoggerInfo
  57. );
  58. NTKERNELAPI
  59. NTSTATUS
  60. WmiQueryTrace(
  61. IN OUT PWMI_LOGGER_INFORMATION LoggerInfo
  62. );
  63. NTKERNELAPI
  64. NTSTATUS
  65. WmiStopTrace(
  66. IN PWMI_LOGGER_INFORMATION LoggerInfo
  67. );
  68. NTKERNELAPI
  69. NTSTATUS
  70. WmiUpdateTrace(
  71. IN OUT PWMI_LOGGER_INFORMATION LoggerInfo
  72. );
  73. NTKERNELAPI
  74. NTSTATUS
  75. WmiFlushTrace(
  76. IN OUT PWMI_LOGGER_INFORMATION LoggerInfo
  77. );
  78. //
  79. // Trace Provider APIs
  80. //
  81. NTKERNELAPI
  82. NTSTATUS
  83. FASTCALL
  84. WmiTraceEvent(
  85. IN PWNODE_HEADER Wnode,
  86. IN KPROCESSOR_MODE RequestorMode
  87. );
  88. NTKERNELAPI
  89. NTSTATUS
  90. FASTCALL
  91. WmiTraceFastEvent(
  92. IN PWNODE_HEADER Wnode
  93. );
  94. NTKERNELAPI
  95. LONG64
  96. FASTCALL
  97. WmiGetClock(
  98. IN WMI_CLOCK_TYPE ClockType,
  99. IN PVOID Context
  100. );
  101. NTKERNELAPI
  102. NTSTATUS
  103. FASTCALL
  104. WmiGetClockType(
  105. IN TRACEHANDLE LoggerHandle,
  106. OUT WMI_CLOCK_TYPE *ClockType
  107. );
  108. // begin_ntddk begin_wdm
  109. #ifdef RUN_WPP
  110. NTKERNELAPI
  111. NTSTATUS
  112. WmiTraceMessage(
  113. IN TRACEHANDLE LoggerHandle,
  114. IN ULONG MessageFlags,
  115. IN LPGUID MessageGuid,
  116. IN USHORT MessageNumber,
  117. IN ...
  118. );
  119. NTKERNELAPI
  120. NTSTATUS
  121. WmiTraceMessageVa(
  122. IN TRACEHANDLE LoggerHandle,
  123. IN ULONG MessageFlags,
  124. IN LPGUID MessageGuid,
  125. IN USHORT MessageNumber,
  126. IN va_list MessageArgList
  127. );
  128. #endif // #ifdef RUN_WPP
  129. #ifndef TRACE_INFORMATION_CLASS_DEFINE
  130. typedef enum _TRACE_INFORMATION_CLASS {
  131. TraceIdClass,
  132. TraceHandleClass,
  133. TraceEnableFlagsClass,
  134. TraceEnableLevelClass,
  135. GlobalLoggerHandleClass,
  136. EventLoggerHandleClass,
  137. AllLoggerHandlesClass,
  138. TraceHandleByNameClass
  139. } TRACE_INFORMATION_CLASS;
  140. NTKERNELAPI
  141. NTSTATUS
  142. WmiQueryTraceInformation(
  143. IN TRACE_INFORMATION_CLASS TraceInformationClass,
  144. OUT PVOID TraceInformation,
  145. IN ULONG TraceInformationLength,
  146. OUT PULONG RequiredLength OPTIONAL,
  147. IN PVOID Buffer OPTIONAL
  148. );
  149. #define TRACE_INFORMATION_CLASS_DEFINE
  150. #endif // TRACE_INFOPRMATION_CLASS_DEFINE
  151. // end_ntddk end_wdm end_wmikm
  152. NTKERNELAPI
  153. NTSTATUS
  154. WmiSetTraceBufferCallback(
  155. IN TRACEHANDLE TraceHandle,
  156. IN WMI_TRACE_BUFFER_CALLBACK Callback,
  157. IN PVOID Context
  158. );
  159. NTKERNELAPI
  160. NTSTATUS
  161. WmiTraceKernelEvent(
  162. IN ULONG GroupType,
  163. IN PVOID EventInfo,
  164. IN ULONG EventInfoLen,
  165. IN PETHREAD Thread
  166. );
  167. NTKERNELAPI
  168. PPERFINFO_TRACE_HEADER
  169. FASTCALL
  170. WmiReserveWithPerfHeader(
  171. IN ULONG AuxSize,
  172. OUT PWMI_BUFFER_HEADER *BufferResource
  173. );
  174. NTKERNELAPI
  175. ULONG
  176. FASTCALL
  177. WmiReleaseKernelBuffer(
  178. IN PWMI_BUFFER_HEADER BufferResource
  179. );
  180. NTKERNELAPI
  181. VOID
  182. FASTCALL
  183. WmiTraceProcess(
  184. IN PEPROCESS Process,
  185. IN BOOLEAN Create
  186. );
  187. NTKERNELAPI
  188. VOID
  189. WmiTraceThread(
  190. IN PETHREAD Thread,
  191. IN PINITIAL_TEB InitialTeb OPTIONAL,
  192. IN BOOLEAN Create
  193. );
  194. NTKERNELAPI
  195. NTSTATUS
  196. WmiSetMark(
  197. IN PWMI_SET_MARK_INFORMATION MarkInfo,
  198. IN ULONG InBufferLen
  199. );
  200. NTKERNELAPI
  201. VOID
  202. WmiBootPhase1(
  203. VOID
  204. );
  205. //
  206. // Context swap routines
  207. //
  208. VOID
  209. FASTCALL
  210. WmiTraceContextSwap (
  211. IN PETHREAD pOldEThread,
  212. IN PETHREAD pNewEThread
  213. );
  214. VOID
  215. FASTCALL
  216. WmiStartContextSwapTrace
  217. (
  218. );
  219. VOID
  220. FASTCALL
  221. WmiStopContextSwapTrace
  222. (
  223. );
  224. #endif // _WMI_