大网数据广告活动
性能与资源

PdhVbGetCounterPathElements function

· 52CE 我爱测

The PdhVbGetCounterPathElements function parses a fully qualified performance counter path string into its individual elements.

The PdhVbGetCounterPathElements function parses a fully qualified performance counter path string into its individual elements. Each of the string variables must be the same size (BufferSize) and dimensioned and initialized before it is used in this function.

Important: The function that this topic describes may be altered or unavailable in the future. Instead, Microsoft recommends that you use the functions described in Performance Counters Functions.

Function PdhVbGetCounterPathElements( _ ByVal PathString As String, _ ByVal MachineName As String, _ ByVal ObjectName As String, _ ByVal InstanceName As String, _ ByVal ParentInstance As String, _ ByVal CounterName As String, _ ByVal BufferSize As Long _ ) As Long

Parameters

PathString

Counter path string that is to be broken up into its individual elements.

MachineName

String to receive the computer name.

ObjectName

String to receive the object name.

InstanceName

String to receive the instance name, if used.

ParentInstance

String to receive the parent instance, if used.

CounterName

String to receive the counter name.

BufferSize

Maximum size of each string variable used as a parameter to this function call.

Return value

If the function succeeds, it returns a Long integer equal to ERROR_SUCCESS.

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

Return code Description
PDH_INVALID_ARGUMENT One or more of the string buffers is not the correct size.
PDH_MORE_DATA One or more of the counter path elements is too large for the return buffer length.
PDH_MEMORY_ALLOCATION_FAILURE A temporary memory buffer could not be allocated.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Library Pdh.lib
DLL Pdh.dll

See also

PdhVbCreateCounterPathList

PdhVbGetCounterPathFromList

PdhVbGetOneCounterPath

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 07/14/2025
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。