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.

1401 lines
60 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ntwmi.h
  5. Abstract:
  6. definitions for WMI Flags and Event Id's
  7. Author:
  8. Stephen Hsiao
  9. Environment:
  10. Kernel and User modes
  11. Revision History:
  12. --*/
  13. #ifndef _NTWMI_
  14. #define _NTWMI_
  15. #ifndef ETW_WOW6432
  16. #include <evntrace.h>
  17. // Alignment macros
  18. #define DEFAULT_TRACE_ALIGNMENT 8 // 8 byte alignment
  19. #define ALIGN_TO_POWER2( x, n ) (((ULONG)(x) + ((n)-1)) & ~((ULONG)(n)-1))
  20. //
  21. // The predefined event groups or families for NT subsystems
  22. //
  23. #define EVENT_TRACE_GROUP_HEADER 0x0000
  24. #define EVENT_TRACE_GROUP_IO 0x0100
  25. #define EVENT_TRACE_GROUP_MEMORY 0x0200
  26. #define EVENT_TRACE_GROUP_PROCESS 0x0300
  27. #define EVENT_TRACE_GROUP_FILE 0x0400
  28. #define EVENT_TRACE_GROUP_THREAD 0x0500
  29. #define EVENT_TRACE_GROUP_TCPIP 0x0600
  30. #define EVENT_TRACE_GROUP_IPXSPX 0x0700
  31. #define EVENT_TRACE_GROUP_UDPIP 0x0800
  32. #define EVENT_TRACE_GROUP_REGISTRY 0x0900
  33. #define EVENT_TRACE_GROUP_DBGPRINT 0x0A00
  34. #define EVENT_TRACE_GROUP_CONFIG 0x0B00
  35. #define EVENT_TRACE_GROUP_POOL 0x0E00
  36. #define EVENT_TRACE_GROUP_PERFINFO 0x0F00
  37. #define EVENT_TRACE_GROUP_HEAP 0x1000
  38. #define EVENT_TRACE_GROUP_OBJECT 0x1100
  39. #define EVENT_TRACE_GROUP_POWER 0x1200
  40. #define EVENT_TRACE_GROUP_MODBOUND 0x1300
  41. #define EVENT_TRACE_GROUP_TBD 0x1400
  42. #define EVENT_TRACE_GROUP_DPC 0x1500
  43. #define EVENT_TRACE_GROUP_GDI 0x1600
  44. #define EVENT_TRACE_GROUP_CRITSEC 0x1700
  45. //
  46. // The highest order bit of a data block is set if trace, WNODE otherwise
  47. //
  48. #define TRACE_HEADER_FLAG 0x80000000
  49. // Header type for tracing messages
  50. // | Marker(8) | Reserved(8) | Size(16) | MessageNumber(16) | Flags(16)
  51. #define TRACE_MESSAGE 0x10000000
  52. // | MARKER(16) | SIZE (16) | ULONG32 |
  53. #define TRACE_HEADER_ULONG32 0xA0000000
  54. // | MARKER(16) | SIZE (16) | ULONG 32 | TIME_STAMP ...
  55. #define TRACE_HEADER_ULONG32_TIME 0xB0000000
  56. //
  57. // The second bit is set if the trace is used by PM & CP (fixed headers)
  58. // If not, the data block is used by for finer data for performance analysis
  59. //
  60. #define TRACE_HEADER_EVENT_TRACE 0x40000000
  61. //
  62. // If set, the data block is SYSTEM_TRACE_HEADER
  63. //
  64. #define TRACE_HEADER_ENUM_MASK 0x00FF0000
  65. //
  66. // The following are various header type
  67. //
  68. #define TRACE_HEADER_TYPE_SYSTEM32 1
  69. #define TRACE_HEADER_TYPE_SYSTEM64 2
  70. #define TRACE_HEADER_TYPE_FULL_HEADER 10
  71. #define TRACE_HEADER_TYPE_INSTANCE 11
  72. #define TRACE_HEADER_TYPE_TIMED 12
  73. #define TRACE_HEADER_TYPE_ULONG32 13
  74. #define TRACE_HEADER_TYPE_WNODE_HEADER 14
  75. #define TRACE_HEADER_TYPE_MESSAGE 15
  76. #define TRACE_HEADER_TYPE_PERFINFO32 16
  77. #define TRACE_HEADER_TYPE_PERFINFO64 17
  78. #define SYSTEM_TRACE_VERSION 1
  79. #ifdef _WIN64
  80. #define PERFINFO_TRACE_MARKER TRACE_HEADER_FLAG | TRACE_HEADER_EVENT_TRACE \
  81. | (TRACE_HEADER_TYPE_PERFINFO64 << 16) | SYSTEM_TRACE_VERSION
  82. #define SYSTEM_TRACE_MARKER TRACE_HEADER_FLAG | TRACE_HEADER_EVENT_TRACE \
  83. | (TRACE_HEADER_TYPE_SYSTEM64 << 16) | SYSTEM_TRACE_VERSION
  84. #else
  85. #define PERFINFO_TRACE_MARKER TRACE_HEADER_FLAG | TRACE_HEADER_EVENT_TRACE \
  86. | (TRACE_HEADER_TYPE_PERFINFO32 << 16) | SYSTEM_TRACE_VERSION
  87. #define SYSTEM_TRACE_MARKER TRACE_HEADER_FLAG | TRACE_HEADER_EVENT_TRACE \
  88. | (TRACE_HEADER_TYPE_SYSTEM32 << 16) | SYSTEM_TRACE_VERSION
  89. #endif
  90. //
  91. // Support a maximum of 64 logger instances. One is reserved for the kernel.
  92. #define MAXLOGGERS 64
  93. //
  94. // Set of Internal Flags passed to the Logger via ClientContext during StartTrace
  95. //
  96. #define EVENT_TRACE_CLOCK_RAW 0x00000000 // Use Raw timestamp
  97. #define EVENT_TRACE_CLOCK_PERFCOUNTER 0x00000001 // Use HighPerfClock (Default)
  98. #define EVENT_TRACE_CLOCK_SYSTEMTIME 0x00000002 // Use SystemTime
  99. #define EVENT_TRACE_CLOCK_CPUCYCLE 0x00000003 // Use CPU cycle counter
  100. // begin_wmikm
  101. //
  102. // Public routines to break down the Loggerhandle
  103. //
  104. #define KERNEL_LOGGER_ID 0xFFFF // USHORT only
  105. typedef struct _TRACE_ENABLE_CONTEXT {
  106. USHORT LoggerId; // Actual Id of the logger
  107. UCHAR Level; // Enable level passed by control caller
  108. UCHAR InternalFlag; // Reserved
  109. ULONG EnableFlags; // Enable flags passed by control caller
  110. } TRACE_ENABLE_CONTEXT, *PTRACE_ENABLE_CONTEXT;
  111. #define WmiGetLoggerId(LoggerContext) \
  112. (((PTRACE_ENABLE_CONTEXT) (&LoggerContext))->LoggerId == \
  113. (USHORT)KERNEL_LOGGER_ID) ? \
  114. KERNEL_LOGGER_ID : \
  115. ((PTRACE_ENABLE_CONTEXT) (&LoggerContext))->LoggerId
  116. #define WmiGetLoggerEnableFlags(LoggerContext) \
  117. ((PTRACE_ENABLE_CONTEXT) (&LoggerContext))->EnableFlags
  118. #define WmiGetLoggerEnableLevel(LoggerContext) \
  119. ((PTRACE_ENABLE_CONTEXT) (&LoggerContext))->Level
  120. #define WmiSetLoggerId(Id, Context) \
  121. (((PTRACE_ENABLE_CONTEXT)Context)->LoggerId = (Id ? \
  122. (USHORT)Id: (USHORT)KERNEL_LOGGER_ID));
  123. // end_wmikm
  124. //
  125. // NOTE: The following should not overlap with other bits in the LogFileMode
  126. // or LoggerMode defined in evntrace.h. Placed here since it is for internal
  127. // use only.
  128. //
  129. #define EVENT_TRACE_KD_FILTER_MODE 0x00080000 // KD_FILTER
  130. //
  131. // see evntrace.h for pre-defined generic event types (0-10)
  132. //
  133. typedef struct _WMI_TRACE_PACKET { // must be ULONG!!
  134. USHORT Size;
  135. union{
  136. USHORT HookId;
  137. struct {
  138. UCHAR Type;
  139. UCHAR Group;
  140. };
  141. };
  142. } WMI_TRACE_PACKET, *PWMI_TRACE_PACKET;
  143. typedef struct _WMI_CLIENT_CONTEXT {
  144. UCHAR ProcessorNumber;
  145. UCHAR Alignment;
  146. USHORT LoggerId;
  147. } WMI_CLIENT_CONTEXT, *PWMI_CLIENT_CONTEXT;
  148. typedef ULONGLONG PERFINFO_TIMESTAMP;
  149. typedef struct _PERFINFO_TRACE_HEADER PERFINFO_TRACE_ENTRY, *PPERFINFO_TRACE_ENTRY;
  150. //
  151. // 64-bit Trace header for NTPERF events
  152. //
  153. // Note. The field "Version" will temporary be used to log CPU Id when log to PerfMem.
  154. // This will be removed after we change the buffer management to be the same as WMI.
  155. // i.e., Each CPU will allocate a block of memory for logging and CPU id is in the header
  156. // of each block.
  157. //
  158. typedef struct _PERFINFO_TRACE_HEADER {
  159. union {
  160. ULONG Marker;
  161. struct {
  162. USHORT Version;
  163. UCHAR HeaderType;
  164. UCHAR Flags; //WMI uses this flag to identify event types
  165. };
  166. };
  167. union {
  168. ULONG Header; // both sizes must be the same!
  169. WMI_TRACE_PACKET Packet;
  170. };
  171. union {
  172. PERFINFO_TIMESTAMP TS;
  173. LARGE_INTEGER SystemTime;
  174. };
  175. UCHAR Data[1];
  176. } PERFINFO_TRACE_HEADER, *PPERFINFO_TRACE_HEADER;
  177. //
  178. // 64-bit Trace header for kernel events
  179. //
  180. typedef struct _SYSTEM_TRACE_HEADER {
  181. union {
  182. ULONG Marker;
  183. struct {
  184. USHORT Version;
  185. UCHAR HeaderType;
  186. UCHAR Flags;
  187. };
  188. };
  189. union {
  190. ULONG Header; // both sizes must be the same!
  191. WMI_TRACE_PACKET Packet;
  192. };
  193. ULONG ThreadId;
  194. ULONG ProcessId;
  195. LARGE_INTEGER SystemTime;
  196. ULONG KernelTime;
  197. ULONG UserTime;
  198. } SYSTEM_TRACE_HEADER, *PSYSTEM_TRACE_HEADER;
  199. //
  200. // 64-bit Trace Header for Tracing Messages
  201. //
  202. typedef struct _WMI_TRACE_MESSAGE_PACKET { // must be ULONG!!
  203. USHORT MessageNumber; // The message Number, index of messages by GUID
  204. // Or ComponentID
  205. USHORT OptionFlags ; // Flags associated with the message
  206. } WMI_TRACE_MESSAGE_PACKET, *PWMI_TRACE_MESSAGE_PACKET;
  207. typedef struct _MESSAGE_TRACE_HEADER {
  208. union {
  209. ULONG Marker;
  210. struct {
  211. USHORT Size; // Total Size of the message including header
  212. UCHAR Reserved; // Unused and reserved
  213. UCHAR Version; // The message structure type (TRACE_MESSAGE_FLAG)
  214. };
  215. };
  216. union {
  217. ULONG Header; // both sizes must be the same!
  218. WMI_TRACE_MESSAGE_PACKET Packet;
  219. };
  220. } MESSAGE_TRACE_HEADER, *PMESSAGE_TRACE_HEADER;
  221. typedef struct _MESSAGE_TRACE {
  222. MESSAGE_TRACE_HEADER MessageHeader ;
  223. UCHAR Data ;
  224. } MESSAGE_TRACE, *PMESSAGE_TRACE ;
  225. //
  226. // Structure used to pass user log messages to the kernel
  227. //
  228. typedef struct _MESSAGE_TRACE_USER {
  229. MESSAGE_TRACE_HEADER MessageHeader ;
  230. ULONG MessageFlags ;
  231. ULONG64 LoggerHandle ;
  232. GUID MessageGuid ;
  233. ULONG DataSize ;
  234. UCHAR Data ;
  235. } MESSAGE_TRACE_USER, *PMESSAGE_TRACE_USER ;
  236. #ifndef MEMPHIS
  237. //
  238. // Logger configuration and running statistics. This structure is used
  239. // by WMI.DLL to convert to UNICODE_STRING
  240. //
  241. // begin_wmikm
  242. typedef struct _WMI_LOGGER_INFORMATION {
  243. WNODE_HEADER Wnode; // Had to do this since wmium.h comes later
  244. //
  245. // data provider by caller
  246. ULONG BufferSize; // buffer size for logging (in kbytes)
  247. ULONG MinimumBuffers; // minimum to preallocate
  248. ULONG MaximumBuffers; // maximum buffers allowed
  249. ULONG MaximumFileSize; // maximum logfile size (in MBytes)
  250. ULONG LogFileMode; // sequential, circular
  251. ULONG FlushTimer; // buffer flush timer, in seconds
  252. ULONG EnableFlags; // trace enable flags
  253. LONG AgeLimit; // aging decay time, in minutes
  254. union {
  255. HANDLE LogFileHandle; // handle to logfile
  256. ULONG64 LogFileHandle64;
  257. };
  258. // data returned to caller
  259. // end_wmikm
  260. union {
  261. // begin_wmikm
  262. ULONG NumberOfBuffers; // no of buffers in use
  263. // end_wmikm
  264. ULONG InstanceCount; // Number of Provider Instances
  265. };
  266. union {
  267. // begin_wmikm
  268. ULONG FreeBuffers; // no of buffers free
  269. // end_wmikm
  270. ULONG InstanceId; // Current Provider's Id for UmLogger
  271. };
  272. union {
  273. // begin_wmikm
  274. ULONG EventsLost; // event records lost
  275. // end_wmikm
  276. ULONG NumberOfProcessors; // Passed on to UmLogger
  277. };
  278. // begin_wmikm
  279. ULONG BuffersWritten; // no of buffers written to file
  280. ULONG LogBuffersLost; // no of logfile write failures
  281. ULONG RealTimeBuffersLost; // no of rt delivery failures
  282. union {
  283. HANDLE LoggerThreadId; // thread id of Logger
  284. ULONG64 LoggerThreadId64; // thread is of Logger
  285. };
  286. union {
  287. UNICODE_STRING LogFileName; // used only in WIN64
  288. UNICODE_STRING64 LogFileName64; // Logfile name: only in WIN32
  289. };
  290. // mandatory data provided by caller
  291. union {
  292. UNICODE_STRING LoggerName; // Logger instance name in WIN64
  293. UNICODE_STRING64 LoggerName64; // Logger Instance name in WIN32
  294. };
  295. // private
  296. union {
  297. PVOID Checksum;
  298. ULONG64 Checksum64;
  299. };
  300. union {
  301. PVOID LoggerExtension;
  302. ULONG64 LoggerExtension64;
  303. };
  304. } WMI_LOGGER_INFORMATION, *PWMI_LOGGER_INFORMATION;
  305. //
  306. // structure for NTDLL tracing
  307. //
  308. typedef struct
  309. {
  310. BOOLEAN IsGet;
  311. PWMI_LOGGER_INFORMATION LoggerInfo;
  312. } WMINTDLLLOGGERINFO, *PWMINTDLLLOGGERINFO;
  313. typedef struct _TIMED_TRACE_HEADER {
  314. USHORT Size;
  315. USHORT Marker;
  316. ULONG32 EventId;
  317. union {
  318. LARGE_INTEGER TimeStamp;
  319. ULONG64 LoggerId;
  320. };
  321. } TIMED_TRACE_HEADER, *PTIMED_TRACE_HEADER;
  322. // end_wmikm
  323. // the circular buffer pool, using forward linked list
  324. #endif //!MEMPHIS
  325. #define WMI_NON_BLOCKING
  326. #ifdef WMI_NON_BLOCKING
  327. typedef struct _WMI_BUFFER_STATE {
  328. ULONG Free:1;
  329. ULONG InUse:1;
  330. ULONG Flush:1;
  331. ULONG Unused:29;
  332. } WMI_BUFFER_STATE, *PWMI_BUFFER_STATE;
  333. #endif //WMI_NON_BLOCKING
  334. #define WNODE_FLAG_THREAD_BUFFER 0x00800000
  335. typedef struct _WMI_BUFFER_HEADER {
  336. union {
  337. WNODE_HEADER Wnode;
  338. struct {
  339. ULONG64 Reserved1;
  340. ULONG64 Reserved2;
  341. LARGE_INTEGER Reserved3;
  342. #ifdef WMI_NON_BLOCKING
  343. union{
  344. struct {
  345. PVOID Alignment;
  346. SINGLE_LIST_ENTRY SlistEntry;
  347. };
  348. LIST_ENTRY Entry;
  349. };
  350. #else
  351. LIST_ENTRY Entry;
  352. #endif //WMI_NON_BLOCKING
  353. };
  354. struct {
  355. LONG ReferenceCount; // Buffer reference count
  356. ULONG SavedOffset; // Temp saved offset
  357. ULONG CurrentOffset; // Current offset
  358. ULONG UsePerfClock; // UsePerfClock flag
  359. LARGE_INTEGER TimeStamp;
  360. GUID Guid;
  361. WMI_CLIENT_CONTEXT ClientContext;
  362. #ifdef WMI_NON_BLOCKING
  363. union {
  364. WMI_BUFFER_STATE State;
  365. ULONG Flags;
  366. };
  367. #else
  368. ULONG Flags;
  369. #endif //WMI_NON_BLOCKING
  370. };
  371. };
  372. ULONG Offset;
  373. ULONG EventsLost;
  374. union {
  375. GUID InstanceGuid;
  376. struct {
  377. PVOID LoggerContext;
  378. #ifdef WMI_NON_BLOCKING
  379. SINGLE_LIST_ENTRY GlobalEntry;
  380. #endif //WMI_NON_BLOCKING
  381. };
  382. };
  383. } WMI_BUFFER_HEADER, *PWMI_BUFFER_HEADER;
  384. typedef struct _TRACE_ENABLE_FLAG_EXTENSION {
  385. USHORT Offset; // Offset to the flag array in structure
  386. UCHAR Length; // Length of flag array in ULONGs
  387. UCHAR Flag; // Must be set to EVENT_TRACE_FLAG_EXTENSION
  388. } TRACE_ENABLE_FLAG_EXTENSION, *PTRACE_ENABLE_FLAG_EXTENSION;
  389. typedef struct _WMI_SET_MARK_INFORMATION {
  390. ULONG Flag;
  391. WCHAR Mark[1];
  392. } WMI_SET_MARK_INFORMATION, *PWMI_SET_MARK_INFORMATION;
  393. #define WMI_SET_MARK_WITH_FLUSH 0x00000001
  394. #ifdef NTPERF
  395. typedef struct _WMI_SWITCH_PERFMEM_BUFFER_INFORMATION {
  396. PWMI_BUFFER_HEADER Buffer;
  397. ULONG ProcessorId;
  398. } WMI_SWITCH_PERFMEM_BUFFER_INFORMATION, *PWMI_SWITCH_PERFMEM_BUFFER_INFORMATION;
  399. #endif //NTPERF
  400. // Public Enable flags are defined in envtrace.h.
  401. //
  402. // This section contains extended enable flags whcih are private.
  403. //
  404. // Each PerfMacros Hook Contains a GlobalMask and a Hook Id.
  405. // The Global Mask is Used For Grouping Hooks by logical type
  406. // - I/O related Hooks are Grouped together under
  407. // PERF_FILE_IO or PERF_DISK_IO
  408. // - Loader related Hooks are grouped together
  409. // under PERF_LOADER,
  410. // - etc
  411. // The data for a particular hook will only be logged
  412. // if the Global Mask of the particular Hook is set.
  413. //
  414. // WHEN YOU ADD NEW GROUPS, UPDATE THE NAME TABLE in perfgroups.c:
  415. // PerfGroupNames Note: If you modify numeric value of a group, update
  416. // PerfKnownFlags table
  417. //
  418. // we have a set of 8 global masks available. the highest 3 bits in
  419. // PERF_MASK_INDEX region determine to which set a particular
  420. // global group belongs. if PERF_MASK_INDEX is 0xe0000000
  421. // all of the following can be unique groups that can be
  422. // turned on or of individually and used when logging data:
  423. //
  424. // #define PERF_GROUP1 0x00400000 in the 0th set
  425. // #define PERF_GROUP2 0x20400000 in the 1st set
  426. // #define PERF_GROUP3 0x40400000 in the 2nd set
  427. // ...
  428. // #define PERF_GROUP2 0xe0400000 in the 7th set
  429. //
  430. // See ntperf.h for the manupulation of flags
  431. //
  432. //
  433. // Currently, no GlobalMask change is supported.
  434. //
  435. // Merging logging with WMI, we will use the first global mask for flags used
  436. // by both PERF and WMI
  437. //
  438. // GlobalMask 0: ALL masks used in WMI defined in evntrace.h.
  439. // These PERF_xxx are going away after we merge with WMI completely.
  440. //
  441. #define PERF_REGISTRY EVENT_TRACE_FLAG_REGISTRY
  442. #define PERF_FILE_IO EVENT_TRACE_FLAG_MEMORY_HARD_FAULTS
  443. #define PERF_PROC_THREAD EVENT_TRACE_FLAG_PROCESS | EVENT_TRACE_FLAG_THREAD
  444. #define PERF_DISK_IO EVENT_TRACE_FLAG_DISK_FILE_IO | EVENT_TRACE_FLAG_DISK_IO
  445. #define PERF_LOADER EVENT_TRACE_FLAG_IMAGE_LOAD
  446. #define PERF_ALL_FAULTS EVENT_TRACE_FLAG_MEMORY_PAGE_FAULTS
  447. #define PERF_FILENAME EVENT_TRACE_FLAG_DISK_FILE_IO
  448. #define PERF_NETWORK EVENT_TRACE_FLAG_NETWORK_TCPIP
  449. //
  450. // GlobalMask 1: The candidates to be checked into retails
  451. //
  452. #define PERF_MEMORY 0x20000001 // High level WS manager activities, PFN changes
  453. #define PERF_PROFILE 0x20000002 // Sysprof
  454. #define PERF_CONTEXT_SWITCH 0x20000004 // Context Switch
  455. #define PERF_FOOTPRINT 0x20000008 // Flush WS on every mark_with_flush
  456. #define PERF_DRIVERS 0x20000010
  457. #define PERF_ADDTOWS 0x20000020
  458. #define PERF_VERSION 0x20000040
  459. #define PERF_DPC 0x20000080
  460. #define PERF_SHUTDOWN 0x20000100
  461. #define PERF_HIBER 0x20000200
  462. #define PERF_RESUME 0x20000400
  463. #define PERF_EXCEPTION 0x20000800
  464. #define PERF_FILENAME_ALL 0x20001000
  465. #define PERF_INTERRUPT 0x20004000
  466. //
  467. // GlobalMask 2: The candidate to remain in NTPERF
  468. //
  469. #define PERF_UNDEFINED 0x40000001
  470. #define PERF_POOL 0x40000002
  471. #define PERF_FOOTPRINT_PROC 0x40000004 // Get details WS count or pfn
  472. #define PERF_WS_DETAIL 0x40000008 //
  473. #define PERF_WS_ENTRY 0x40000010 //
  474. #define PERF_HEAP 0x40000020
  475. #define PERF_SYSCALL 0x40000040
  476. #define PERF_WMI_TRACE 0x40000080 // Indicate to log all WMI events
  477. #define PERF_BACKTRACE 0x40000100
  478. #define PERF_VULCAN 0x40000200
  479. #define PERF_OBJECTS 0x40000400
  480. #define PERF_EVENTS 0x40000800
  481. #define PERF_FULLTRACE 0x40001000
  482. #define PERF_FAILED_STKDUMP 0x40002000
  483. #define PERF_PREFETCH 0x40004000
  484. #define PERF_FONTS 0x40008000
  485. //
  486. // GlobalMask 3: The candidate to be removed soon
  487. //
  488. #define PERF_SERVICES 0x80000002
  489. #define PERF_MASK_CHANGE 0x80000004
  490. #define PERF_DLL_INFO 0x80000008
  491. #define PERF_DLL_FLUSH_WS 0x80000010
  492. #define PERF_CLEARWS 0x80000020
  493. #define PERF_MEMORY_SNAPSHOT 0x80000040
  494. #define PERF_NO_MASK_CHANGE 0x80000080
  495. #define PERF_DATA_ACCESS 0x80000100
  496. #define PERF_MISC 0x80000200
  497. #define PERF_READYQUEUE 0x80000400
  498. #define PERF_MULTIMEDIA 0x80000800
  499. #define PERF_PROC_ATTACH 0x80001000
  500. #define PERF_DSHOW_DETAILED 0x80002000
  501. #define PERF_DSHOW_SAMPLES 0x80004000
  502. #define PERF_POWER 0x80008000
  503. #define PERF_SOFT_TRIM 0x80010000
  504. #define PERF_DLL_THREAD_ATTACH_FLUSH_WS 0x80020000
  505. #define PERF_DLL_THREAD_DETACH_FLUSH_WS 0x80040000
  506. //
  507. // GlobalMask 7: The mark is a control mask. All flags that changes system
  508. // behaviors go here.
  509. //
  510. #define PERF_CLUSTER_OFF 0xe0000001
  511. #define PERF_BIGFOOT 0xe0000002
  512. //
  513. // Converting old PERF hooks into WMI format. More clean up to be done.
  514. //
  515. // WHEN YOU ADD NEW TYPES UPDATE THE NAME TABLE in perfgroups.c:
  516. // PerfLogTypeNames ALSO UPDATE VERIFICATION TABLE IN PERFPOSTTBLS.C
  517. //
  518. //
  519. // Event for header
  520. //
  521. #define WMI_LOG_TYPE_HEADER (EVENT_TRACE_GROUP_HEADER | EVENT_TRACE_TYPE_INFO)
  522. //
  523. // Event for hardware config
  524. //
  525. #define WMI_LOG_TYPE_CONFIG_CPU (EVENT_TRACE_GROUP_CONFIG | EVENT_TRACE_TYPE_CONFIG_CPU)
  526. #define WMI_LOG_TYPE_CONFIG_PHYSICALDISK (EVENT_TRACE_GROUP_CONFIG | EVENT_TRACE_TYPE_CONFIG_PHYSICALDISK)
  527. #define WMI_LOG_TYPE_CONFIG_LOGICALDISK (EVENT_TRACE_GROUP_CONFIG | EVENT_TRACE_TYPE_CONFIG_LOGICALDISK)
  528. #define WMI_LOG_TYPE_CONFIG_NIC (EVENT_TRACE_GROUP_CONFIG | EVENT_TRACE_TYPE_CONFIG_NIC)
  529. #define WMI_LOG_TYPE_CONFIG_VIDEO (EVENT_TRACE_GROUP_CONFIG | EVENT_TRACE_TYPE_CONFIG_VIDEO)
  530. //
  531. //Event for Image and File Name
  532. //
  533. #define PERFINFO_LOG_TYPE_FILENAME (EVENT_TRACE_GROUP_FILE | EVENT_TRACE_TYPE_INFO)
  534. #define PERFINFO_LOG_TYPE_FILENAME_CREATE (EVENT_TRACE_GROUP_FILE | 0x20)
  535. #define PERFINFO_LOG_TYPE_FILENAME_SECTION1 (EVENT_TRACE_GROUP_FILE | 0x21)
  536. //
  537. //Event types for Process
  538. //
  539. #define WMI_LOG_TYPE_PROCESS_CREATE (EVENT_TRACE_GROUP_PROCESS | EVENT_TRACE_TYPE_START)
  540. #define WMI_LOG_TYPE_PROCESS_DELETE (EVENT_TRACE_GROUP_PROCESS | EVENT_TRACE_TYPE_END)
  541. #define WMI_LOG_TYPE_PROCESS_DC_START (EVENT_TRACE_GROUP_PROCESS | EVENT_TRACE_TYPE_DC_START)
  542. #define WMI_LOG_TYPE_PROCESS_DC_END (EVENT_TRACE_GROUP_PROCESS | EVENT_TRACE_TYPE_DC_END)
  543. #define WMI_LOG_TYPE_PROCESS_LOAD_IMAGE (EVENT_TRACE_GROUP_PROCESS | EVENT_TRACE_TYPE_LOAD)
  544. #define PERFINFO_LOG_TYPE_PROCESSNAME (EVENT_TRACE_GROUP_PROCESS | 0x20) // To be replaced with WMI hooks
  545. #define PERFINFO_LOG_TYPE_DIEDPROCESS (EVENT_TRACE_GROUP_PROCESS | 0x21) // To be replaced with WMI hooks
  546. #define PERFINFO_LOG_TYPE_OUTSWAPPROCESS (EVENT_TRACE_GROUP_PROCESS | 0x22) // going away
  547. #define PERFINFO_LOG_TYPE_INSWAPPROCESS (EVENT_TRACE_GROUP_PROCESS | 0x23)
  548. #define PERFINFO_LOG_TYPE_IMAGELOAD (EVENT_TRACE_GROUP_PROCESS | 0x24) // To be replaced with WMI hooks
  549. #define PERFINFO_LOG_TYPE_IMAGEUNLOAD (EVENT_TRACE_GROUP_PROCESS | 0x25)
  550. #define PERFINFO_LOG_TYPE_BOOT_PHASE_START (EVENT_TRACE_GROUP_PROCESS | 0x26)
  551. //
  552. //Event types for Thread
  553. //
  554. #define WMI_LOG_TYPE_THREAD_CREATE (EVENT_TRACE_GROUP_THREAD | EVENT_TRACE_TYPE_START)
  555. #define WMI_LOG_TYPE_THREAD_DELETE (EVENT_TRACE_GROUP_THREAD | EVENT_TRACE_TYPE_END)
  556. #define WMI_LOG_TYPE_THREAD_DC_START (EVENT_TRACE_GROUP_THREAD | EVENT_TRACE_TYPE_DC_START)
  557. #define WMI_LOG_TYPE_THREAD_DC_END (EVENT_TRACE_GROUP_THREAD | EVENT_TRACE_TYPE_DC_END)
  558. #define PERFINFO_LOG_TYPE_CREATETHREAD (EVENT_TRACE_GROUP_THREAD | 0x20) // To be replaced with WMI hooks
  559. #define PERFINFO_LOG_TYPE_TERMINATETHREAD (EVENT_TRACE_GROUP_THREAD | 0x21) // To be replaced with WMI hooks
  560. #define PERFINFO_LOG_TYPE_GROWKERNELSTACK (EVENT_TRACE_GROUP_THREAD | 0x22)
  561. #define PERFINFO_LOG_TYPE_CONVERTTOGUITHREAD (EVENT_TRACE_GROUP_THREAD | 0x23)
  562. #define PERFINFO_LOG_TYPE_CONTEXTSWAP (EVENT_TRACE_GROUP_THREAD | 0x24) // new context swap struct
  563. #define PERFINFO_LOG_TYPE_THREAD_RESERVED1 (EVENT_TRACE_GROUP_THREAD | 0x25)
  564. #define PERFINFO_LOG_TYPE_THREAD_RESERVED2 (EVENT_TRACE_GROUP_THREAD | 0x26)
  565. #define PERFINFO_LOG_TYPE_OUTSWAPSTACK (EVENT_TRACE_GROUP_THREAD | 0x27) // going away
  566. #define PERFINFO_LOG_TYPE_INSWAPSTACK (EVENT_TRACE_GROUP_THREAD | 0x28) // going away
  567. //
  568. // Event types for IO subsystem
  569. //
  570. #define WMI_LOG_TYPE_TCPIP_SEND (EVENT_TRACE_GROUP_TCPIP | EVENT_TRACE_TYPE_SEND)
  571. #define WMI_LOG_TYPE_TCPIP_RECEIVE (EVENT_TRACE_GROUP_TCPIP | EVENT_TRACE_TYPE_RECEIVE)
  572. #define WMI_LOG_TYPE_TCPIP_CONNECT (EVENT_TRACE_GROUP_TCPIP | EVENT_TRACE_TYPE_CONNECT)
  573. #define WMI_LOG_TYPE_TCPIP_DISCONNECT (EVENT_TRACE_GROUP_TCPIP | EVENT_TRACE_TYPE_DISCONNECT)
  574. #define WMI_LOG_TYPE_TCPIP_RETRANSMIT (EVENT_TRACE_GROUP_TCPIP | EVENT_TRACE_TYPE_RETRANSMIT)
  575. #define WMI_LOG_TYPE_TCPIP_ACCEPT (EVENT_TRACE_GROUP_TCPIP | EVENT_TRACE_TYPE_ACCEPT)
  576. #define WMI_LOG_TYPE_UDP_SEND (EVENT_TRACE_GROUP_UDPIP | EVENT_TRACE_TYPE_SEND)
  577. #define WMI_LOG_TYPE_UDP_RECEIVE (EVENT_TRACE_GROUP_UDPIP | EVENT_TRACE_TYPE_RECEIVE)
  578. #define WMI_LOG_TYPE_IO_READ (EVENT_TRACE_GROUP_IO | EVENT_TRACE_TYPE_IO_READ)
  579. #define WMI_LOG_TYPE_IO_WRITE (EVENT_TRACE_GROUP_IO | EVENT_TRACE_TYPE_IO_WRITE)
  580. #define PERFINFO_LOG_TYPE_DRIVER_INIT (EVENT_TRACE_GROUP_IO | 0x20)
  581. #define PERFINFO_LOG_TYPE_DRIVER_INIT_COMPLETE (EVENT_TRACE_GROUP_IO | 0x21)
  582. #define PERFINFO_LOG_TYPE_DRIVER_MAJORFUNCTION_CALL (EVENT_TRACE_GROUP_IO | 0x22)
  583. #define PERFINFO_LOG_TYPE_DRIVER_MAJORFUNCTION_RETURN (EVENT_TRACE_GROUP_IO | 0x23)
  584. #define PERFINFO_LOG_TYPE_DRIVER_COMPLETIONROUTINE_CALL (EVENT_TRACE_GROUP_IO | 0x24)
  585. #define PERFINFO_LOG_TYPE_DRIVER_COMPLETIONROUTINE_RETURN (EVENT_TRACE_GROUP_IO | 0x25)
  586. #define PERFINFO_LOG_TYPE_DRIVER_ADD_DEVICE_CALL (EVENT_TRACE_GROUP_IO | 0x26)
  587. #define PERFINFO_LOG_TYPE_DRIVER_ADD_DEVICE_RETURN (EVENT_TRACE_GROUP_IO | 0x27)
  588. #define PERFINFO_LOG_TYPE_DRIVER_STARTIO_CALL (EVENT_TRACE_GROUP_IO | 0x28)
  589. #define PERFINFO_LOG_TYPE_DRIVER_STARTIO_RETURN (EVENT_TRACE_GROUP_IO | 0x29)
  590. #define PERFINFO_LOG_TYPE_WMI_DISKPERF_READ (EVENT_TRACE_GROUP_IO | 0x2a) // To be replaced with WMI hooks
  591. #define PERFINFO_LOG_TYPE_WMI_DISKPERF_WRITE (EVENT_TRACE_GROUP_IO | 0x2b) // To be replaced with WMI hooks
  592. #define PERFINFO_LOG_TYPE_WMI_DISKPERF_READ_COMPLETE (EVENT_TRACE_GROUP_IO | 0x2c) // To be replaced with WMI hooks
  593. #define PERFINFO_LOG_TYPE_WMI_DISKPERF_WRITE_COMPLETE (EVENT_TRACE_GROUP_IO | 0x2d) // To be replaced with WMI hooks
  594. #define PERFINFO_LOG_TYPE_WMI_DISKPERF_CACHED_READ_COMPLETE (EVENT_TRACE_GROUP_IO | 0x2e)
  595. #define PERFINFO_LOG_TYPE_WMI_DISKPERF_CACHE_WARM_COMPLETE (EVENT_TRACE_GROUP_IO | 0x2f)
  596. #define PERFINFO_LOG_TYPE_PREFETCH_ACTION (EVENT_TRACE_GROUP_IO | 0x30)
  597. #define PERFINFO_LOG_TYPE_PREFETCH_REQUEST (EVENT_TRACE_GROUP_IO | 0x31)
  598. #define PERFINFO_LOG_TYPE_PREFETCH_READLIST (EVENT_TRACE_GROUP_IO | 0x32)
  599. #define PERFINFO_LOG_TYPE_PREFETCH_READ (EVENT_TRACE_GROUP_IO | 0x33)
  600. #define PERFINFO_LOG_TYPE_DRIVER_COMPLETE_REQUEST (EVENT_TRACE_GROUP_IO | 0x34)
  601. #define PERFINFO_LOG_TYPE_DRIVER_COMPLETE_REQUEST_RETURN (EVENT_TRACE_GROUP_IO | 0x35)
  602. #define PERFINFO_LOG_TYPE_BOOT_PREFETCH_INFORMATION (EVENT_TRACE_GROUP_IO | 0x36)
  603. //
  604. // Event types for Memory subsystem
  605. //
  606. #define WMI_LOG_TYPE_PAGE_FAULT_TRANSITION (EVENT_TRACE_GROUP_MEMORY | EVENT_TRACE_TYPE_MM_TF)
  607. #define WMI_LOG_TYPE_PAGE_FAULT_DEMAND_ZERO (EVENT_TRACE_GROUP_MEMORY | EVENT_TRACE_TYPE_MM_DZF)
  608. #define WMI_LOG_TYPE_PAGE_FAULT_COPY_ON_WRITE (EVENT_TRACE_GROUP_MEMORY | EVENT_TRACE_TYPE_MM_COW)
  609. #define WMI_LOG_TYPE_PAGE_FAULT_GUARD_PAGE (EVENT_TRACE_GROUP_MEMORY | EVENT_TRACE_TYPE_MM_GPF)
  610. #define WMI_LOG_TYPE_PAGE_FAULT_HARD_PAGE_FAULT (EVENT_TRACE_GROUP_MEMORY | EVENT_TRACE_TYPE_MM_HPF)
  611. #define PERFINFO_LOG_TYPE_HARDFAULT (EVENT_TRACE_GROUP_MEMORY | 0x20)
  612. #define PERFINFO_LOG_TYPE_REMOVEPAGEBYCOLOR (EVENT_TRACE_GROUP_MEMORY | 0x21)
  613. #define PERFINFO_LOG_TYPE_REMOVEPAGEFROMLIST (EVENT_TRACE_GROUP_MEMORY | 0x22)
  614. #define PERFINFO_LOG_TYPE_PAGEINMEMORY (EVENT_TRACE_GROUP_MEMORY | 0x23)
  615. #define PERFINFO_LOG_TYPE_INSERTINFREELIST (EVENT_TRACE_GROUP_MEMORY | 0x24)
  616. #define PERFINFO_LOG_TYPE_SECTIONREMOVED (EVENT_TRACE_GROUP_MEMORY | 0x25)
  617. #define PERFINFO_LOG_TYPE_INSERTINLIST (EVENT_TRACE_GROUP_MEMORY | 0x26)
  618. #define PERFINFO_LOG_TYPE_INSERTATFRONT (EVENT_TRACE_GROUP_MEMORY | 0x28)
  619. #define PERFINFO_LOG_TYPE_UNLINKFROMSTANDBY (EVENT_TRACE_GROUP_MEMORY | 0x29)
  620. #define PERFINFO_LOG_TYPE_UNLINKFFREEORZERO (EVENT_TRACE_GROUP_MEMORY | 0x2a)
  621. #define PERFINFO_LOG_TYPE_WORKINGSETMANAGER (EVENT_TRACE_GROUP_MEMORY | 0x2b)
  622. #define PERFINFO_LOG_TYPE_TRIMPROCESS (EVENT_TRACE_GROUP_MEMORY | 0x2c)
  623. #define PERFINFO_LOG_TYPE_MEMORYSNAP (EVENT_TRACE_GROUP_MEMORY | 0x2d)
  624. #define PERFINFO_LOG_TYPE_ZEROSHARECOUNT (EVENT_TRACE_GROUP_MEMORY | 0x2e)
  625. #define PERFINFO_LOG_TYPE_TRANSITIONFAULT (EVENT_TRACE_GROUP_MEMORY | 0x2f)
  626. #define PERFINFO_LOG_TYPE_DEMANDZEROFAULT (EVENT_TRACE_GROUP_MEMORY | 0x30)
  627. #define PERFINFO_LOG_TYPE_ADDVALIDPAGETOWS (EVENT_TRACE_GROUP_MEMORY | 0x31)
  628. #define PERFINFO_LOG_TYPE_OUTWS_REPLACEUSED (EVENT_TRACE_GROUP_MEMORY | 0x32)
  629. #define PERFINFO_LOG_TYPE_OUTWS_REPLACEUNUSED (EVENT_TRACE_GROUP_MEMORY | 0x33)
  630. #define PERFINFO_LOG_TYPE_OUTWS_VOLUNTRIM (EVENT_TRACE_GROUP_MEMORY | 0x34)
  631. #define PERFINFO_LOG_TYPE_OUTWS_FORCETRIM (EVENT_TRACE_GROUP_MEMORY | 0x35)
  632. #define PERFINFO_LOG_TYPE_OUTWS_ADJUSTWS (EVENT_TRACE_GROUP_MEMORY | 0x36)
  633. #define PERFINFO_LOG_TYPE_OUTWS_EMPTYQ (EVENT_TRACE_GROUP_MEMORY | 0x37)
  634. #define PERFINFO_LOG_TYPE_WORKINGSETSNAP (EVENT_TRACE_GROUP_MEMORY | 0x38)
  635. #define PERFINFO_LOG_TYPE_DECREFCNT (EVENT_TRACE_GROUP_MEMORY | 0x39)
  636. #define PERFINFO_LOG_TYPE_DECSHARCNT (EVENT_TRACE_GROUP_MEMORY | 0x3a)
  637. #define PERFINFO_LOG_TYPE_ZEROREFCOUNT (EVENT_TRACE_GROUP_MEMORY | 0x3b)
  638. #define PERFINFO_LOG_TYPE_WSINFOPROCESS (EVENT_TRACE_GROUP_MEMORY | 0x3c)
  639. #define PERFINFO_LOG_TYPE_ADDTOWORKINGSET (EVENT_TRACE_GROUP_MEMORY | 0x3d)
  640. #define PERFINFO_LOG_TYPE_DELETEKERNELSTACK (EVENT_TRACE_GROUP_MEMORY | 0x3e)
  641. #define PERFINFO_LOG_TYPE_PROTOPTEFAULT (EVENT_TRACE_GROUP_MEMORY | 0x3f)
  642. #define PERFINFO_LOG_TYPE_ADDTOWS (EVENT_TRACE_GROUP_MEMORY | 0x40)
  643. #define PERFINFO_LOG_TYPE_OUTWS_HASHFULL (EVENT_TRACE_GROUP_MEMORY | 0x41)
  644. #define PERFINFO_LOG_TYPE_MOD_PAGE_WRITER1 (EVENT_TRACE_GROUP_MEMORY | 0x42)
  645. #define PERFINFO_LOG_TYPE_MOD_PAGE_WRITER2 (EVENT_TRACE_GROUP_MEMORY | 0x43)
  646. #define PERFINFO_LOG_TYPE_MOD_PAGE_WRITER3 (EVENT_TRACE_GROUP_MEMORY | 0x44)
  647. #define PERFINFO_LOG_TYPE_FAULTADDR_WITH_IP (EVENT_TRACE_GROUP_MEMORY | 0x45)
  648. #define PERFINFO_LOG_TYPE_TRIMSESSION (EVENT_TRACE_GROUP_MEMORY | 0x46)
  649. #define PERFINFO_LOG_TYPE_MEMORYSNAPLITE (EVENT_TRACE_GROUP_MEMORY | 0x47)
  650. #define PERFINFO_LOG_TYPE_WS_SESSION (EVENT_TRACE_GROUP_MEMORY | 0x48)
  651. // (EVENT_TRACE_GROUP_POOL
  652. //
  653. //
  654. // Event types for Registry subsystem
  655. //
  656. #define WMI_LOG_TYPE_REG_CREATE (EVENT_TRACE_GROUP_REGISTRY | EVENT_TRACE_TYPE_REGCREATE)
  657. #define WMI_LOG_TYPE_REG_OPEN (EVENT_TRACE_GROUP_REGISTRY | EVENT_TRACE_TYPE_REGOPEN)
  658. #define WMI_LOG_TYPE_REG_DELETE (EVENT_TRACE_GROUP_REGISTRY | EVENT_TRACE_TYPE_REGDELETE)
  659. #define WMI_LOG_TYPE_REG_QUERY (EVENT_TRACE_GROUP_REGISTRY | EVENT_TRACE_TYPE_REGQUERY)
  660. #define WMI_LOG_TYPE_REG_SET_VALUE (EVENT_TRACE_GROUP_REGISTRY | EVENT_TRACE_TYPE_REGSETVALUE)
  661. #define WMI_LOG_TYPE_REG_DELETE_VALUE (EVENT_TRACE_GROUP_REGISTRY | EVENT_TRACE_TYPE_REGDELETEVALUE)
  662. #define WMI_LOG_TYPE_REG_QUERY_VALUE (EVENT_TRACE_GROUP_REGISTRY | EVENT_TRACE_TYPE_REGQUERYVALUE)
  663. #define WMI_LOG_TYPE_REG_ENUM_KEY (EVENT_TRACE_GROUP_REGISTRY | EVENT_TRACE_TYPE_REGENUMERATEKEY)
  664. #define WMI_LOG_TYPE_REG_ENUM_VALUE (EVENT_TRACE_GROUP_REGISTRY | EVENT_TRACE_TYPE_REGENUMERATEVALUEKEY)
  665. #define WMI_LOG_TYPE_REG_QUERY_MULTIVALUE (EVENT_TRACE_GROUP_REGISTRY | EVENT_TRACE_TYPE_REGQUERYMULTIPLEVALUE)
  666. #define WMI_LOG_TYPE_REG_SET_INFO (EVENT_TRACE_GROUP_REGISTRY | EVENT_TRACE_TYPE_REGSETINFORMATION)
  667. #define WMI_LOG_TYPE_REG_FLUSH (EVENT_TRACE_GROUP_REGISTRY | EVENT_TRACE_TYPE_REGFLUSH)
  668. #define WMI_LOG_TYPE_REG_RUNDOWN (EVENT_TRACE_GROUP_REGISTRY | EVENT_TRACE_TYPE_REGKCBDMP)
  669. #define PERFINFO_LOG_TYPE_CMCELLREFERRED (EVENT_TRACE_GROUP_REGISTRY | 0x20)
  670. #define PERFINFO_LOG_TYPE_REG_KCB_KEYNAME (EVENT_TRACE_GROUP_REGISTRY | 0x21)
  671. #define PERFINFO_LOG_TYPE_REG_KCB_CREATE (EVENT_TRACE_GROUP_REGISTRY | 0x22)
  672. #define PERFINFO_LOG_TYPE_REG_PARSEKEY_START (EVENT_TRACE_GROUP_REGISTRY | 0x23)
  673. #define PERFINFO_LOG_TYPE_REG_PARSEKEY_END (EVENT_TRACE_GROUP_REGISTRY | 0x24)
  674. #define PERFINFO_LOG_TYPE_REG_DELETE_KEY (EVENT_TRACE_GROUP_REGISTRY | 0x25)
  675. #define PERFINFO_LOG_TYPE_REG_DELETE_VALUE (EVENT_TRACE_GROUP_REGISTRY | 0x26)
  676. #define PERFINFO_LOG_TYPE_REG_ENUM_KEY (EVENT_TRACE_GROUP_REGISTRY | 0x27)
  677. #define PERFINFO_LOG_TYPE_REG_ENUM_VALUE (EVENT_TRACE_GROUP_REGISTRY | 0x28)
  678. #define PERFINFO_LOG_TYPE_REG_QUERY_KEY (EVENT_TRACE_GROUP_REGISTRY | 0x29)
  679. #define PERFINFO_LOG_TYPE_REG_QUERY_VALUE (EVENT_TRACE_GROUP_REGISTRY | 0x2a)
  680. #define PERFINFO_LOG_TYPE_REG_QUERY_MULTIVALUE (EVENT_TRACE_GROUP_REGISTRY | 0x2b)
  681. #define PERFINFO_LOG_TYPE_REG_SET_VALUE (EVENT_TRACE_GROUP_REGISTRY | 0x2c)
  682. #define PERFINFO_LOG_TYPE_REG_NOTIFY_POST (EVENT_TRACE_GROUP_REGISTRY | 0x2d)
  683. #define PERFINFO_LOG_TYPE_REG_NOTIFY_KCB (EVENT_TRACE_GROUP_REGISTRY | 0x2e)
  684. //
  685. // Event types for PERF tracing specific subsystem
  686. //
  687. #define PERFINFO_LOG_TYPE_PERFFREQUENCY (EVENT_TRACE_GROUP_PERFINFO | 0x20)
  688. #define PERFINFO_LOG_TYPE_PERFCOUNTERSTART (EVENT_TRACE_GROUP_PERFINFO | 0x21)
  689. #define PERFINFO_LOG_TYPE_MARK (EVENT_TRACE_GROUP_PERFINFO | 0x22)
  690. #define PERFINFO_LOG_TYPE_VERSION (EVENT_TRACE_GROUP_PERFINFO | 0x23)
  691. #define PERFINFO_LOG_TYPE_ASYNCMARK (EVENT_TRACE_GROUP_PERFINFO | 0x24)
  692. #define PERFINFO_LOG_TYPE_FILENAMEBUFFER (EVENT_TRACE_GROUP_PERFINFO | 0x25) // to be cleaned up
  693. #define PERFINFO_LOG_TYPE_IMAGENAME (EVENT_TRACE_GROUP_PERFINFO | 0x26)
  694. #define PERFINFO_LOG_TYPE_RESERVED1 (EVENT_TRACE_GROUP_PERFINFO | 0x27)
  695. #define PERFINFO_LOG_TYPE_RESERVED2 (EVENT_TRACE_GROUP_PERFINFO | 0x28)
  696. #define PERFINFO_LOG_TYPE_RESERVED3 (EVENT_TRACE_GROUP_PERFINFO | 0x29)
  697. #define PERFINFO_LOG_TYPE_WMI_TRACE_IO (EVENT_TRACE_GROUP_PERFINFO | 0x2a)
  698. #define PERFINFO_LOG_TYPE_WMI_TRACE_FILENAME_EVENT (EVENT_TRACE_GROUP_PERFINFO | 0x2b)
  699. #define PERFINFO_LOG_TYPE_GLOBAL_MASK_CHANGE (EVENT_TRACE_GROUP_PERFINFO | 0x2c)
  700. #define PERFINFO_LOG_TYPE_TRACEINFO (EVENT_TRACE_GROUP_PERFINFO | 0x2d) // go away
  701. #define PERFINFO_LOG_TYPE_SAMPLED_PROFILE (EVENT_TRACE_GROUP_PERFINFO | 0x2e)
  702. #define PERFINFO_LOG_TYPE_TIMERDPC_ENTER (EVENT_TRACE_GROUP_PERFINFO | 0x2f)
  703. #define PERFINFO_LOG_TYPE_TIMERDPC_EXIT (EVENT_TRACE_GROUP_PERFINFO | 0x30)
  704. #define PERFINFO_LOG_TYPE_DPC_ENTER (EVENT_TRACE_GROUP_PERFINFO | 0x31)
  705. #define PERFINFO_LOG_TYPE_DPC_EXIT (EVENT_TRACE_GROUP_PERFINFO | 0x32)
  706. #define PERFINFO_LOG_TYPE_SYSCALL_ENTER (EVENT_TRACE_GROUP_PERFINFO | 0x33)
  707. #define PERFINFO_LOG_TYPE_SYSCALL_EXIT (EVENT_TRACE_GROUP_PERFINFO | 0x34)
  708. #define PERFINFO_LOG_TYPE_BACKTRACE (EVENT_TRACE_GROUP_PERFINFO | 0x35)
  709. #define PERFINFO_LOG_TYPE_BACKTRACE_USERSTACK (EVENT_TRACE_GROUP_PERFINFO | 0x36)
  710. #define PERFINFO_LOG_TYPE_SAMPLED_PROFILE_CACHE (EVENT_TRACE_GROUP_PERFINFO | 0x37)
  711. #define PERFINFO_LOG_TYPE_EXCEPTION_STACK (EVENT_TRACE_GROUP_PERFINFO | 0x38)
  712. #define PERFINFO_LOG_TYPE_BRANCH_TRACE (EVENT_TRACE_GROUP_PERFINFO | 0x39)
  713. #define PERFINFO_LOG_TYPE_BRANCH_TRACE_DEBUG (EVENT_TRACE_GROUP_PERFINFO | 0x40)
  714. #define PERFINFO_LOG_TYPE_BRANCH_ADDRESS_DEBUG (EVENT_TRACE_GROUP_PERFINFO | 0x41)
  715. #define PERFINFO_LOG_TYPE_INTERRUPT (EVENT_TRACE_GROUP_PERFINFO | 0x43)
  716. #define PERFINFO_LOG_TYPE_DPC (EVENT_TRACE_GROUP_PERFINFO | 0x44)
  717. #define PERFINFO_LOG_TYPE_TIMERDPC (EVENT_TRACE_GROUP_PERFINFO | 0x45)
  718. //
  719. // Event types for Pool subsystem
  720. //
  721. #define PERFINFO_LOG_TYPE_ALLOCATEPOOL (EVENT_TRACE_GROUP_POOL | 0x20)
  722. #define PERFINFO_LOG_TYPE_FREEPOOL (EVENT_TRACE_GROUP_POOL | 0x21)
  723. #define PERFINFO_LOG_TYPE_POOLSTAT (EVENT_TRACE_GROUP_POOL | 0x22)
  724. #define PERFINFO_LOG_TYPE_ADDPOOLPAGE (EVENT_TRACE_GROUP_POOL | 0x23)
  725. #define PERFINFO_LOG_TYPE_FREEPOOLPAGE (EVENT_TRACE_GROUP_POOL | 0x24)
  726. #define PERFINFO_LOG_TYPE_BIGPOOLPAGE (EVENT_TRACE_GROUP_POOL | 0x25)
  727. #define PERFINFO_LOG_TYPE_POOLSNAP (EVENT_TRACE_GROUP_POOL | 0x26)
  728. //
  729. // Event types for Heap subsystem
  730. //
  731. #define PERFINFO_LOG_TYPE_HEAP_CREATE (EVENT_TRACE_GROUP_HEAP | 0x20)
  732. #define PERFINFO_LOG_TYPE_HEAP_ALLOC (EVENT_TRACE_GROUP_HEAP | 0x21)
  733. #define PERFINFO_LOG_TYPE_HEAP_REALLOC (EVENT_TRACE_GROUP_HEAP | 0x22)
  734. #define PERFINFO_LOG_TYPE_HEAP_DESTROY (EVENT_TRACE_GROUP_HEAP | 0x23)
  735. #define PERFINFO_LOG_TYPE_HEAP_FREE (EVENT_TRACE_GROUP_HEAP | 0x24)
  736. #define PERFINFO_LOG_TYPE_HEAP_EXTEND (EVENT_TRACE_GROUP_HEAP | 0x25)
  737. #define PERFINFO_LOG_TYPE_HEAP_SNAPSHOT (EVENT_TRACE_GROUP_HEAP | 0x26)
  738. #define PERFINFO_LOG_TYPE_HEAP_CREATE_SNAPSHOT (EVENT_TRACE_GROUP_HEAP | 0x27)
  739. #define PERFINFO_LOG_TYPE_HEAP_DESTROY_SNAPSHOT (EVENT_TRACE_GROUP_HEAP | 0x28)
  740. #define PERFINFO_LOG_TYPE_HEAP_EXTEND_SNAPSHOT (EVENT_TRACE_GROUP_HEAP | 0x29)
  741. #define PERFINFO_LOG_TYPE_HEAP_CONTRACT (EVENT_TRACE_GROUP_HEAP | 0x2a)
  742. #define PERFINFO_LOG_TYPE_HEAP_LOCK (EVENT_TRACE_GROUP_HEAP | 0x2b)
  743. #define PERFINFO_LOG_TYPE_HEAP_UNLOCK (EVENT_TRACE_GROUP_HEAP | 0x2c)
  744. #define PERFINFO_LOG_TYPE_HEAP_VALIDATE (EVENT_TRACE_GROUP_HEAP | 0x2d)
  745. #define PERFINFO_LOG_TYPE_HEAP_WALK (EVENT_TRACE_GROUP_HEAP | 0x2e)
  746. //
  747. // Event Types for Critical Section Subsystem
  748. //
  749. #define PERFINFO_LOG_TYPE_CRITSEC_ENTER (EVENT_TRACE_GROUP_CRITSEC | 0x20)
  750. #define PERFINFO_LOG_TYPE_CRITSEC_LEAVE (EVENT_TRACE_GROUP_CRITSEC | 0x21)
  751. #define PERFINFO_LOG_TYPE_CRITSEC_COLLISION (EVENT_TRACE_GROUP_CRITSEC | 0x22)
  752. //
  753. // Event types for Object subsystem
  754. //
  755. #define PERFINFO_LOG_TYPE_DECLARE_OBJECT (EVENT_TRACE_GROUP_OBJECT | 0x20)
  756. #define PERFINFO_LOG_TYPE_WAIT_OBJECT (EVENT_TRACE_GROUP_OBJECT | 0x21)
  757. #define PERFINFO_LOG_TYPE_UNWAIT_OBJECT (EVENT_TRACE_GROUP_OBJECT | 0x22)
  758. #define PERFINFO_LOG_TYPE_SIGNAL_OBJECT (EVENT_TRACE_GROUP_OBJECT | 0x23)
  759. #define PERFINFO_LOG_TYPE_CLEAR_OBJECT (EVENT_TRACE_GROUP_OBJECT | 0x24)
  760. #define PERFINFO_LOG_TYPE_UNWAIT_SIGNALED_OBJECT (EVENT_TRACE_GROUP_OBJECT | 0x25)
  761. //
  762. // Event types for Power subsystem
  763. //
  764. #define PERFINFO_LOG_TYPE_BATTERY_LIFE_INFO (EVENT_TRACE_GROUP_POWER | 0x20)
  765. #define PERFINFO_LOG_TYPE_IDLE_STATE_CHANGE (EVENT_TRACE_GROUP_POWER | 0x21)
  766. #define PERFINFO_LOG_TYPE_SET_POWER_ACTION (EVENT_TRACE_GROUP_POWER | 0x22)
  767. #define PERFINFO_LOG_TYPE_SET_POWER_ACTION_RET (EVENT_TRACE_GROUP_POWER | 0x23)
  768. #define PERFINFO_LOG_TYPE_SET_DEVICES_STATE (EVENT_TRACE_GROUP_POWER | 0x24)
  769. #define PERFINFO_LOG_TYPE_SET_DEVICES_STATE_RET (EVENT_TRACE_GROUP_POWER | 0x25)
  770. #define PERFINFO_LOG_TYPE_PO_NOTIFY_DEVICE (EVENT_TRACE_GROUP_POWER | 0x26)
  771. #define PERFINFO_LOG_TYPE_PO_NOTIFY_DEVICE_COMPLETE (EVENT_TRACE_GROUP_POWER | 0x27)
  772. #define PERFINFO_LOG_TYPE_PO_SESSION_CALLOUT (EVENT_TRACE_GROUP_POWER | 0x28)
  773. #define PERFINFO_LOG_TYPE_PO_SESSION_CALLOUT_RET (EVENT_TRACE_GROUP_POWER | 0x29)
  774. #define PERFINFO_LOG_TYPE_PO_PRESLEEP (EVENT_TRACE_GROUP_POWER | 0x30)
  775. #define PERFINFO_LOG_TYPE_PO_POSTSLEEP (EVENT_TRACE_GROUP_POWER | 0x31)
  776. //
  777. // Event types for MODBound subsystem
  778. //
  779. #define PERFINFO_LOG_TYPE_MODULEBOUND_ENT (EVENT_TRACE_GROUP_MODBOUND | 0x20)
  780. #define PERFINFO_LOG_TYPE_MODULEBOUND_JUMP (EVENT_TRACE_GROUP_MODBOUND | 0x21)
  781. #define PERFINFO_LOG_TYPE_MODULEBOUND_RET (EVENT_TRACE_GROUP_MODBOUND | 0x22)
  782. #define PERFINFO_LOG_TYPE_MODULEBOUND_CALL (EVENT_TRACE_GROUP_MODBOUND | 0x23)
  783. #define PERFINFO_LOG_TYPE_MODULEBOUND_CALLRET (EVENT_TRACE_GROUP_MODBOUND | 0x24)
  784. #define PERFINFO_LOG_TYPE_MODULEBOUND_INT2E (EVENT_TRACE_GROUP_MODBOUND | 0x25)
  785. #define PERFINFO_LOG_TYPE_MODULEBOUND_INT2B (EVENT_TRACE_GROUP_MODBOUND | 0x26)
  786. #define PERFINFO_LOG_TYPE_MODULEBOUND_FULLTRACE (EVENT_TRACE_GROUP_MODBOUND | 0x27)
  787. //
  788. // Event types for gdi subsystem
  789. #define PERFINFO_LOG_TYPE_FONT_REALIZE (EVENT_TRACE_GROUP_GDI | 0x20)
  790. #define PERFINFO_LOG_TYPE_FONT_DELETE (EVENT_TRACE_GROUP_GDI | 0x21)
  791. #define PERFINFO_LOG_TYPE_FONT_ACTIVATE (EVENT_TRACE_GROUP_GDI | 0x22)
  792. #define PERFINFO_LOG_TYPE_FONT_FLUSH (EVENT_TRACE_GROUP_GDI | 0x23)
  793. //
  794. // Event types To be Decided if they are still needed?
  795. //
  796. #define PERFINFO_LOG_TYPE_DISPATCHMSG (EVENT_TRACE_GROUP_TBD | 0x00)
  797. #define PERFINFO_LOG_TYPE_GLYPHCACHE (EVENT_TRACE_GROUP_TBD | 0x01)
  798. #define PERFINFO_LOG_TYPE_GLYPHS (EVENT_TRACE_GROUP_TBD | 0x02)
  799. #define PERFINFO_LOG_TYPE_READWRITE (EVENT_TRACE_GROUP_TBD | 0x03)
  800. #define PERFINFO_LOG_TYPE_EXPLICIT_LOAD (EVENT_TRACE_GROUP_TBD | 0x04)
  801. #define PERFINFO_LOG_TYPE_IMPLICIT_LOAD (EVENT_TRACE_GROUP_TBD | 0x05)
  802. #define PERFINFO_LOG_TYPE_CHECKSUM (EVENT_TRACE_GROUP_TBD | 0x06)
  803. #define PERFINFO_LOG_TYPE_DLL_INIT (EVENT_TRACE_GROUP_TBD | 0x07)
  804. #define PERFINFO_LOG_TYPE_SERVICE_DD_START_INIT (EVENT_TRACE_GROUP_TBD | 0x08)
  805. #define PERFINFO_LOG_TYPE_SERVICE_DD_DONE_INIT (EVENT_TRACE_GROUP_TBD | 0x09)
  806. #define PERFINFO_LOG_TYPE_SERVICE_START_INIT (EVENT_TRACE_GROUP_TBD | 0x0a)
  807. #define PERFINFO_LOG_TYPE_SERVICE_DONE_INIT (EVENT_TRACE_GROUP_TBD | 0x0b)
  808. #define PERFINFO_LOG_TYPE_SERVICE_NAME (EVENT_TRACE_GROUP_TBD | 0x0c)
  809. #define PERFINFO_LOG_TYPE_WSINFOSESSION (EVENT_TRACE_GROUP_TBD | 0x0d)
  810. #define PERFINFO_LOG_TIMED_ENTER_ROUTINE (EVENT_TRACE_GROUP_TBD | 0x0e)
  811. #define PERFINFO_LOG_TIMED_EXIT_ROUTINE (EVENT_TRACE_GROUP_TBD | 0x0f)
  812. #define PERFINFO_LOG_TYPE_CTIME_STATS (EVENT_TRACE_GROUP_TBD | 0x10)
  813. #define PERFINFO_LOG_TYPE_MARKED_DIRTY (EVENT_TRACE_GROUP_TBD | 0x11)
  814. #define PERFINFO_LOG_TYPE_MARKED_CELL_DIRTY (EVENT_TRACE_GROUP_TBD | 0x12)
  815. #define PERFINFO_LOG_TYPE_HIVE_WRITE_DIRTY (EVENT_TRACE_GROUP_TBD | 0x13)
  816. #define PERFINFO_LOG_TYPE_DUMP_HIVECELL (EVENT_TRACE_GROUP_TBD | 0x14)
  817. #define PERFINFO_LOG_TYPE_HIVE_STAT (EVENT_TRACE_GROUP_TBD | 0x16)
  818. #define PERFINFO_LOG_TYPE_CLOCKREF (EVENT_TRACE_GROUP_TBD | 0x17)
  819. #define PERFINFO_LOG_TYPE_COWHEADER (EVENT_TRACE_GROUP_TBD | 0x18)
  820. #define PERFINFO_LOG_TYPE_COWBLOB (EVENT_TRACE_GROUP_TBD | 0x19)
  821. #define PERFINFO_LOG_TYPE_COWBLOB_CLOSED (EVENT_TRACE_GROUP_TBD | 0x1a)
  822. #define PERFINFO_LOG_TYPE_WMIPERFFREQUENCY (EVENT_TRACE_GROUP_TBD | 0x1d)
  823. #define PERFINFO_LOG_TYPE_CDROM_READ (EVENT_TRACE_GROUP_TBD | 0x1e)
  824. #define PERFINFO_LOG_TYPE_CDROM_READ_COMPLETE (EVENT_TRACE_GROUP_TBD | 0x1f)
  825. #define PERFINFO_LOG_TYPE_KE_SET_EVENT (EVENT_TRACE_GROUP_TBD | 0x20)
  826. #define PERFINFO_LOG_TYPE_REG_PARSEKEY (EVENT_TRACE_GROUP_TBD | 0x21)
  827. #define PERFINFO_LOG_TYPE_REG_PARSEKEYEND (EVENT_TRACE_GROUP_TBD | 0x22)
  828. #define PERFINFO_LOG_TYPE_ATTACH_PROCESS (EVENT_TRACE_GROUP_TBD | 0x24)
  829. #define PERFINFO_LOG_TYPE_DETACH_PROCESS (EVENT_TRACE_GROUP_TBD | 0x25)
  830. #define PERFINFO_LOG_TYPE_DATA_ACCESS (EVENT_TRACE_GROUP_TBD | 0x26)
  831. #define PERFINFO_LOG_TYPE_KDHELP (EVENT_TRACE_GROUP_TBD | 0x27)
  832. #define PERFINFO_LOG_TYPE_BOOT_OPTIONS (EVENT_TRACE_GROUP_TBD | 0x28)
  833. #define PERFINFO_LOG_TYPE_FAILED_STKDUMP (EVENT_TRACE_GROUP_TBD | 0x2c)
  834. #define PERFINFO_LOG_TYPE_SYSTEM_TIME (EVENT_TRACE_GROUP_TBD | 0x2f)
  835. #define PERFINFO_LOG_TYPE_READYQUEUE (EVENT_TRACE_GROUP_TBD | 0x30)
  836. //
  837. // KMIXER hooks are in audio\filters\kmixer\pins.c
  838. //
  839. #define PERFINFO_LOG_TYPE_KMIXER_DRIVER_ENTRY (EVENT_TRACE_GROUP_TBD | 0x31)
  840. #define PERFINFO_LOG_TYPE_KMIXER_DSOUND_STARVATION (EVENT_TRACE_GROUP_TBD | 0x32)
  841. #define PERFINFO_LOG_TYPE_KMIXER_DPC_STARVATION (EVENT_TRACE_GROUP_TBD | 0x33)
  842. #define PERFINFO_LOG_TYPE_KMIXER_WAVE_TOP_STARVATION (EVENT_TRACE_GROUP_TBD | 0x34)
  843. #define PERFINFO_LOG_TYPE_OVERLAY_QUALITY (EVENT_TRACE_GROUP_TBD | 0x35)
  844. // in amovie\filters\mixer\ovmixer\ominpin.cpp
  845. #define PERFINFO_LOG_TYPE_DVD_RENDER_SAMPLE (EVENT_TRACE_GROUP_TBD | 0x36)
  846. #define PERFINFO_LOG_TYPE_CDVD_SET_DISCONTINUITY (EVENT_TRACE_GROUP_TBD | 0x37)
  847. // in amovie\filters\dvdnav\dvdnav\dvd.cpp
  848. #define PERFINFO_LOG_TYPE_CSPLITTER_SET_DISCONTINUITY (EVENT_TRACE_GROUP_TBD | 0x38)
  849. // in amovie\filters\dvdnav\base\splitter.cpp
  850. // following hooks are in amovie\sdk\classes\base
  851. #define PERFINFO_LOG_TYPE_DSHOW_CTOR (EVENT_TRACE_GROUP_TBD | 0x39)
  852. #define PERFINFO_LOG_TYPE_DSHOW_DTOR (EVENT_TRACE_GROUP_TBD | 0x3a)
  853. #define PERFINFO_LOG_TYPE_DSHOW_DELIVER (EVENT_TRACE_GROUP_TBD | 0x3b)
  854. #define PERFINFO_LOG_TYPE_DSHOW_RECEIVE (EVENT_TRACE_GROUP_TBD | 0x3c)
  855. #define PERFINFO_LOG_TYPE_DSHOW_RUN (EVENT_TRACE_GROUP_TBD | 0x3d)
  856. #define PERFINFO_LOG_TYPE_DSHOW_PAUSE (EVENT_TRACE_GROUP_TBD | 0x3e)
  857. #define PERFINFO_LOG_TYPE_DSHOW_STOP (EVENT_TRACE_GROUP_TBD | 0x3f)
  858. #define PERFINFO_LOG_TYPE_DSHOW_JOINGRAPH (EVENT_TRACE_GROUP_TBD | 0x40)
  859. #define PERFINFO_LOG_TYPE_DSHOW_GETBUFFER (EVENT_TRACE_GROUP_TBD | 0x41)
  860. #define PERFINFO_LOG_TYPE_DSHOW_RELBUFFER (EVENT_TRACE_GROUP_TBD | 0x42)
  861. #define PERFINFO_LOG_TYPE_DSHOW_CONNECT (EVENT_TRACE_GROUP_TBD | 0x43)
  862. #define PERFINFO_LOG_TYPE_DSHOW_RXCONNECT (EVENT_TRACE_GROUP_TBD | 0x44)
  863. #define PERFINFO_LOG_TYPE_DSHOW_DISCONNECT (EVENT_TRACE_GROUP_TBD | 0x45)
  864. #define PERFINFO_LOG_TYPE_DSHOW_GETTIME (EVENT_TRACE_GROUP_TBD | 0x46)
  865. #define PERFINFO_LOG_TYPE_DSHOW_AUDIOREND (EVENT_TRACE_GROUP_TBD | 0x47)
  866. #define PERFINFO_LOG_TYPE_DSHOW_VIDEOREND (EVENT_TRACE_GROUP_TBD | 0x48)
  867. #define PERFINFO_LOG_TYPE_DSHOW_FRAMEDROP (EVENT_TRACE_GROUP_TBD | 0x49)
  868. #define PERFINFO_LOG_TYPE_DSHOW_AUDIOBREAK (EVENT_TRACE_GROUP_TBD | 0x4a)
  869. #define PERFINFO_LOG_TYPE_DSHOW_SAMPLE_DATADISCONTINUITY (EVENT_TRACE_GROUP_TBD | 0x4b)
  870. #define PERFINFO_LOG_TYPE_DSHOW_MEDIASAMPLE_SET_DISCONTINUITY (EVENT_TRACE_GROUP_TBD | 0x4c)
  871. #define PERFINFO_LOG_TYPE_DSHOW_TRANSFORM_INITSAMPLE_SET_DISCONTINUITY (EVENT_TRACE_GROUP_TBD | 0x4d)
  872. #define PERFINFO_LOG_TYPE_DSHOW_TRANSFORM_COPY_SET_DISCONTINUITY (EVENT_TRACE_GROUP_TBD | 0x4e)
  873. #define PERFINFO_LOG_TYPE_DSHOW_SYNCOBJ_ADVICE_FRAME_SKIP (EVENT_TRACE_GROUP_TBD | 0x4f)
  874. #define PERFINFO_LOG_TYPE_WMI_REFLECT_DISK_IO_READ (EVENT_TRACE_GROUP_TBD | 0x50)
  875. #define PERFINFO_LOG_TYPE_WMI_REFLECT_DISK_IO_WRITE (EVENT_TRACE_GROUP_TBD | 0x51)
  876. #if 0
  877. //
  878. // 2000-2199 reserved for SQL Server
  879. //
  880. #define PERFINFO_LOG_TYPE_SQLSERVER_FIRST (2000)
  881. #define PERFINFO_LOG_TYPE_SQLSERVER_LAST (PERFINFO_LOG_TYPE_SQLSERVER_FIRST + 199)
  882. //
  883. // 2200-2299 reserved for reflection of WMI events
  884. //
  885. #define PERFINFO_LOG_TYPE_WMI_REFLECT_FIRST (2200)
  886. #define PERFINFO_LOG_TYPE_WMI_REFLECT_LAST (PERFINFO_LOG_TYPE_WMI_REFLECT_FIRST + 199)
  887. #endif //0
  888. //
  889. // Data structure used for WMI Kernel Events
  890. //
  891. // **NB** the hardware events are described in software traceing, if they
  892. // change in layout please update sdktools\trace\tracefmt\default.tmf
  893. #define MAX_DEVICE_ID_LENGTH 256
  894. #define CONFIG_MAX_DOMAIN_NAME_LEN 132
  895. typedef struct _CPU_CONFIG_RECORD {
  896. ULONG ProcessorSpeed;
  897. ULONG NumberOfProcessors;
  898. ULONG MemorySize; // in MBytes
  899. ULONG PageSize; // in Bytes
  900. ULONG AllocationGranularity; // in Bytes
  901. WCHAR ComputerName[MAX_DEVICE_ID_LENGTH];
  902. WCHAR DomainName[CONFIG_MAX_DOMAIN_NAME_LEN];
  903. } CPU_CONFIG_RECORD, *PCPU_CONFIG_RECORD;
  904. #define CONFIG_WRITE_CACHE_ENABLED 0x00000001
  905. #define CONFIG_FS_NAME_LEN 16
  906. #define CONFIG_BOOT_DRIVE_LEN 3
  907. typedef struct _PHYSICAL_DISK_RECORD {
  908. ULONG DiskNumber;
  909. ULONG BytesPerSector;
  910. ULONG SectorsPerTrack;
  911. ULONG TracksPerCylinder;
  912. ULONGLONG Cylinders;
  913. ULONG SCSIPortNumber;
  914. ULONG SCSIPathId;
  915. ULONG SCSITargetId;
  916. ULONG SCSILun;
  917. WCHAR Manufacturer[MAX_DEVICE_ID_LENGTH];
  918. ULONG PartitionCount;
  919. BOOLEAN WriteCacheEnabled;
  920. WCHAR BootDriveLetter[CONFIG_BOOT_DRIVE_LEN];
  921. } PHYSICAL_DISK_RECORD, *PPHYSICAL_DISK_RECORD;
  922. //
  923. // Types of logical drive
  924. //
  925. #define CONFIG_DRIVE_PARTITION 0x00000001
  926. #define CONFIG_DRIVE_VOLUME 0x00000002
  927. #define CONFIG_DRIVE_EXTENT 0x00000004
  928. #define CONFIG_DRIVE_LETTER_LEN 4
  929. typedef struct _LOGICAL_DISK_EXTENTS {
  930. ULONGLONG StartingOffset;
  931. ULONGLONG PartitionSize;
  932. ULONG DiskNumber; // The physical disk number where the logical drive resides
  933. ULONG Size; // The size in bytes of the structure.
  934. ULONG DriveType; // Logical drive type partition/volume/extend-partition
  935. WCHAR DriveLetterString[CONFIG_DRIVE_LETTER_LEN];
  936. ULONG Pad;
  937. ULONG PartitionNumber; // The partition number where the logical drive resides
  938. ULONG SectorsPerCluster;
  939. ULONG BytesPerSector;
  940. LONGLONG NumberOfFreeClusters;
  941. LONGLONG TotalNumberOfClusters;
  942. WCHAR FileSystemType[CONFIG_FS_NAME_LEN];
  943. ULONG VolumeExt; // Offset to VOLUME_DISK_EXTENTS structure
  944. } LOGICAL_DISK_EXTENTS, *PLOGICAL_DISK_EXTENTS;
  945. #define CONFIG_MAX_DNS_SERVER 4
  946. #define CONFIG_MAX_ADAPTER_ADDRESS_LENGTH 8
  947. //
  948. // Note: Data is an array of structures of type IP_ADDRESS_STRING defined in iptypes.h
  949. //
  950. typedef struct _NIC_RECORD {
  951. WCHAR NICName[MAX_DEVICE_ID_LENGTH];
  952. ULONG Index;
  953. ULONG PhysicalAddrLen;
  954. WCHAR PhysicalAddr[CONFIG_MAX_ADAPTER_ADDRESS_LENGTH];
  955. ULONG Size; // Size of the Data
  956. LONG IpAddress; // IP Address offset. Copy bytes = sizeof(IP_ADDRESS_STRING)
  957. LONG SubnetMask; // subnet mask offset. Copy bytes = sizeof(IP_ADDRESS_STRING)
  958. LONG DhcpServer; // dhcp server offset. Copy bytes = sizeof(IP_ADDRESS_STRING)
  959. LONG Gateway; // gateway offset. Copy bytes = sizeof(IP_ADDRESS_STRING)
  960. LONG PrimaryWinsServer; // primary wins server offset. Copy bytes = sizeof(IP_ADDRESS_STRING)
  961. LONG SecondaryWinsServer;// secondary wins server offset. Copy bytes = sizeof(IP_ADDRESS_STRING)
  962. LONG DnsServer[CONFIG_MAX_DNS_SERVER]; // dns server offset. Copy bytes = sizeof(IP_ADDRESS_STRING)
  963. ULONG Data; // Offset to an array of IP_ADDRESS_STRING
  964. } NIC_RECORD, *PNIC_RECORD;
  965. typedef struct _VIDEO_RECORD {
  966. ULONG MemorySize;
  967. ULONG XResolution;
  968. ULONG YResolution;
  969. ULONG BitsPerPixel;
  970. ULONG VRefresh;
  971. WCHAR ChipType[MAX_DEVICE_ID_LENGTH];
  972. WCHAR DACType[MAX_DEVICE_ID_LENGTH];
  973. WCHAR AdapterString[MAX_DEVICE_ID_LENGTH];
  974. WCHAR BiosString[MAX_DEVICE_ID_LENGTH];
  975. WCHAR DeviceId[MAX_DEVICE_ID_LENGTH];
  976. ULONG StateFlags;
  977. } VIDEO_RECORD, *PVIDEO_RECORD;
  978. #define CONFIG_MAX_NAME_LENGTH 34
  979. #define CONFIG_MAX_DISPLAY_NAME 256
  980. typedef struct _WMI_SERVICE_INFO {
  981. WCHAR ServiceName[CONFIG_MAX_NAME_LENGTH];
  982. WCHAR DisplayName[CONFIG_MAX_DISPLAY_NAME];
  983. WCHAR ProcessName[CONFIG_MAX_NAME_LENGTH];
  984. ULONG ProcessId;
  985. } WMI_SERVICE_INFO, *PWMI_SERVICE_INFO;
  986. //
  987. // Stores the ACPI Power Information
  988. //
  989. typedef struct _WMI_POWER_RECORD {
  990. BOOLEAN SystemS1;
  991. BOOLEAN SystemS2;
  992. BOOLEAN SystemS3;
  993. BOOLEAN SystemS4; // hibernate
  994. BOOLEAN SystemS5; // off
  995. CHAR Pad1;
  996. CHAR Pad2;
  997. CHAR Pad3;
  998. } WMI_POWER_RECORD, *PWMI_POWER_RECORD;
  999. typedef struct _WMI_PROCESS_INFORMATION {
  1000. ULONG_PTR PageDirectoryBase;
  1001. ULONG ProcessId;
  1002. ULONG ParentId;
  1003. ULONG SessionId;
  1004. NTSTATUS ExitStatus;
  1005. ULONG Sid;
  1006. // Filename is added at the ned of the structure.
  1007. // Since Sid is variable length field,
  1008. // FileName is not defined in the structure.
  1009. } WMI_PROCESS_INFORMATION, *PWMI_PROCESS_INFORMATION;
  1010. typedef struct _WMI_THREAD_INFORMATION {
  1011. ULONG ProcessId;
  1012. ULONG ThreadId;
  1013. } WMI_THREAD_INFORMATION, *PWMI_THREAD_INFORMATION;
  1014. typedef struct _WMI_EXTENDED_THREAD_INFORMATION {
  1015. ULONG ProcessId;
  1016. ULONG ThreadId;
  1017. PVOID StackBase;
  1018. PVOID StackLimit;
  1019. PVOID UserStackBase;
  1020. PVOID UserStackLimit;
  1021. PVOID StartAddr;
  1022. PVOID Win32StartAddr;
  1023. CHAR WaitMode;
  1024. } WMI_EXTENDED_THREAD_INFORMATION, *PWMI_EXTENDED_THREAD_INFORMATION;
  1025. typedef struct _WMI_IMAGELOAD_INFORMATION {
  1026. PVOID ImageBase;
  1027. SIZE_T ImageSize;
  1028. ULONG ProcessId;
  1029. WCHAR FileName[1];
  1030. } WMI_IMAGELOAD_INFORMATION, *PWMI_IMAGELOAD_INFORMATION;
  1031. typedef struct _WMI_DISKIO_READWRITE {
  1032. ULONG DiskNumber;
  1033. ULONG IrpFlags;
  1034. ULONG Size;
  1035. ULONG ResponseTime;
  1036. ULONGLONG ByteOffset;
  1037. PVOID FileObject;
  1038. ULONGLONG HighResResponseTime;
  1039. } WMI_DISKIO_READWRITE, *PWMI_DISKIO_READWRITE;
  1040. typedef struct _WMI_REGISTRY {
  1041. ULONG_PTR Status;
  1042. PVOID Kcb;
  1043. LONGLONG ElapsedTime;
  1044. union{
  1045. ULONG Index;
  1046. ULONG InfoClass;
  1047. };
  1048. WCHAR Name[1];
  1049. } WMI_REGISTRY, *PWMI_REGISTRY;
  1050. typedef struct _WMI_FILE_IO {
  1051. PVOID FileObject;
  1052. WCHAR FileName[1];
  1053. } WMI_FILE_IO, *PWMI_FILE_IO;
  1054. typedef struct _WMI_TCPIP {
  1055. ULONG Context;
  1056. ULONG Size;
  1057. ULONG DestAddr;
  1058. ULONG SrcAddr;
  1059. USHORT DestPort;
  1060. USHORT SrcPort;
  1061. } WMI_TCPIP, *PWMI_TCPIP;
  1062. typedef struct _WMI_UDP {
  1063. ULONG PID;
  1064. USHORT Size;
  1065. ULONG DestAddr;
  1066. ULONG SrcAddr;
  1067. USHORT DestPort;
  1068. USHORT SrcPort;
  1069. }WMI_UDP, *PWMI_UDP;
  1070. typedef struct _WMI_PAGE_FAULT {
  1071. PVOID VirtualAddress;
  1072. PVOID ProgramCounter;
  1073. } WMI_PAGE_FAULT, *PWMI_PAGE_FAULT;
  1074. typedef struct _WMI_CONTEXTSWAP {
  1075. ULONG NewThreadId;
  1076. ULONG OldThreadId;
  1077. CHAR NewThreadPriority;
  1078. CHAR OldThreadPriority;
  1079. CHAR NewThreadQuantum;
  1080. CHAR OldThreadQuantum;
  1081. UCHAR OldThreadWaitReason;
  1082. CHAR OldThreadWaitMode;
  1083. UCHAR OldThreadState;
  1084. UCHAR OldThreadIdealProcessor;
  1085. } WMI_CONTEXTSWAP, *PWMI_CONTEXTSWAP;
  1086. typedef struct _HEAP_EVENT_ALLOC {
  1087. PVOID HeapHandle; //Handle of Heap
  1088. SIZE_T Size; //Size of allocation in bytes
  1089. PVOID Address; //Address of Allocation
  1090. ULONG Source; //Type ie Lookaside, Lowfrag or main path
  1091. }HEAP_EVENT_ALLOC, *PHEAP_EVENT_ALLOC;
  1092. typedef struct _HEAP_EVENT_FREE {
  1093. PVOID HeapHandle; //Handle of Heap
  1094. PVOID Address; //Address to free
  1095. ULONG Source; //Type ie Lookaside, Lowfrag or main path
  1096. }HEAP_EVENT_FREE, *PHEAP_EVENT_FREE;
  1097. typedef struct _HEAP_EVENT_REALLOC {
  1098. PVOID HeapHandle; //Handle of Heap
  1099. PVOID NewAddress; //New Address returned to user
  1100. PVOID OldAddress; //Old Address got from user
  1101. SIZE_T NewSize; //New Size in bytes
  1102. SIZE_T OldSize; //Old Size in bytes
  1103. ULONG Source; //Type ie Lookaside, Lowfrag or main path
  1104. }HEAP_EVENT_REALLOC, *PHEAP_EVENT_REALLOC;
  1105. typedef struct _HEAP_EVENT_EXPANSION {
  1106. PVOID HeapHandle; //Handle of Heap
  1107. SIZE_T CommittedSize; //Memory Size in bytes actually committed
  1108. PVOID Address; //Address of free block or segment
  1109. SIZE_T FreeSpace; //Total free Space in Heap
  1110. SIZE_T CommittedSpace; //Memory Committed
  1111. SIZE_T ReservedSpace; //Memory reserved
  1112. ULONG NoOfUCRs; //Number of UnCommitted Ranges
  1113. }HEAP_EVENT_EXPANSION, *PHEAP_EVENT_EXPANSION;
  1114. typedef struct _HEAP_EVENT_CONTRACTION {
  1115. PVOID HeapHandle; //Handle of Heap
  1116. SIZE_T DeCommitSize; //The size of DeCommitted Block
  1117. PVOID DeCommitAddress; //Address of the Decommitted block
  1118. SIZE_T FreeSpace; //Total free Space in Heap in bytes
  1119. SIZE_T CommittedSpace; //Memory Committed in bytes
  1120. SIZE_T ReservedSpace; //Memory reserved in bytes
  1121. ULONG NoOfUCRs; //Number of UnCommitted Ranges
  1122. }HEAP_EVENT_CONTRACTION, *PHEAP_EVENT_CONTRACTION;
  1123. typedef struct _HEAP_EVENT_CREATE {
  1124. PVOID HeapHandle; //Handle of Heap
  1125. ULONG Flags; //Flags passed while creating heap.
  1126. }HEAP_EVENT_CREATE, *PHEAP_EVENT_CREATE;
  1127. typedef struct _CRIT_SEC_COLLISION_EVENT_DATA {
  1128. ULONG LockCount; //Lock Count
  1129. PVOID SpinCount; //Spin Count
  1130. PVOID OwningThread; //Thread having Lock
  1131. PVOID Address; //Adress of Critical Section
  1132. }CRIT_SEC_COLLISION_EVENT_DATA, *PCRIT_SEC_COLLISION_EVENT_DATA;
  1133. //
  1134. // Additional Guid used for NTPERF
  1135. //
  1136. DEFINE_GUID( /* 0268a8b6-74fd-4302-9dd0-6e8f1795c0cf */
  1137. PoolGuid,
  1138. 0x0268a8b6,
  1139. 0x74fd,
  1140. 0x4302,
  1141. 0x9d, 0xd0, 0x6e, 0x8f, 0x17, 0x95, 0xc0, 0xcf
  1142. );
  1143. DEFINE_GUID( /* ce1dbfb4-137e-4da6-87b0-3f59aa102cbc */
  1144. PerfinfoGuid,
  1145. 0xce1dbfb4,
  1146. 0x137e,
  1147. 0x4da6,
  1148. 0x87, 0xb0, 0x3f, 0x59, 0xaa, 0x10, 0x2c, 0xbc
  1149. );
  1150. DEFINE_GUID( /* 222962ab-6180-4b88-a825-346b75f2a24a */
  1151. HeapGuid,
  1152. 0x222962ab,
  1153. 0x6180,
  1154. 0x4b88,
  1155. 0xa8, 0x25, 0x34, 0x6b, 0x75, 0xf2, 0xa2, 0x4a
  1156. );
  1157. DEFINE_GUID ( /* 3AC66736-CC59-4cff-8115-8DF50E39816B */
  1158. CritSecGuid,
  1159. 0x3ac66736,
  1160. 0xcc59,
  1161. 0x4cff,
  1162. 0x81, 0x15, 0x8d, 0xf5, 0xe, 0x39, 0x81, 0x6b
  1163. );
  1164. DEFINE_GUID ( /* E21D2142-DF90-4d93-BBD9-30E63D5A4AD6 */
  1165. NtdllTraceGuid,
  1166. 0xe21d2142,
  1167. 0xdf90,
  1168. 0x4d93,
  1169. 0xbb, 0xd9, 0x30, 0xe6, 0x3d, 0x5a, 0x4a, 0xd6
  1170. );
  1171. DEFINE_GUID( /* 89497f50-effe-4440-8cf2-ce6b1cdcaca7 */
  1172. ObjectGuid,
  1173. 0x89497f50,
  1174. 0xeffe,
  1175. 0x4440,
  1176. 0x8c, 0xf2, 0xce, 0x6b, 0x1c, 0xdc, 0xac, 0xa7
  1177. );
  1178. DEFINE_GUID( /* a9152f00-3f58-4bee-92a1-70c7d079d5dd */
  1179. ModBoundGuid,
  1180. 0xa9152f00,
  1181. 0x3f58,
  1182. 0x4bee,
  1183. 0x92, 0xa1, 0x70, 0xc7, 0xd0, 0x79, 0xd5, 0xdd
  1184. );
  1185. DEFINE_GUID ( /* E43445E0-0903-48c3-B878-FF0FCCEBDD04 */
  1186. PowerGuid,
  1187. 0xe43445e0,
  1188. 0x903,
  1189. 0x48c3,
  1190. 0xb8, 0x78, 0xff, 0xf, 0xcc, 0xeb, 0xdd, 0x4
  1191. );
  1192. DEFINE_GUID ( /* b2d14872-7c5b-463d-8419-ee9bf7d23e04 */
  1193. DpcGuid,
  1194. 0xb2d14872,
  1195. 0x7c5b,
  1196. 0x463d,
  1197. 0x84, 0x19, 0xee, 0x9b, 0xf7, 0xd2, 0x3e, 0x04
  1198. );
  1199. #endif // ifndef ETW_WOW6432
  1200. //
  1201. // The following flags denotes what Fields actually contains
  1202. //
  1203. #define ETW_NT_FLAGS_TRACE_HEADER 0X00000001 // Contiguous Event Trace Header
  1204. #define ETW_NT_FLAGS_TRACE_MESSAGE 0X00000002 // Trace Message
  1205. NTSYSCALLAPI
  1206. NTSTATUS
  1207. NTAPI
  1208. NtTraceEvent(
  1209. IN HANDLE TraceHandle,
  1210. IN ULONG Flags,
  1211. IN ULONG FieldSize,
  1212. IN PVOID Fields
  1213. );
  1214. #endif // _NTWMI_