网站首页  词典首页

请输入您要查询的函数:

 

术语 pdhmakecounterpath
释义 PdhMakeCounterPath
语法:
C++
PDH_STATUS PdhMakeCounterPath(
__in PDH_COUNTER_PATH_ELEMENTS *pCounterPathElements,
__out LPTSTR szFullPathBuffer,
__inout LPDWORD pcchBufferSize,
__in DWORD dwFlags
);
PdhMakeCounterPath功能
创建一个完整路径使用计数器在PDH_COUNTER_PATH_ELEMENTS结构中指定的成员。
参数
pCounterPathElements [in]
阿PDH_COUNTER_PATH_ELEMENTS结构,它包含用于弥补路径的成员。只有szObjectName和szCounterName成员需要,其余是可选的。
如果该实例名成员是NULL,路径将不包含一个实例的引用和szParentInstance和dwInstanceIndex成员将被忽略。
szFullPathBuffer [out]
来电分配的缓冲区,它收到一个空结束的计数器路径。计数器的路径的最大长度为PDH_MAX_COUNTER_PATH。设置为NULL,如果pcchBufferSize是零。
pcchBufferSize [ in , out ]
的大小szFullPathBuffer缓冲区,在TCHARs。如果零输入,该函数返回PDH_MORE_DATA,并设置此参数所需的缓冲区大小。如果缓冲区比所需的大小,功能设置此参数的时候,往往有人使用的缓冲区的实际大小。如果在输入指定的大小是大于零,但比所需的大小少,您不应该依靠返回的大小重新分配缓冲区。
dwFlags [in]
格式的输入和输出计数器值。您可以指定下列值之一。
ValueMeaning
PDH_PATH_WBEM_RESULTConverts一种PDH路径WMI类和属性名称格式。
PDH_PATH_WBEM_INPUTConverts的WMI类和属性名称的光端机的道路。
在PDH数字格式0Returns的路径,例如,\\\\computer\\object(parent/instance#index)\\counter。
返回值
如果函数成功,它返回ERROR_SUCCESS。
如果函数失败,返回值是一个系统错误代码或一种PDH错误代码。以下是可能的值。
返回codeDescription
PDH_MORE_DATAThe szFullPathBuffer缓冲区太小,无法包含计数器名称。这个返回值,预计如果pcchBufferSize是在输入为零。如果在输入指定的大小是大于零,但比所需的大小少,您不应该依靠返回的大小重新分配缓冲区。
PDH_INVALID_ARGUMENTA参数无效或格式不正确。例如,在某些版本中您可以收到此错误如果在输入指定的大小是大于零但小于所需的大小。
备注
您应该调用这个函数两次,第一次获得所需的缓冲区大小(设置szFullPathBuffer为NULL和pcchBufferSize为0),和第二次获取数据。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderPdh.h
LibraryPdh.lib
DLLPdh.dll
Unicode和ANSI namesPdhMakeCounterPathW(Unicode)和PdhMakeCounterPathA(ANSI)的
参见
PDH_COUNTER_PATH_ELEMENTS
PdhParseCounterPath
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月23日
==英文原文==PdhMakeCounterPath Function
Creates a full counter path using the members specified in the PDH_COUNTER_PATH_ELEMENTS structure.
Syntax
C++
PDH_STATUS PdhMakeCounterPath(
__in PDH_COUNTER_PATH_ELEMENTS *pCounterPathElements,
__out LPTSTR szFullPathBuffer,
__inout LPDWORD pcchBufferSize,
__in DWORD dwFlags
);
Parameters
pCounterPathElements [in]
A PDH_COUNTER_PATH_ELEMENTS structure that contains the members used to make up the path. Only the szObjectName and szCounterName members are required, the others are optional.
If the instance name member is NULL, the path will not contain an instance reference and the szParentInstance and dwInstanceIndex members will be ignored.
szFullPathBuffer [out]
Caller-allocated buffer that receives a null-terminated counter path. The maximum length of a counter path is PDH_MAX_COUNTER_PATH. Set to NULL if pcchBufferSize is zero.
pcchBufferSize [in, out]
Size of the szFullPathBuffer buffer, in TCHARs. If zero on input, the function returns PDH_MORE_DATA and sets this parameter to the required buffer size. If the buffer is larger than the required size, the function sets this parameter to the actual size of the buffer that was used. If the specified size on input is greater than zero but less than the required size, you should not rely on the returned size to reallocate the buffer.
dwFlags [in]
Format of the input and output counter values. You can specify one of the following values.
ValueMeaning
PDH_PATH_WBEM_RESULTConverts a PDH path to the WMI class and property name format.
PDH_PATH_WBEM_INPUTConverts the WMI class and property name to a PDH path.
0Returns the path in the PDH format, for example, \\\\computer\\object(parent/instance#index)\\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 are possible values.
Return codeDescription
PDH_MORE_DATAThe szFullPathBuffer buffer is too small to contain the counter name. This return value is expected if pcchBufferSize is zero on input. If the specified size on input is greater than zero but less than the required size, you should not rely on the returned size to reallocate the buffer.
PDH_INVALID_ARGUMENTA parameter is not valid or is incorrectly formatted. For example, on some releases you could receive this error if the specified size on input is greater than zero but less than the required size.

Remarks
You should call this function twice, the first time to get the required buffer size (set szFullPathBuffer to NULL and pcchBufferSize to 0), and the second time to get the data.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderPdh.h
LibraryPdh.lib
DLLPdh.dll
Unicode and ANSI namesPdhMakeCounterPathW (Unicode) and PdhMakeCounterPathA (ANSI)
See Also
PDH_COUNTER_PATH_ELEMENTS
PdhParseCounterPath
Send comments about this topic to Microsoft
Build date: 7/23/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa372649(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:25:59