The PdhRemoveCounter function removes a counter from a query.
PDH_STATUS PdhRemoveCounter(
IN HCOUNTER hCounter // handle of the counter
);
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:
After you remove a counter, any references to it using the handle passed in hCounter will be invalid and will return an error.
Performance Data Helper Overview, Performance Data Functions, , PdhAddCounter, PdhOpenQuery