PdhLookupPerfIndexByNameA function

Returns the counter index corresponding to the specified counter name.

Syntax

PDH_FUNCTION PdhLookupPerfIndexByNameA(
  LPCSTR  szMachineName,
  LPCSTR  szNameBuffer,
  LPDWORD pdwIndex
);

Parameters

szMachineName

Null-terminated string that specifies the name of the computer where the specified counter is located. The computer name can be specified by the DNS name or the IP address. If NULL, the function uses the local computer.

szNameBuffer

Null-terminated string that contains the counter name.

pdwIndex

Index of the counter.

Return value

If the function succeeds, it returns ERROR_SUCCESS.

If the function fails, the return value is a system error code or a PDH error code. The following is a possible value.

Return code Description
PDH_INVALID_ARGUMENT
A parameter is not valid or is incorrectly formatted.

Requirements

   
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header pdh.h
Library Pdh.lib
DLL Pdh.dll

See also

PdhLookupPerfNameByIndex