Export (0) Print
Expand All
Expand Minimize

PerfQueryInstance function

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

Syntax


PPERF_COUNTERSET_INSTANCE PerfQueryInstance(
  _In_  HANDLE hProvider,
  _In_  LPCGUID CounterSetGuid,
  _In_  LPCWSTR szInstance,
  _In_  ULONG dwInstance
);

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.

CounterSetGuid [in]

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.

szInstance [in]

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

dwInstance [in]

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

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

PerfCreateInstance

 

 

Community Additions

ADD
Show:
© 2015 Microsoft