PerfQueryInstance function (perflib.h)

Retrieves a pointer to the specified counter set instance. Providers use this function.

Syntax

PPERF_COUNTERSET_INSTANCE PerfQueryInstance(
  [in] HANDLE  ProviderHandle,
  [in] LPCGUID CounterSetGuid,
  [in] PCWSTR  Name,
  [in] ULONG   Id
);

Parameters

[in] ProviderHandle

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.

[in] CounterSetGuid

GUID that uniquely identifies the counter set that you want to query. This is the same GUID specified in the guid attribute of the counterSet element. Use the GUID variable that the CTRPP tool generated for you. For the name of the variable, see the symbol attribute of the counterSet element.

Windows Vista:  The GUID variable is not available.

[in] Name

Null-terminated Unicode string that contains the name of counter set instance that you want to retrieve.

[in] Id

Unique identifier of the counter set instance that you want to retrieve.

Return value

A PERF_COUNTERSET_INSTANCE structure that contains the counter set instance or NULL if the instance does not exist.

This function returns NULL if an error occurred. To determine the error that occurred, call GetLastError.

Remarks

Use the same instance name and identifier that you used when calling PerfCreateInstance to retrieve a specific instance of the counter set.

Providers should cache the pointer to the instance when they create the instance instead of calling this function to retrieve the pointer.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header perflib.h
Library Advapi32.lib
DLL Advapi32.dll

See also

PerfCreateInstance