网站首页  词典首页

请输入您要查询的函数:

 

术语 pdhgetcounterinfo
释义 PdhGetCounterInfo
语法:
C++
PDH_STATUS PdhGetCounterInfo(
__in PDH_HCOUNTER hCounter,
__in BOOLEAN bRetrieveExplainText,
__inout LPDWORD pdwBufferSize,
__out PPDH_COUNTER_INFO lpBuffer
);
PdhGetCounterInfo功能
检索信息计数器,如数据的大小,柜台式,路径和用户提供的数据值。
参数
hCounter [in]
处理反从中您要检索信息。该PdhAddCounter函数返回此句柄。
bRetrieveExplainText [in]
确定是否解释文本检索。如果将此参数设置为TRUE,则解释为反文本检索。如果将此参数设置为FALSE,则在返回缓冲区字段为空。
pdwBufferSize [ in , out ]
的大小lpBuffer缓冲区,以字节为单位。如果零输入,该函数返回PDH_MORE_DATA,并设置此参数所需的缓冲区大小。如果缓冲区比所需的大小,功能设置此参数的时候,往往有人使用的缓冲区的实际大小。如果在输入指定的大小是大于零,但比所需的大小少,您不应该依靠返回的大小重新分配缓冲区。
lpBuffer [out]
来电分配的缓冲区,它接收PDH_COUNTER_INFO结构。该结构是变长,因为字符串数据附加到固定格式的结构部分的末尾。这样做是让所有数据是由调用者分配一个缓冲区内。设置为NULL,如果pdwBufferSize是零。
返回值
如果函数成功,它返回ERROR_SUCCESS。
如果函数失败,返回值是一个系统错误代码或一种PDH错误代码。以下是可能的值。
返回codeDescription
PDH_INVALID_ARGUMENTA参数无效或格式不正确。例如,在某些版本中您可以收到此错误如果在输入指定的大小是大于零但小于所需的大小。
PDH_INVALID_HANDLEThe计数器句柄无效。
PDH_MORE_DATAThe lpBuffer缓冲区太小举行计数器信息。这个返回值,预计如果pdwBufferSize是在输入为零。如果在输入指定的大小是大于零,但比所需的大小少,您不应该依靠返回的大小重新分配缓冲区。
备注
您应该调用这个函数两次,第一次获得所需的缓冲区大小(设置lpBuffer为NULL和pdwBufferSize为0),和第二次获取数据。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderPdh.h
LibraryPdh.lib
DLLPdh.dll
Unicode和ANSI namesPdhGetCounterInfoW(Unicode)和PdhGetCounterInfoA(ANSI)的
参见
PDH_COUNTER_INFO
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月23日
==英文原文==PdhGetCounterInfo Function
Retrieves information about a counter, such as data size, counter type, path, and user-supplied data values.
Syntax
C++
PDH_STATUS PdhGetCounterInfo(
__in PDH_HCOUNTER hCounter,
__in BOOLEAN bRetrieveExplainText,
__inout LPDWORD pdwBufferSize,
__out PPDH_COUNTER_INFO lpBuffer
);
Parameters
hCounter [in]
Handle of the counter from which you want to retrieve information. The PdhAddCounter function returns this handle.
bRetrieveExplainText [in]
Determines whether explain text is retrieved. If you set this parameter to TRUE, the explain text for the counter is retrieved. If you set this parameter to FALSE, the field in the returned buffer is NULL.
pdwBufferSize [in, out]
Size of the lpBuffer buffer, in bytes. 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.
lpBuffer [out]
Caller-allocated buffer that receives a PDH_COUNTER_INFO structure. The structure is variable-length, because the string data is appended to the end of the fixed-format portion of the structure. This is done so that all data is returned in a single buffer allocated by the caller. Set to NULL if pdwBufferSize is zero.
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_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.
PDH_INVALID_HANDLEThe counter handle is not valid.
PDH_MORE_DATAThe lpBuffer buffer is too small to hold the counter information. This return value is expected if pdwBufferSize 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.

Remarks
You should call this function twice, the first time to get the required buffer size (set lpBuffer to NULL and pdwBufferSize 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 namesPdhGetCounterInfoW (Unicode) and PdhGetCounterInfoA (ANSI)
See Also
PDH_COUNTER_INFO
Send comments about this topic to Microsoft
Build date: 7/23/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa372613(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:23:35