PdhGetRawCounterValue
TOC
Collapse the table of content
Expand the table of content

PdhGetRawCounterValue function

Returns the current raw value of the counter.

Syntax


PDH_STATUS PdhGetRawCounterValue(
  _In_  PDH_HCOUNTER     hCounter,
  _Out_ LPDWORD          lpdwType,
  _Out_ PPDH_RAW_COUNTER pValue
);

Parameters

hCounter [in]

Handle of the counter from which to retrieve the current raw value. The PdhAddCounter function returns this handle.

lpdwType [out]

Receives the counter type. For a list of counter types, see the Counter Types section of the Windows Server 2003 Deployment Kit. This parameter is optional.

pValue [out]

A PDH_RAW_COUNTER structure that receives the 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 codeDescription
PDH_INVALID_ARGUMENT

A parameter is not valid or is incorrectly formatted.

PDH_INVALID_HANDLE

The counter handle is not valid.

 

Remarks

The data for the counter is locked (protected) for the duration of the call to PdhGetRawCounterValue to prevent any changes during processing of the call.

If the specified counter instance does not exist, this function will return ERROR_SUCCESS and the CStatus member of the PDH_RAW_COUNTER structure will contain PDH_CSTATUS_NO_INSTANCE.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Pdh.h

Library

Pdh.lib

DLL

Pdh.dll

See also

PdhGetFormattedCounterValue
PdhCalculateCounterFromRawValue
PdhCollectQueryData

 

 

Show:
© 2016 Microsoft