Export (0) Print
Expand All
Expand Minimize

PerfSetULongCounterValue function

Updates the value of a counter whose value is a 4-byte unsigned integer. Providers use this function.

Syntax


ULONG PerfSetULongCounterValue(
  _In_  HANDLE hProvider,
  _In_  PPERF_COUNTERSET_INSTANCE pInstance,
  _In_  ULONG CounterId,
  _In_  ULONG lValue
);

Parameters

hProvider [in]

The handle of the provider. Use the handle variable that the CTRPP tool generated for you. For the name of the variable, see the symbol attribute of the provider element.

Windows Vista:  The PerfStartProvider function returns the handle.

pInstance [in]

A PERF_COUNTERSET_INSTANCE structure that contains the counter set instance. The PerfCreateInstance function returns this pointer.

CounterId [in]

Identifier that uniquely identifies the counter to update in the instance block. The identifier is defined in the id attribute of the counter element and must match the CounterId member of one of the PERF_COUNTER_INFO structures in the instance block. Use the counter ID constant that the CTRPP tool generated for you. For the name of the constant, see the symbol attribute of the counter element.

Windows Vista:  The counter ID constant is not available.

lValue [in]

New 4-byte counter value.

Return value

If the function succeeds, it returns ERROR_SUCCESS.

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

Remarks

This is a convenience function for setting raw counter data. To update the raw counter data yourself, use the Offset member of the PERF_COUNTER_INFO structure to access the raw counter data for a specific counter. The PERF_COUNTERSET_INSTANCE structure block contains one or more counter information structures.

You can use the PerfIncrementULongCounterValue and PerfDecrementULongCounterValue functions to increment or decrement the counter value, respectively.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Perflib.h

Library

Advapi32.lib

DLL

Advapi32.dll

See also

PerfDecrementULongCounterValue
PerfIncrementULongCounterValue
PerfSetULongLongCounterValue
PerfSetCounterRefValue

 

 

Community Additions

ADD
Show:
© 2014 Microsoft