PerfDeleteCounters function

Removes the specified performance counter specifications from the specified query.

Syntax

ULONG PerfDeleteCounters(
  HANDLE                   hQuery,
  PPERF_COUNTER_IDENTIFIER pCounters,
  DWORD                    cbCounters
);

Parameters

hQuery

A handle to the query from which you want to remove performance counter specifications.

pCounters

A pointer to the performance counter specifications that you want to remove.

cbCounters

The size of the buffer that the pCounters parameter specifies, in bytes.

Return value

If the function succeeds, it returns ERROR_SUCCESS.

If the function fails, the return value is a system error code.

Remarks

The pCounters parameter should point to a sequence of PERF_COUNTER_IDENTIFIERblocks. Each PERF_COUNTER_IDENTIFIER block consists of a PERF_COUNTER_IDENTIFIER structure, optionally followed by a null-terminated UTF-16LE instance name string, followed by padding that makes the size of the block a multiple of 8 bytes.

Configure each PERF_COUNTER_IDENTIFIER block in the same way as described in the Remarks for PerfAddCounters.

PerfDeleteCounters attempts to remove one counter specification from the query for each PERF_COUNTER_IDENTIFIER block, and updates the Status member of the PERF_COUNTER_IDENTIFIER structure in each block with the result of the attempt.

Requirements

   
Minimum supported client Windows 10, version 1607 [desktop apps only]
Minimum supported server Windows Server 2016 [desktop apps only]
Target Platform Windows
Header perflib.h
Library AdvAPI32.lib
DLL AdvAPI32.dll

See also

PERF_COUNTER_IDENTIFIER

PerfAddCounters