网站首页  词典首页

请输入您要查询的函数:

 

术语 pdhcollectquerydata
释义 PdhCollectQueryData
语法:
C++
PDH_STATUS PdhCollectQueryData(
__inout PDH_HQUERY hQuery
);
PdhCollectQueryData功能
目前的原料收集在指定的查询和更新的每个计数器的状态代码的所有计数器的数据值。
参数
hQuery [ in , out ]
处理的查询您要收集数据。该PdhOpenQuery函数返回此句柄。
返回值
如果函数成功,它返回ERROR_SUCCESS。否则,该函数返回一个系统错误代码或一种PDH错误代码。
以下是可能的值。
返回codeDescription
PDH_INVALID_HANDLEThe查询处理是无效的。
PDH_NO_DATAThe查询当前不包含任何柜台。该查询可能不包含数据,因为用户没有获得提升的令牌(见受限用户访问支持运行)。
备注
调用此函数时,您要收集查询中的计数器计数器数据。光端机存储原始计数器值为当前和以前的集合。
如果您想检索当前原料计数器的值,调用PdhGetRawCounterValue功能。如果您想计算的计数器值显示的值,调用PdhGetFormattedCounterValue功能。如果计数器路径中包含一个实例名通配符,而不是调用PdhGetRawCounterArray和PdhGetFormattedCounterArray职能分别。
当PdhCollectQueryData的要求,例如从一个柜台只计数器实例不存在,函数返回PDH_NO_DATA数据。但是,如果从多个计数器数据查询,PdhCollectQueryData可能会返回计数器实例ERROR_SUCCESS即使还不存在。这是因为它不知道如果指定的计数器实例不存在,或是否会存在,但尚未建立。在这种情况下,要求利益的计数器实例每个PdhGetRawCounterValue或PdhGetFormattedCounterValue以确定它们是否存在。
下面显示了语法,如果从Visual Basic中调用这个函数。
PdhCollectQueryData(
ByVal QueryHandle为Long
)
如龙
QueryHandle
[in]标识查询想要的数据收集。该PdhVbOpenQuery函数返回的标识符。

实例
有关示例,请浏览性能计数器或读取日志文件的性能数据。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderPdh.h
LibraryPdh.lib
DLLPdh.dll
参见
PdhGetFormattedCounterValue
PdhGetRawCounterValue
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月23日
==英文原文==PdhCollectQueryData Function
Collects the current raw data value for all counters in the specified query and updates the status code of each counter.
Syntax
C++
PDH_STATUS PdhCollectQueryData(
__inout PDH_HQUERY hQuery
);
Parameters
hQuery [in, out]
Handle of the query for which you want to collect data. The PdhOpenQuery function returns this handle.
Return Value
If the function succeeds, it returns ERROR_SUCCESS. Otherwise, the function returns a system error code or a PDH error code .
The following are possible values.
Return codeDescription
PDH_INVALID_HANDLEThe query handle is not valid.
PDH_NO_DATAThe query does not currently contain any counters. The query may not contain data because the user is not running with an elevated token (see Limited User Access Support ).

Remarks
Call this function when you want to collect counter data for the counters in the query. PDH stores the raw counter values for the current and previous collection.
If you want to retrieve the current raw counter value, call the PdhGetRawCounterValue function. If you want to compute a displayable value for the counter value, call the PdhGetFormattedCounterValue function. If the counter path contains a wildcard for the instance name, instead call the PdhGetRawCounterArray and PdhGetFormattedCounterArray functions, respectively.
When PdhCollectQueryData is called for data from one counter instance only and the counter instance does not exist, the function returns PDH_NO_DATA. However, if data from more than one counter is queried, PdhCollectQueryData may return ERROR_SUCCESS even if one of the counter instances does not yet exist. This is because it is not known if the specified counter instance does not exist, or if it will exist but has not yet been created. In this case, call PdhGetRawCounterValue or PdhGetFormattedCounterValue for each of the counter instances of interest to determine whether they exist.
The following shows the syntax if calling this function from Visual Basic.
PdhCollectQueryData(
ByVal QueryHandle as Long
)
as Long
QueryHandle
[in] Identifies the query whose data you want to collect. The PdhVbOpenQuery function returns the identifier.

Examples
For an example, see Browsing Performance Counters or Reading Performance Data from a Log File .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderPdh.h
LibraryPdh.lib
DLLPdh.dll
See Also
PdhGetFormattedCounterValue
PdhGetRawCounterValue
Send comments about this topic to Microsoft
Build date: 7/23/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa372563(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:25:28