PERF_INSTANCE_DEFINITION structure (winperf.h)

Describes an instance of a performance object.


  DWORD ByteLength;
  DWORD ParentObjectTitleIndex;
  DWORD ParentObjectInstance;
  LONG  UniqueID;
  DWORD NameOffset;
  DWORD NameLength;



Size of this structure, including the instance name that follows, in bytes. This value must be an 8-byte multiple.


Index of the name of the parent object in the title database. For example, if the object is a thread, the parent object is a process, or if the object is a logical drive, the parent is a physical drive.


Position of the instance within the parent object that is associated with this instance. The position is zero-based.


A unique identifier that you can use to identify the instance instead of using the name to identify the instance. If you do not use unique identifiers to distinguish the counter instances, set this member to PERF_NO_UNIQUE_ID.


Offset from the beginning of this structure to the Unicode name of this instance.


Length of the instance name, including the null-terminator, in bytes. This member is zero if the instance does not have a name.

Do not include in the length any padding that you added to the instance name to ensure that ByteLength is aligned to an 8-byte boundary.


The object contains instances if the NumInstances member of PERF_OBJECT_TYPE is greater than zero. Use the DefinitionLength member of PERF_OBJECT_TYPE to find the first instance of the object. For details, see Performance Data Format.

Consumers should use the parent instance name, if specified, to create a full instance name that is used for display. The convention is to form the name as parent/child.

Providers should use unique instance names. If you do not, it makes it difficult for consumers to calculate and display performance values because they cannot tell if the current instance refers to the same instance that was queried previously (instances can come and go).

Providers must allocate enough space for the instance name to ensure that ByteLength is aligned to an 8-byte boundary.


Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Header winperf.h (include Windows.h)

See also