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.

539 lines
26 KiB

  1. /*++
  2. Copyright (C) 1993 - 1995 Microsoft Corporation
  3. Module Name:
  4. winperf.h
  5. Abstract:
  6. Header file for the Performance Monitor data.
  7. This file contains the definitions of the data structures returned
  8. by the Configuration Registry in response to a request for
  9. performance data. This file is used by both the Configuration
  10. Registry and the Performance Monitor to define their interface.
  11. The complete interface is described here, except for the name
  12. of the node to query in the registry. It is
  13. HKEY_PERFORMANCE_DATA.
  14. By querying that node with a subkey of "Global" the caller will
  15. retrieve the structures described here.
  16. There is no need to RegOpenKey() the reserved handle HKEY_PERFORMANCE_DATA,
  17. but the caller should RegCloseKey() the handle so that network transports
  18. and drivers can be removed or installed (which cannot happen while
  19. they are open for monitoring.) Remote requests must first
  20. RegConnectRegistry().
  21. --*/
  22. #ifndef _WINPERF_
  23. #define _WINPERF_
  24. // Data structure definitions.
  25. // In order for data to be returned through the Configuration Registry
  26. // in a system-independent fashion, it must be self-describing.
  27. // In the following, all offsets are in bytes.
  28. //
  29. // Data is returned through the Configuration Registry in a
  30. // a data block which begins with a _PERF_DATA_BLOCK structure.
  31. //
  32. #define PERF_DATA_VERSION 1
  33. #define PERF_DATA_REVISION 1
  34. typedef struct _PERF_DATA_BLOCK {
  35. WCHAR Signature[4]; // Signature: Unicode "PERF"
  36. DWORD LittleEndian; // 0 = Big Endian, 1 = Little Endian
  37. DWORD Version; // Version of these data structures
  38. // starting at 1
  39. DWORD Revision; // Revision of these data structures
  40. // starting at 0 for each Version
  41. DWORD TotalByteLength; // Total length of data block
  42. DWORD HeaderLength; // Length of this structure
  43. DWORD NumObjectTypes; // Number of types of objects
  44. // being reported
  45. LONG DefaultObject; // Object Title Index of default
  46. // object to display when data from
  47. // this system is retrieved (-1 =
  48. // none, but this is not expected to
  49. // be used)
  50. SYSTEMTIME SystemTime; // Time at the system under
  51. // measurement
  52. LARGE_INTEGER PerfTime; // Performance counter value
  53. // at the system under measurement
  54. LARGE_INTEGER PerfFreq; // Performance counter frequency
  55. // at the system under measurement
  56. LARGE_INTEGER PerfTime100nSec; // Performance counter time in 100 nsec
  57. // units at the system under measurement
  58. DWORD SystemNameLength; // Length of the system name
  59. DWORD SystemNameOffset; // Offset, from beginning of this
  60. // structure, to name of system
  61. // being measured
  62. } PERF_DATA_BLOCK, *PPERF_DATA_BLOCK;
  63. //
  64. // The _PERF_DATA_BLOCK structure is followed by NumObjectTypes of
  65. // data sections, one for each type of object measured. Each object
  66. // type section begins with a _PERF_OBJECT_TYPE structure.
  67. //
  68. typedef struct _PERF_OBJECT_TYPE {
  69. DWORD TotalByteLength; // Length of this object definition
  70. // including this structure, the
  71. // counter definitions, and the
  72. // instance definitions and the
  73. // counter blocks for each instance:
  74. // This is the offset from this
  75. // structure to the next object, if
  76. // any
  77. DWORD DefinitionLength; // Length of object definition,
  78. // which includes this structure
  79. // and the counter definition
  80. // structures for this object: this
  81. // is the offset of the first
  82. // instance or of the counters
  83. // for this object if there is
  84. // no instance
  85. DWORD HeaderLength; // Length of this structure: this
  86. // is the offset to the first
  87. // counter definition for this
  88. // object
  89. DWORD ObjectNameTitleIndex;
  90. // Index to name in Title Database
  91. LPWSTR ObjectNameTitle; // Initially NULL, for use by
  92. // analysis program to point to
  93. // retrieved title string
  94. DWORD ObjectHelpTitleIndex;
  95. // Index to Help in Title Database
  96. LPWSTR ObjectHelpTitle; // Initially NULL, for use by
  97. // analysis program to point to
  98. // retrieved title string
  99. DWORD DetailLevel; // Object level of detail (for
  100. // controlling display complexity);
  101. // will be min of detail levels
  102. // for all this object's counters
  103. DWORD NumCounters; // Number of counters in each
  104. // counter block (one counter
  105. // block per instance)
  106. LONG DefaultCounter; // Default counter to display when
  107. // this object is selected, index
  108. // starting at 0 (-1 = none, but
  109. // this is not expected to be used)
  110. LONG NumInstances; // Number of object instances
  111. // for which counters are being
  112. // returned from the system under
  113. // measurement. If the object defined
  114. // will never have any instance data
  115. // structures (PERF_INSTANCE_DEFINITION)
  116. // then this value should be -1, if the
  117. // object can have 0 or more instances,
  118. // but has none present, then this
  119. // should be 0, otherwise this field
  120. // contains the number of instances of
  121. // this counter.
  122. DWORD CodePage; // 0 if instance strings are in
  123. // UNICODE, else the Code Page of
  124. // the instance names
  125. LARGE_INTEGER PerfTime; // Sample Time in "Object" units
  126. //
  127. LARGE_INTEGER PerfFreq; // Frequency of "Object" units in
  128. // counts per second.
  129. } PERF_OBJECT_TYPE, *PPERF_OBJECT_TYPE;
  130. #define PERF_NO_INSTANCES -1 // no instances (see NumInstances above)
  131. //
  132. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  133. //
  134. // PERF_COUNTER_DEFINITION.CounterType field values
  135. //
  136. //
  137. // Counter ID Field Definition:
  138. //
  139. // 3 2 2 2 2 1 1 1
  140. // 1 8 4 2 0 6 2 0 8 0
  141. // +--------+--------+----+----+--------+--------+----+----+----------------+
  142. // |Display |Calculation |Time|Counter | |Ctr |Size| |
  143. // |Flags |Modifiers |Base|SubType |Reserved|Type|Fld | Reserved |
  144. // +--------+--------+----+----+--------+--------+----+----+----------------+
  145. //
  146. //
  147. // The counter type is the "or" of the following values as described below
  148. //
  149. // select one of the following to indicate the counter's data size
  150. //
  151. #define PERF_SIZE_DWORD 0x00000000
  152. #define PERF_SIZE_LARGE 0x00000100
  153. #define PERF_SIZE_ZERO 0x00000200 // for Zero Length fields
  154. #define PERF_SIZE_VARIABLE_LEN 0x00000300 // length is in CounterLength field
  155. // of Counter Definition struct
  156. //
  157. // select one of the following values to indicate the counter field usage
  158. //
  159. #define PERF_TYPE_NUMBER 0x00000000 // a number (not a counter)
  160. #define PERF_TYPE_COUNTER 0x00000400 // an increasing numeric value
  161. #define PERF_TYPE_TEXT 0x00000800 // a text field
  162. #define PERF_TYPE_ZERO 0x00000C00 // displays a zero
  163. //
  164. // If the PERF_TYPE_NUMBER field was selected, then select one of the
  165. // following to describe the Number
  166. //
  167. #define PERF_NUMBER_HEX 0x00000000 // display as HEX value
  168. #define PERF_NUMBER_DECIMAL 0x00010000 // display as a decimal integer
  169. #define PERF_NUMBER_DEC_1000 0x00020000 // display as a decimal/1000
  170. //
  171. // If the PERF_TYPE_COUNTER value was selected then select one of the
  172. // following to indicate the type of counter
  173. //
  174. #define PERF_COUNTER_VALUE 0x00000000 // display counter value
  175. #define PERF_COUNTER_RATE 0x00010000 // divide ctr / delta time
  176. #define PERF_COUNTER_FRACTION 0x00020000 // divide ctr / base
  177. #define PERF_COUNTER_BASE 0x00030000 // base value used in fractions
  178. #define PERF_COUNTER_ELAPSED 0x00040000 // subtract counter from current time
  179. #define PERF_COUNTER_QUEUELEN 0x00050000 // Use Queuelen processing func.
  180. #define PERF_COUNTER_HISTOGRAM 0x00060000 // Counter begins or ends a histogram
  181. //
  182. // If the PERF_TYPE_TEXT value was selected, then select one of the
  183. // following to indicate the type of TEXT data.
  184. //
  185. #define PERF_TEXT_UNICODE 0x00000000 // type of text in text field
  186. #define PERF_TEXT_ASCII 0x00010000 // ASCII using the CodePage field
  187. //
  188. // Timer SubTypes
  189. //
  190. #define PERF_TIMER_TICK 0x00000000 // use system perf. freq for base
  191. #define PERF_TIMER_100NS 0x00100000 // use 100 NS timer time base units
  192. #define PERF_OBJECT_TIMER 0x00200000 // use the object timer freq
  193. //
  194. // Any types that have calculations performed can use one or more of
  195. // the following calculation modification flags listed here
  196. //
  197. #define PERF_DELTA_COUNTER 0x00400000 // compute difference first
  198. #define PERF_DELTA_BASE 0x00800000 // compute base diff as well
  199. #define PERF_INVERSE_COUNTER 0x01000000 // show as 1.00-value (assumes:
  200. #define PERF_MULTI_COUNTER 0x02000000 // sum of multiple instances
  201. //
  202. // Select one of the following values to indicate the display suffix (if any)
  203. //
  204. #define PERF_DISPLAY_NO_SUFFIX 0x00000000 // no suffix
  205. #define PERF_DISPLAY_PER_SEC 0x10000000 // "/sec"
  206. #define PERF_DISPLAY_PERCENT 0x20000000 // "%"
  207. #define PERF_DISPLAY_SECONDS 0x30000000 // "secs"
  208. #define PERF_DISPLAY_NOSHOW 0x40000000 // value is not displayed
  209. //
  210. // Predefined counter types
  211. //
  212. // 32-bit Counter. Divide delta by delta time. Display suffix: "/sec"
  213. #define PERF_COUNTER_COUNTER \
  214. (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
  215. PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PER_SEC)
  216. // 64-bit Timer. Divide delta by delta time. Display suffix: "%"
  217. #define PERF_COUNTER_TIMER \
  218. (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
  219. PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT)
  220. // Queue Length Space-Time Product. Divide delta by delta time. No Display Suffix.
  221. #define PERF_COUNTER_QUEUELEN_TYPE \
  222. (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_QUEUELEN |\
  223. PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
  224. // 64-bit Counter. Divide delta by delta time. Display Suffix: "/sec"
  225. #define PERF_COUNTER_BULK_COUNT \
  226. (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
  227. PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PER_SEC)
  228. // Indicates the counter is not a counter but rather Unicode text Display as text.
  229. #define PERF_COUNTER_TEXT \
  230. (PERF_SIZE_VARIABLE_LEN | PERF_TYPE_TEXT | PERF_TEXT_UNICODE |\
  231. PERF_DISPLAY_NO_SUFFIX)
  232. // Indicates the data is a counter which should not be
  233. // time averaged on display (such as an error counter on a serial line)
  234. // Display as is. No Display Suffix.
  235. #define PERF_COUNTER_RAWCOUNT \
  236. (PERF_SIZE_DWORD | PERF_TYPE_NUMBER | PERF_NUMBER_DECIMAL |\
  237. PERF_DISPLAY_NO_SUFFIX)
  238. // Same as PERF_COUNTER_RAWCOUNT except its size is a large integer
  239. #define PERF_COUNTER_LARGE_RAWCOUNT \
  240. (PERF_SIZE_LARGE | PERF_TYPE_NUMBER | PERF_NUMBER_DECIMAL |\
  241. PERF_DISPLAY_NO_SUFFIX)
  242. // Special case for RAWCOUNT that want to be displayed in hex
  243. // Indicates the data is a counter which should not be
  244. // time averaged on display (such as an error counter on a serial line)
  245. // Display as is. No Display Suffix.
  246. #define PERF_COUNTER_RAWCOUNT_HEX \
  247. (PERF_SIZE_DWORD | PERF_TYPE_NUMBER | PERF_NUMBER_HEX |\
  248. PERF_DISPLAY_NO_SUFFIX)
  249. // Same as PERF_COUNTER_RAWCOUNT_HEX except its size is a large integer
  250. #define PERF_COUNTER_LARGE_RAWCOUNT_HEX \
  251. (PERF_SIZE_LARGE | PERF_TYPE_NUMBER | PERF_NUMBER_HEX |\
  252. PERF_DISPLAY_NO_SUFFIX)
  253. // A count which is either 1 or 0 on each sampling interrupt (% busy)
  254. // Divide delta by delta base. Display Suffix: "%"
  255. #define PERF_SAMPLE_FRACTION \
  256. (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION |\
  257. PERF_DELTA_COUNTER | PERF_DELTA_BASE | PERF_DISPLAY_PERCENT)
  258. // A count which is sampled on each sampling interrupt (queue length)
  259. // Divide delta by delta time. No Display Suffix.
  260. #define PERF_SAMPLE_COUNTER \
  261. (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
  262. PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
  263. // A label: no data is associated with this counter (it has 0 length)
  264. // Do not display.
  265. #define PERF_COUNTER_NODATA \
  266. (PERF_SIZE_ZERO | PERF_DISPLAY_NOSHOW)
  267. // 64-bit Timer inverse (e.g., idle is measured, but display busy %)
  268. // Display 100 - delta divided by delta time. Display suffix: "%"
  269. #define PERF_COUNTER_TIMER_INV \
  270. (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
  271. PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_INVERSE_COUNTER | \
  272. PERF_DISPLAY_PERCENT)
  273. // The divisor for a sample, used with the previous counter to form a
  274. // sampled %. You must check for >0 before dividing by this! This
  275. // counter will directly follow the numerator counter. It should not
  276. // be displayed to the user.
  277. #define PERF_SAMPLE_BASE \
  278. (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_BASE |\
  279. PERF_DISPLAY_NOSHOW |\
  280. 0x00000001) // for compatibility with pre-beta versions
  281. // A timer which, when divided by an average base, produces a time
  282. // in seconds which is the average time of some operation. This
  283. // timer times total operations, and the base is the number of opera-
  284. // tions. Display Suffix: "sec"
  285. #define PERF_AVERAGE_TIMER \
  286. (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION |\
  287. PERF_DISPLAY_SECONDS)
  288. // Used as the denominator in the computation of time or count
  289. // averages. Must directly follow the numerator counter. Not dis-
  290. // played to the user.
  291. #define PERF_AVERAGE_BASE \
  292. (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_BASE |\
  293. PERF_DISPLAY_NOSHOW |\
  294. 0x00000002) // for compatibility with pre-beta versions
  295. // A bulk count which, when divided (typically) by the number of
  296. // operations, gives (typically) the number of bytes per operation.
  297. // No Display Suffix.
  298. #define PERF_AVERAGE_BULK \
  299. (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION |\
  300. PERF_DISPLAY_NOSHOW)
  301. // 64-bit Timer in 100 nsec units. Display delta divided by
  302. // delta time. Display suffix: "%"
  303. #define PERF_100NSEC_TIMER \
  304. (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
  305. PERF_TIMER_100NS | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT)
  306. // 64-bit Timer inverse (e.g., idle is measured, but display busy %)
  307. // Display 100 - delta divided by delta time. Display suffix: "%"
  308. #define PERF_100NSEC_TIMER_INV \
  309. (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
  310. PERF_TIMER_100NS | PERF_DELTA_COUNTER | PERF_INVERSE_COUNTER |\
  311. PERF_DISPLAY_PERCENT)
  312. // 64-bit Timer. Divide delta by delta time. Display suffix: "%"
  313. // Timer for multiple instances, so result can exceed 100%.
  314. #define PERF_COUNTER_MULTI_TIMER \
  315. (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
  316. PERF_DELTA_COUNTER | PERF_TIMER_TICK | PERF_MULTI_COUNTER |\
  317. PERF_DISPLAY_PERCENT)
  318. // 64-bit Timer inverse (e.g., idle is measured, but display busy %)
  319. // Display 100 * _MULTI_BASE - delta divided by delta time.
  320. // Display suffix: "%" Timer for multiple instances, so result
  321. // can exceed 100%. Followed by a counter of type _MULTI_BASE.
  322. #define PERF_COUNTER_MULTI_TIMER_INV \
  323. (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
  324. PERF_DELTA_COUNTER | PERF_MULTI_COUNTER | PERF_TIMER_TICK |\
  325. PERF_INVERSE_COUNTER | PERF_DISPLAY_PERCENT)
  326. // Number of instances to which the preceding _MULTI_..._INV counter
  327. // applies. Used as a factor to get the percentage.
  328. #define PERF_COUNTER_MULTI_BASE \
  329. (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_BASE |\
  330. PERF_MULTI_COUNTER | PERF_DISPLAY_NOSHOW)
  331. // 64-bit Timer in 100 nsec units. Display delta divided by delta time.
  332. // Display suffix: "%" Timer for multiple instances, so result can exceed 100%.
  333. #define PERF_100NSEC_MULTI_TIMER \
  334. (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_DELTA_COUNTER |\
  335. PERF_COUNTER_RATE | PERF_TIMER_100NS | PERF_MULTI_COUNTER |\
  336. PERF_DISPLAY_PERCENT)
  337. // 64-bit Timer inverse (e.g., idle is measured, but display busy %)
  338. // Display 100 * _MULTI_BASE - delta divided by delta time.
  339. // Display suffix: "%" Timer for multiple instances, so result
  340. // can exceed 100%. Followed by a counter of type _MULTI_BASE.
  341. #define PERF_100NSEC_MULTI_TIMER_INV \
  342. (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_DELTA_COUNTER |\
  343. PERF_COUNTER_RATE | PERF_TIMER_100NS | PERF_MULTI_COUNTER |\
  344. PERF_INVERSE_COUNTER | PERF_DISPLAY_PERCENT)
  345. // Indicates the data is a fraction of the following counter which
  346. // should not be time averaged on display (such as free space over
  347. // total space.) Display as is. Display the quotient as "%".
  348. #define PERF_RAW_FRACTION \
  349. (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION |\
  350. PERF_DISPLAY_PERCENT)
  351. // Indicates the data is a base for the preceding counter which should
  352. // not be time averaged on display (such as free space over total space.)
  353. #define PERF_RAW_BASE \
  354. (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_BASE |\
  355. PERF_DISPLAY_NOSHOW |\
  356. 0x00000003) // for compatibility with pre-beta versions
  357. // The data collected in this counter is actually the start time of the
  358. // item being measured. For display, this data is subtracted from the
  359. // sample time to yield the elapsed time as the difference between the two.
  360. // In the definition below, the PerfTime field of the Object contains
  361. // the sample time as indicated by the PERF_OBJECT_TIMER bit and the
  362. // difference is scaled by the PerfFreq of the Object to convert the time
  363. // units into seconds.
  364. #define PERF_ELAPSED_TIME \
  365. (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_ELAPSED |\
  366. PERF_OBJECT_TIMER | PERF_DISPLAY_SECONDS)
  367. //
  368. // The following counter type can be used with the preceding types to
  369. // define a range of values to be displayed in a histogram.
  370. //
  371. #define PERF_COUNTER_HISTOGRAM_TYPE 0x80000000
  372. // Counter begins or ends a histogram
  373. //
  374. // The following are used to determine the level of detail associated
  375. // with the counter. The user will be setting the level of detail
  376. // that should be displayed at any given time.
  377. //
  378. #define PERF_DETAIL_NOVICE 100 // The uninformed can understand it
  379. #define PERF_DETAIL_ADVANCED 200 // For the advanced user
  380. #define PERF_DETAIL_EXPERT 300 // For the expert user
  381. #define PERF_DETAIL_WIZARD 400 // For the system designer
  382. //
  383. // There is one of the following for each of the
  384. // PERF_OBJECT_TYPE.NumCounters. The Unicode names in this structure MUST
  385. // come from a message file.
  386. //
  387. typedef struct _PERF_COUNTER_DEFINITION {
  388. DWORD ByteLength; // Length in bytes of this structure
  389. DWORD CounterNameTitleIndex;
  390. // Index of Counter name into
  391. // Title Database
  392. LPWSTR CounterNameTitle; // Initially NULL, for use by
  393. // analysis program to point to
  394. // retrieved title string
  395. DWORD CounterHelpTitleIndex;
  396. // Index of Counter Help into
  397. // Title Database
  398. LPWSTR CounterHelpTitle; // Initially NULL, for use by
  399. // analysis program to point to
  400. // retrieved title string
  401. LONG DefaultScale; // Power of 10 by which to scale
  402. // chart line if vertical axis is 100
  403. // 0 ==> 1, 1 ==> 10, -1 ==>1/10, etc.
  404. DWORD DetailLevel; // Counter level of detail (for
  405. // controlling display complexity)
  406. DWORD CounterType; // Type of counter
  407. DWORD CounterSize; // Size of counter in bytes
  408. DWORD CounterOffset; // Offset from the start of the
  409. // PERF_COUNTER_BLOCK to the first
  410. // byte of this counter
  411. } PERF_COUNTER_DEFINITION, *PPERF_COUNTER_DEFINITION;
  412. //
  413. // If (PERF_DATA_BLOCK.NumInstances >= 0) then there will be
  414. // PERF_DATA_BLOCK.NumInstances of a (PERF_INSTANCE_DEFINITION
  415. // followed by a PERF_COUNTER_BLOCK followed by the counter data fields)
  416. // for each instance.
  417. //
  418. // If (PERF_DATA_BLOCK.NumInstances < 0) then the counter definition
  419. // strucutre above will be followed by only a PERF_COUNTER_BLOCK and the
  420. // counter data for that COUNTER.
  421. //
  422. #define PERF_NO_UNIQUE_ID -1
  423. typedef struct _PERF_INSTANCE_DEFINITION {
  424. DWORD ByteLength; // Length in bytes of this structure,
  425. // including the subsequent name
  426. DWORD ParentObjectTitleIndex;
  427. // Title Index to name of "parent"
  428. // object (e.g., if thread, then
  429. // process is parent object type);
  430. // if logical drive, the physical
  431. // drive is parent object type
  432. DWORD ParentObjectInstance;
  433. // Index to instance of parent object
  434. // type which is the parent of this
  435. // instance.
  436. LONG UniqueID; // A unique ID used instead of
  437. // matching the name to identify
  438. // this instance, -1 = none
  439. DWORD NameOffset; // Offset from beginning of
  440. // this struct to the Unicode name
  441. // of this instance
  442. DWORD NameLength; // Length in bytes of name; 0 = none
  443. } PERF_INSTANCE_DEFINITION, *PPERF_INSTANCE_DEFINITION;
  444. //
  445. // If .ParentObjectName is 0, there
  446. // is no parent-child hierarchy for this object type. Otherwise,
  447. // the .ParentObjectInstance is an index, starting at 0, into the
  448. // instances reported for the parent object type. It is only
  449. // meaningful if .ParentObjectName is not 0. The purpose of all this
  450. // is to permit reporting/summation of object instances like threads
  451. // within processes, and logical drives within physical drives.
  452. //
  453. //
  454. // The PERF_INSTANCE_DEFINITION will be followed by a PERF_COUNTER_BLOCK.
  455. //
  456. typedef struct _PERF_COUNTER_BLOCK {
  457. DWORD ByteLength; // Length in bytes of this structure,
  458. // including the following counters
  459. } PERF_COUNTER_BLOCK, *PPERF_COUNTER_BLOCK;
  460. //
  461. // The PERF_COUNTER_BLOCK is followed by PERF_OBJECT_TYPE.NumCounters
  462. // number of counters.
  463. //
  464. //
  465. // function typedefs for extensible counter function prototypes
  466. //
  467. typedef DWORD (APIENTRY PM_OPEN_PROC) (LPWSTR);
  468. typedef DWORD (APIENTRY PM_COLLECT_PROC) (LPWSTR, LPVOID *, LPDWORD, LPDWORD);
  469. typedef DWORD (APIENTRY PM_CLOSE_PROC) (void);
  470. #endif // _WINPERF_