Export (0) Print
Expand All

PDH_COUNTER_INFO 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 {
  DWORD     dwLength;
  DWORD     dwType;
  DWORD     CVersion;
  DWORD     CStatus;
  LONG      lScale;
  LONG      lDefaultScale;
  DWORD_PTR dwUserData;
  DWORD_PTR dwQueryUserData;
  LPTSTR    szFullPath;
  union {
    PDH_DATA_ITEM_PATH_ELEMENTS DataItemPath;
    PDH_COUNTER_PATH_ELEMENTS   CounterPath;
    struct {
      LPTSTR szMachineName;
      LPTSTR szObjectName;
      LPTSTR szInstanceName;
      LPTSTR szParentInstance;
      DWORD  dwInstanceIndex;
      LPTSTR szCounterName;
    };
  };
  LPTSTR    szExplainText;
  DWORD     DataBuffer[1];
} PDH_COUNTER_INFO, *PPDH_COUNTER_INFO;

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 107) to PDH_MAX_SCALE (+7) (the returned value is the actual value times 10+7). 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.

DataItemPath

A PDH_DATA_ITEM_PATH_ELEMENTS structure. Not used.

CounterPath

A PDH_COUNTER_PATH_ELEMENTS structure.

szMachineName

Null-terminated string that contains the name of the computer specified in the counter path. Is NULL, if the path does not specify a computer. The string follows this structure in memory.

szObjectName

Null-terminated string that contains the name of the performance object specified in the counter path. The string follows this structure in memory.

szInstanceName

Null-terminated string that contains the name of the object instance specified in the counter path. Is NULL, if the path does not specify an instance. The string follows this structure in memory.

szParentInstance

Null-terminated string that contains the name of the parent instance specified in the counter path. Is NULL, if the path does not specify a parent instance. The string follows this structure in memory.

dwInstanceIndex

Instance index specified in the counter path. Is 0, if the path does not specify an instance index.

szCounterName

Null-terminated string that contains the counter name. The string follows this structure in memory.

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

Unicode and ANSI names

PDH_COUNTER_INFO_W (Unicode) and PDH_COUNTER_INFO_A (ANSI)

See also

PDH_COUNTER_PATH_ELEMENTS
PDH_DATA_ITEM_PATH_ELEMENTS
PdhGetCounterInfo

 

 

Community Additions

ADD
Show:
© 2014 Microsoft