PdhRemoveCounter

The PdhRemoveCounter function removes a counter from a query.

PDH_STATUS PdhRemoveCounter(
  IN HCOUNTER hCounter  // handle of the counter
);
 

Parameters

hCounter
The handle of the counter to remove from its query.

Return Values

If the function succeeds, it returns ERROR_SUCCESS and removes the specified counter from its query.

If the function fails, the return value is a PDH error status defined in pdhmsg.h. The following is a possible error value:

PDH_INVALID_HANDLE
The counter handle is not valid.

Remarks

After you remove a counter, any references to it using the handle passed in hCounter will be invalid and will return an error.

See Also

Performance Data Helper Overview, Performance Data Functions, , PdhAddCounter, PdhOpenQuery