PdhComputeCounterStatistics function (pdh.h)
Computes statistics for a counter from an array of raw values.
PDH_FUNCTION PdhComputeCounterStatistics( [in] PDH_HCOUNTER hCounter, [in] DWORD dwFormat, [in] DWORD dwFirstEntry, [in] DWORD dwNumEntries, [in] PPDH_RAW_COUNTER lpRawValueArray, [out] PPDH_STATISTICS data );
Handle of the counter for which you want to compute statistics. The PdhAddCounter function returns this handle.
Determines the data type of the formatted value. Specify one of the following values.
||Return the calculated value as a double-precision floating point real.|
||Return the calculated value as a 64-bit integer.|
||Return the calculated value as a long integer.|
You can use the bitwise inclusive OR operator (|) to combine the data type with one of the following scaling factors.
Zero-based index of the first raw counter value to use to begin the calculations. The index value must point to the oldest entry in the buffer. The function starts at this entry and scans through the buffer, wrapping at the last entry back to the beginning of the buffer and up to the dwFirstEntry-1 entry, which is assumed to be the newest or most recent data.
Number of raw counter values in the lpRawValueArray buffer.
Array of PDH_RAW_COUNTER structures that contain dwNumEntries entries.
A PDH_STATISTICS structure that receives the counter statistics.
If the function succeeds, it returns ERROR_SUCCESS.
||An argument is not correct or is incorrectly formatted.|
||The counter handle is not valid.|
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|