Platform SDK: Performance Monitoring |
The PdhGetFormattedCounterArray function returns an array of values of the specified counter in the format requested by the caller.
PDH_STATUS PdhGetFormattedCounterArray( HCOUNTER hCounter, DWORD dwFormat, LPDWORD lpdwBufferSize, LPDWORD lpdwBufferCount, PPDH_FMT_COUNTERVALUE_ITEM ItemBuffer );
Value | Meaning |
---|---|
PDH_FMT_DOUBLE | Return data as a double-precision floating point real. |
PDH_FMT_LARGE | Return data as a 64-bit integer. |
PDH_FMT_LONG | Return data as a long integer. |
The value selected from the previous table can optionally be combined using the OR operator with one of the following scaling flags.
Value | Meaning |
---|---|
PDH_FMT_NOSCALE | Do not apply the default scaling factor. |
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 actual 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. |
The data for the counter is locked for the duration of the call to PdhGetFormattedCounterArray to prevent any changes during the processing of the call.
The value of hCounter can be obtained by a call to PdhAddCounter, with a wildcard specified for the instance name.
Windows NT/2000: Requires Windows 2000.
Header: Declared in Pdh.h.
Library: Use Pdh.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows 2000.
PdhGetFormattedCounterValue, PdhGetRawCounterValue, PdhGetRawCounterArray, PDH_FMT_COUNTERVALUE_ITEM, PdhAddCounter