CPUUsage(Windows): add new method using Windows Performance Library

This commit is contained in:
李通洲
2025-07-01 20:53:46 +08:00
parent d5b56be4ff
commit 4abb183735
5 changed files with 139 additions and 0 deletions
+7
View File
@@ -63,6 +63,13 @@ typedef struct _PERF_COUNTER_HEADER {
// If dwType == PERF_COUNTERSET: PERF_MULTI_COUNTERS block + PERF_MULTI_INSTANCES block.
} PERF_COUNTER_HEADER, * PPERF_COUNTER_HEADER;
typedef struct _PERF_MULTI_INSTANCES {
ULONG dwTotalSize; // = sizeof(PERF_MULTI_INSTANCES) + sizeof(instance data blocks...)
ULONG dwInstances; // Number of instance data blocks.
// Followed by:
// Instance data blocks...;
} PERF_MULTI_INSTANCES, * PPERF_MULTI_INSTANCES;
typedef struct _PERF_MULTI_COUNTERS {
ULONG dwSize; // sizeof(PERF_MULTI_COUNTERS) + sizeof(CounterIds)
ULONG dwCounters; // Number of counter ids.