PdhCalculateCounterFromRawValue function (pdh.h)
Calculates the displayable value of two raw counter values.
Syntax
PDH_FUNCTION PdhCalculateCounterFromRawValue(
[in] PDH_HCOUNTER hCounter,
[in] DWORD dwFormat,
[in] PPDH_RAW_COUNTER rawValue1,
[in] PPDH_RAW_COUNTER rawValue2,
[out] PPDH_FMT_COUNTERVALUE fmtValue
);
Parameters
[in] hCounter
Handle to the counter to calculate. The function uses information from the counter to determine how to calculate the value. This handle is returned by the PdhAddCounter function.
[in] dwFormat
Determines the data type of the calculated 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] rawValue1
Raw counter value used to compute the displayable counter value. For details, see the PDH_RAW_COUNTER structure.
[in] rawValue2
Raw counter value used to compute the displayable counter value. For details, see PDH_RAW_COUNTER. Some counters (for example, rate counters) require two raw values to calculate a displayable value. If the counter type does not require a second value, set this parameter to NULL. This value must be the older of the two raw values.
[out] fmtValue
A PDH_FMT_COUNTERVALUE structure that receives the calculated counter value.
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. |
Remarks
To retrieve the current raw counter value from the query, call the PdhGetRawCounterValue function.
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 |