Calculating statistical values can be difficult, because many counter values are the result of a change over time. The PDH provides functions that perform calculations (such as minimum, maximum, and average values) on the raw counter data for you.
To retrieve the raw data for a counter to use in calculating statistical data, you must use the PdhGetRawCounterValue function. The raw values must be stored in an array of PDH_RAW_COUNTER structures allocated and maintained by the application. The raw values used to calculate the minimum, maximum, and average values.
After you have retrieved the raw data for a counter, call the PdhComputeCounterStatistics function to perform the necessary calculations on the raw data.