Platform SDK: Performance Monitoring |
The PdhCalculateCounterFromRawValue function computes the current value of a counter as referenced by the hCounter parameter, using the raw counter data passed in the parameter list.
PDH_STATUS PdhCalculateCounterFromRawValue( HCOUNTER hCounter, DWORD dwFormat, PPDH_RAW_COUNTER rawValue1, PPDH_RAW_COUNTER rawValue2, PPDH_FMT_COUNTERVALUE fmtValue );
Value | Meaning |
---|---|
PDH_FMT_DOUBLE | Return the calculated value as a double-precision floating point real. |
PDH_FMT_LARGE | Return the calculated value as a 64-bit integer. |
PDH_FMT_LONG | Return the calculated value as a long integer. |
The value selected from the previous table can be combined using the OR operator with one of the following scaling flags.
Flag | Meaning |
---|---|
PDH_FMT_NOSCALE | Do not apply the counter's scaling factors in the calculation. |
PDH_FMT_NOCAP100 | Counter values above 100 (for example, counter values measuring the processor load on multiprocessor machines) will not be reset to 100. The default behavior is that counter values are capped at a value of 100. |
PDH_FMT_1000 | Multiply the final value by 1000. |
If the function succeeds, it returns ERROR_SUCCESS.
If the function fails, the return value is a PDH error status defined in PDHMsg.h. The following are possible error values.
Error value | Description |
---|---|
PDH_INVALID_ARGUMENT | An argument is not correct or is incorrectly formatted. |
PDH_INVALID_HANDLE | The counter handle is not valid. |
Windows NT/2000: Requires Windows NT 4.0 or later.
Header: Declared in Pdh.h.
Library: Use Pdh.lib.
PDH_FMT_COUNTERVALUE, PDH_RAW_COUNTER, PdhGetFormattedCounterValue, PdhGetRawCounterValue, PdhSetCounterScaleFactor