PERF_OBJECT_TYPE structure (winperf.h)

Describes object-specific performance information, for example, the number of instances of the object and the number of counters that the object defines.

Syntax

typedef struct _PERF_OBJECT_TYPE {
  DWORD         TotalByteLength;
  DWORD         DefinitionLength;
  DWORD         HeaderLength;
  DWORD         ObjectNameTitleIndex;
#if ...
  DWORD         ObjectNameTitle;
#else
  LPWSTR        ObjectNameTitle;
#endif
  DWORD         ObjectHelpTitleIndex;
#if ...
  DWORD         ObjectHelpTitle;
#else
  LPWSTR        ObjectHelpTitle;
#endif
  DWORD         DetailLevel;
  DWORD         NumCounters;
  LONG          DefaultCounter;
  LONG          NumInstances;
  DWORD         CodePage;
  LARGE_INTEGER PerfTime;
  LARGE_INTEGER PerfFreq;
} PERF_OBJECT_TYPE, *PPERF_OBJECT_TYPE;

Members

TotalByteLength

Size of the object-specific data, in bytes. This member is the offset from the beginning of this structure to the next PERF_OBJECT_TYPE structure, if one exists.

DefinitionLength

Size of this structure plus the size of all the
PERF_COUNTER_DEFINITION structures.

If the object is a multiple instance object (the NumInstances member is not zero), this member is the offset from the beginning of this structure to the first PERF_INSTANCE_DEFINITION structure. Otherwise, this value is the offset to the PERF_COUNTER_BLOCK.

HeaderLength

Size of this structure, in bytes. This member is the offset from the beginning of this structure to the first PERF_COUNTER_DEFINITION structure.

ObjectNameTitleIndex

Index to the object's name in the title database. For details on using the index to retrieve the object's name, see Retrieving Counter Names and Help Text.

Providers specify the index value in their initialization file. For details, see Adding Counter Names and Descriptions to the Registry.

ObjectNameTitle

Reserved.

ObjectHelpTitleIndex

Index to the object's help text in the title database. For details on using the index to retrieve the object's help text, see Retrieving Counter Names and Help Text.

Providers specify the index value in their initialization file. For details, see Adding Counter Names and Descriptions to the Registry.

ObjectHelpTitle

Reserved.

DetailLevel

Level of detail. Consumers use this value to control display complexity. This value is the minimum detail level of all the counters for a given object. This member can be one of the following values.

Detail level Meaning
PERF_DETAIL_NOVICE
The counter data is provided for all users.
PERF_DETAIL_ADVANCED
The counter data is provided for advanced users.
PERF_DETAIL_EXPERT
The counter data is provided for expert users.
PERF_DETAIL_WIZARD
The counter data is provided for system designers.

NumCounters

Number of PERF_COUNTER_DEFINITION blocks returned by the object.

DefaultCounter

Index to the counter's name in the title database of the default counter whose information is to be displayed when this object is selected in the Performance tool. This member may be –1 to indicate that there is no default.

NumInstances

Number of object instances for which counters are being provided. If the object can have zero or more instances, but has none at present, this value should be zero. If the object cannot have multiple instances, this value should be PERF_NO_INSTANCES.

CodePage

This member is zero if the instance strings are Unicode strings. Otherwise, this member is the code-page identifier of the instance names. You can use the code-page value when calling MultiByteToWideChar to convert the string to Unicode.

PerfTime

Provider generated timestamp that consumers use when calculating counter values. For example, this could be the current value, in counts, of the high-resolution performance counter.

Providers need to provide this value if the counter types of their counters include the PERF_OBJECT_TIMER flag. Otherwise, consumers use the PerfTime value from PERF_DATA_BLOCK.

PerfFreq

Provider generated frequency value that consumers use when calculating counter values. For example, this could be the current frequency, in counts per second, of the high-resolution performance counter.

Providers need to provide this value if the counter types of their counters include the PERF_OBJECT_TIMER flag. Otherwise, consumers use the PerfFreq value from PERF_DATA_BLOCK.

Remarks

Providers use this structure to provide performance data for objects that they support. Consumers use this structure to consume performance data for objects that they queried.

This structure is followed by a list of PERF_COUNTER_DEFINITION structures, one for each counter defined for the performance object. For details on the layout of the performance data block, see Performance Data Format.

Requirements

Requirement Value
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

PERF_COUNTER_DEFINITION

PERF_DATA_BLOCK

Performance Data Format