网站首页  词典首页

请输入您要查询的函数:

 

术语 pdhaddenglishcounter
释义 PdhAddEnglishCounter
语法:
C++
PDH_STATUS PdhAddEnglishCounter(
__in PDH_HQUERY hQuery,
__in LPCTSTR szFullCounterPath,
__in DWORD_PTR dwUserData,
__out PDH_HCOUNTER *phCounter
);
PdhAddEnglishCounter功能
将指定的语言中立违反查询。
参数
hQuery [in]
句柄查询您要添加计数器。这种处理是由PdhOpenQuery函数返回。
szFullCounterPath [in]
null结尾的字符串,其中包含计数器路径。有关计数器的路径格式的详细信息,请参阅指定计数器路径。计数器的路径的最大长度为PDH_MAX_COUNTER_PATH。
dwUserData [in]
用户定义的值。此值成为反信息的一部分。检索此值后,调用PdhGetCounterInfo功能和访问的PDH_COUNTER_INFO结构dwQueryUserData成员。
phCounter [out]
句柄已添加到查询柜台。您可能需要引用这个处理在随后的电话。
返回值
返回ERROR_SUCCESS如果函数成功。
如果函数失败,返回值是一个系统错误代码或一种PDH错误代码。以下是可能的值。
返回codeDescription
PDH_CSTATUS_BAD_COUNTERNAMEThe计数器路径不能解析或解释。
PDH_CSTATUS_NO_COUNTERUnable查找计算机上或在日志文件中指定的计数器。
PDH_CSTATUS_NO_COUNTERNAMEThe计数器路径是空的。
PDH_CSTATUS_NO_MACHINEThe路径不包含计算机名和函数无法获取本地计算机名。
PDH_CSTATUS_NO_OBJECTUnable查找计算机上或在日志文件中指定的对象。
PDH_FUNCTION_NOT_FOUNDUnable确定计算功能使用此计数器。
PDH_INVALID_ARGUMENTOne或多个参数无效。
PDH_INVALID_HANDLEThe查询处理是无效的。
PDH_MEMORY_ALLOCATION_FAILUREUnable分配需要完成的功能记忆。
备注
此功能提供了一种语言无关的方式添加性能计数器查询。相反,反您指定的路径中PdhAddCounter函数必须本地化。
如果计数器路径包含通配符,所有匹配的通配符计数器名称添加到查询。
如果一个计数器实例指定尚不存在,PdhAddEnglishCounter不会报告错误条件。相反,它返回ERROR_SUCCESS。出现这种现象的原因是,它不知道是否存在的计数器实例已指定甚至是否会存在,但尚未建立。
要从查询柜台,使用PdhRemoveCounter功能。
要求:
client最低支持Vista
server最低支持 Windows Server 2008
HeaderPdh.h
LibraryPdh.lib
DLLPdh.dll
Unicode和ANSI namesPdhAddEnglishCounterW(Unicode)和PdhAddEnglishCounterA(ANSI)的
参见
PdhAddCounter
PdhBrowseCounters
PdhMakeCounterPath
PdhOpenQuery
PdhRemoveCounter
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月23日
==英文原文==PdhAddEnglishCounter Function
Adds the specified language-neutral counter to the query.
Syntax
C++
PDH_STATUS PdhAddEnglishCounter(
__in PDH_HQUERY hQuery,
__in LPCTSTR szFullCounterPath,
__in DWORD_PTR dwUserData,
__out PDH_HCOUNTER *phCounter
);
Parameters
hQuery [in]
Handle to the query to which you want to add the counter. This handle is returned by the PdhOpenQuery function.
szFullCounterPath [in]
Null-terminated string that contains the counter path. For details on the format of a counter path, see Specifying a Counter Path . The maximum length of a counter path is PDH_MAX_COUNTER_PATH.
dwUserData [in]
User-defined value. This value becomes part of the counter information. To retrieve this value later, call the PdhGetCounterInfo function and access the dwQueryUserData member of the PDH_COUNTER_INFO structure.
phCounter [out]
Handle to the counter that was added to the query. You may need to reference this handle in subsequent calls.
Return Value
Return ERROR_SUCCESS if the function succeeds.
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_CSTATUS_BAD_COUNTERNAMEThe counter path could not be parsed or interpreted.
PDH_CSTATUS_NO_COUNTERUnable to find the specified counter on the computer or in the log file.
PDH_CSTATUS_NO_COUNTERNAMEThe counter path is empty.
PDH_CSTATUS_NO_MACHINEThe path did not contain a computer name and the function was unable to retrieve the local computer name.
PDH_CSTATUS_NO_OBJECTUnable to find the specified object on the computer or in the log file.
PDH_FUNCTION_NOT_FOUNDUnable to determine the calculation function to use for this counter.
PDH_INVALID_ARGUMENTOne or more arguments are not valid.
PDH_INVALID_HANDLEThe query handle is not valid.
PDH_MEMORY_ALLOCATION_FAILUREUnable to allocate memory required to complete the function.

Remarks
This function provides a language-neutral way to add performance counters to the query. In contrast, the counter path that you specify in the PdhAddCounter function must be localized.
If the counter path contains a wildcard character, all counter names matching the wildcard character are added to the query.
If a counter instance is specified that does not yet exist, PdhAddEnglishCounter does not report an error condition. Instead, it returns ERROR_SUCCESS. The reason for this behavior is that it is not known whether a nonexistent counter instance has been specified or whether one will exist but has not yet been created.
To remove the counter from the query, use the PdhRemoveCounter function.
Requirements
Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderPdh.h
LibraryPdh.lib
DLLPdh.dll
Unicode and ANSI namesPdhAddEnglishCounterW (Unicode) and PdhAddEnglishCounterA (ANSI)
See Also
PdhAddCounter
PdhBrowseCounters
PdhMakeCounterPath
PdhOpenQuery
PdhRemoveCounter
Send comments about this topic to Microsoft
Build date: 7/23/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa372536(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 13:19:59