PdhGetRawCounterArrayA function (pdh.h)
Returns an array of raw values from the specified counter. Use this function when you want to retrieve the raw counter values of a counter that contains a wildcard character for the instance name.
PDH_FUNCTION PdhGetRawCounterArrayA( [in] PDH_HCOUNTER hCounter, [in, out] LPDWORD lpdwBufferSize, [out] LPDWORD lpdwItemCount, [out] PPDH_RAW_COUNTER_ITEM_A ItemBuffer );
Handle of the counter for whose current raw instance values you want to retrieve. The PdhAddCounter function returns this handle.
[in, out] lpdwBufferSize
Size of the ItemBuffer buffer, in bytes. If zero on input, the function returns PDH_MORE_DATA and sets this parameter to the required buffer size. If the buffer is larger than the required size, the function sets this parameter to the actual size of the buffer that was used. If the specified size on input is greater than zero but less than the required size, you should not rely on the returned size to reallocate the buffer.
Number of raw counter values in the ItemBuffer buffer.
Caller-allocated buffer that receives the array of PDH_RAW_COUNTER_ITEM structures; the structures contain the raw instance counter values. Set to NULL if lpdwBufferSize is zero.
If the function succeeds, it returns ERROR_SUCCESS.
||The ItemBuffer buffer is not large enough to contain the object name. This return value is expected if lpdwBufferSize is zero on input. If the specified size on input is greater than zero but less than the required size, you should not rely on the returned size to reallocate the buffer.|
||A parameter is not valid or is incorrectly formatted. For example, on some releases you could receive this error if the specified size on input is greater than zero but less than the required size.|
||The counter handle is not valid.|
You should call this function twice, the first time to get the required buffer size (set ItemBuffer to NULL and lpdwBufferSize to 0), and the second time to get the data.
The data for the counter is locked for the duration of the call to PdhGetRawCounterArray to prevent any changes during processing of the call.
The pdh.h header defines PdhGetRawCounterArray as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|