PdhFormatFromRawValue function (pdh.h)
Computes a displayable value for the given raw counter values.
Syntax
PDH_FUNCTION PdhFormatFromRawValue(
[in] DWORD dwCounterType,
[in] DWORD dwFormat,
[in] LONGLONG *pTimeBase,
[in] PPDH_RAW_COUNTER pRawValue1,
[in] PPDH_RAW_COUNTER pRawValue2,
[out] PPDH_FMT_COUNTERVALUE pFmtValue
);
Parameters
[in] dwCounterType
Type of counter. Typically, you call PdhGetCounterInfo to retrieve the counter type at the time you call PdhGetRawCounterValue to retrieve the raw counter value.
For a list of counter types, see the Counter Types section of the Windows Server 2003 Deployment Kit. (The constant values are defined in Winperf.h.)
Note that you cannot specify base types, for example, PERF_LARGE_RAW_BASE.
[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] pTimeBase
Pointer to the time base, if necessary for the format conversion. If time base information is not necessary for the format conversion, the value of this parameter is ignored. To retrieve the time base of the counter, call PdhGetCounterTimeBase.
[in] pRawValue1
Raw counter value used to compute the displayable counter value. For details, see PDH_RAW_COUNTER.
[in] pRawValue2
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] pFmtValue
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.
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 |