PdhRemoveCounter function (pdh.h)

Removes a counter from a query.

Syntax

PDH_FUNCTION PdhRemoveCounter(
  [in] PDH_HCOUNTER hCounter
);

Parameters

[in] hCounter

Handle of the counter to remove from its query. The PdhAddCounter function returns this handle.

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 is a possible value.

Return code Description
PDH_INVALID_HANDLE
The counter handle is not valid.

Remarks

Do not use the counter handle after removing the counter from the query.

The following shows the syntax if calling this function from Visual Basic.

PdhRemoveCounter(
  ByVal CounterHandle as Long  
)
as Long

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

See also

PdhAddCounter

PdhOpenQuery