PdhComputeCounterStatistics function (pdh.h)
Computes statistics for a counter from an array of raw values.
Syntax
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
);
Parameters
[in] hCounter
Handle of the counter for which you want to compute statistics. The PdhAddCounter function returns this handle.
[in] dwFormat
Determines the data type of the formatted value. Specify one of the following values.
You can use the bitwise inclusive OR operator (|) to combine the data type with one of the following scaling factors.
[in] dwFirstEntry
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.
[in] dwNumEntries
Number of raw counter values in the lpRawValueArray buffer.
[in] lpRawValueArray
Array of PDH_RAW_COUNTER structures that contain dwNumEntries entries.
[out] data
A PDH_STATISTICS structure that receives the counter statistics.
Return value
If the function succeeds, it returns ERROR_SUCCESS.
If the function fails, the return value is a system error code or a PDH error code. The following are possible values.
Return code | Description |
---|---|
|
An argument is not correct or is incorrectly formatted. |
|
The counter handle is not valid. |
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | pdh.h |
Library | Pdh.lib |
DLL | Pdh.dll |