Platform SDK: Performance Monitoring

PDH_COUNTER_INFO

The PDH_COUNTER_INFO structure contains information describing the properties of a counter. This information also includes the counter path. The format of this buffer is to have the structure described below followed by a variable-length buffer containing the string information referenced by the string pointers in the structure (szFullPath, szMachineName, szObjectName, szInstanceName, szParentInstance, szCounterName, and szExplainText).

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
The length of the structure, including strings.
dwType
The counter type.
CVersion
The counter version information.
CStatus
The current counter status. For more information, see Checking PDH Interface Return Values.
lScale
The current scale factor.
lDefaultScale
The recommended scale factor.
dwUserData
The value of the counter's User Data field.
dwQueryUserData
The value of the User Data field for the query to which the counter belongs.
szFullPath
A pointer to a null-terminated string containing the full counter path.
DataItemPath
A PDH_DATA_ITEM_PATH_ELEMENTS structure.
CounterPath
A PDH_COUNTER_PATH_ELEMENTS structure.
szExplainText
The explain text for this counter.
DataBuffer[1]
The first byte of string data appended to the structure.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Header: Declared in Pdh.h.
  Unicode: Declared as Unicode and ANSI structures.

See Also

PDH_COUNTER_PATH_ELEMENTS, PdhGetCounterInfo, PDH_DATA_ITEM_PATH_ELEMENTS