PDH_COUNTER_INFO_A structure

The PDH_COUNTER_INFO structure contains information describing the properties of a counter. This information also includes the counter path.

Syntax

typedef struct _PDH_COUNTER_INFO_A {
  DWORD     dwLength;
  DWORD     dwType;
  DWORD     CVersion;
  DWORD     CStatus;
  LONG      lScale;
  LONG      lDefaultScale;
  DWORD_PTR dwUserData;
  DWORD_PTR dwQueryUserData;
  LPSTR     szFullPath;
  union {
    PDH_DATA_ITEM_PATH_ELEMENTS_A DataItemPath;
    PDH_COUNTER_PATH_ELEMENTS_A   CounterPath;
    struct {
      LPSTR szMachineName;
      LPSTR szObjectName;
      LPSTR szInstanceName;
      LPSTR szParentInstance;
      DWORD dwInstanceIndex;
      LPSTR szCounterName;
    };
  };
  LPSTR     szExplainText;
  DWORD     DataBuffer[1];
} PDH_COUNTER_INFO_A, *PPDH_COUNTER_INFO_A;

Members

dwLength

Size of the structure, including the appended strings, in bytes.

dwType

Counter type. For a list of counter types, see the Counter Types section of the Windows Server 2003 Deployment Kit. The counter type constants are defined in Winperf.h.

CVersion

Counter version information. Not used.

CStatus

Counter status that indicates if the counter value is valid. For a list of possible values, see Checking PDH Interface Return Values.

lScale

Scale factor to use when computing the displayable value of the counter. The scale factor is a power of ten. The valid range of this parameter is PDH_MIN_SCALE (–7) (the returned value is the actual value times 10⁷) to PDH_MAX_SCALE (+7) (the returned value is the actual value times 10⁺⁷). A value of zero will set the scale to one, so that the actual value is returned

lDefaultScale

Default scale factor as suggested by the counter's provider.

dwUserData

The value passed in the dwUserData parameter when calling PdhAddCounter.

dwQueryUserData

The value passed in the dwUserData parameter when calling PdhOpenQuery.

szFullPath

Null-terminated string that specifies the full counter path. The string follows this structure in memory.

__unnamed_union_03ef_2

__unnamed_union_03ef_2.DataItemPath

__unnamed_union_03ef_2.CounterPath

__unnamed_union_03ef_2.__unnamed_struct_0

__unnamed_union_03ef_2.__unnamed_struct_0.szMachineName

__unnamed_union_03ef_2.__unnamed_struct_0.szObjectName

__unnamed_union_03ef_2.__unnamed_struct_0.szInstanceName

__unnamed_union_03ef_2.__unnamed_struct_0.szParentInstance

__unnamed_union_03ef_2.__unnamed_struct_0.dwInstanceIndex

__unnamed_union_03ef_2.__unnamed_struct_0.szCounterName

szExplainText

Help text that describes the counter. Is NULL if the source is a log file.

DataBuffer

Start of the string data that is appended to the structure.

Remarks

When you allocate memory for this structure, allocate enough memory for the member strings, such as szCounterName, that are appended to the end of this structure.

Requirements

   
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Header pdh.h

See Also

PDH_COUNTER_PATH_ELEMENTS

PDH_DATA_ITEM_PATH_ELEMENTS

PdhGetCounterInfo