网站首页  词典首页

请输入您要查询的函数:

 

术语 pdhenummachinesh
释义 PdhEnumMachinesH
语法:
C++
PDH_STATUS PdhEnumMachinesH(
__in PDH_HLOG hDataSource,
__out LPTSTR mszMachineNameList,
__inout LPDWORD pcchBufferLength
);
PdhEnumMachinesH功能
返回在一个日志文件计数器关联的电脑名单。该计算机的名称要么添加计数器时指定的查询或调用PdhConnectMachine功能。这些电脑包括那些列出当前连接和网上除了那些脱机或不返回性能数据。
这个函数PdhEnumMachines在相同的功能,除了它支持使用句柄数据源。
参数
hDataSource [in]
处理到数据源的PdhBindInputDataSource函数返回。
mszMachineNameList [out]
来电分配的缓冲区接收的空列表结尾的字符串包含计算机名称。该清单将终止两个零终止字符。设置为NULL,如果pcchBufferLength是零。
pcchBufferLength [ in , out ]
的大小mszMachineNameList缓冲区,在TCHARs。如果零输入,该函数返回PDH_MORE_DATA,并设置此参数所需的缓冲区大小。如果缓冲区比所需的大小,功能设置此参数的时候,往往有人使用的缓冲区的实际大小。如果在输入指定的大小是大于零,但比所需的大小少,您不应该依靠返回的大小重新分配缓冲区。
返回值
如果函数成功,它返回ERROR_SUCCESS。
如果函数失败,返回值是一个系统错误代码或一种PDH错误代码。以下是可能的值。
返回codeDescription
PDH_MORE_DATAThe mszMachineNameList缓冲区太小包含的所有数据。这个返回值,预计如果pcchBufferLength是在输入为零。如果在输入指定的大小是大于零,但比所需的大小少,您不应该依靠返回的大小重新分配缓冲区。
PDH_INVALID_ARGUMENTA参数无效。例如,在某些版本中您可以收到此错误如果在输入指定的大小是大于零但小于所需的大小。
备注
您应该调用这个函数两次,第一次获得所需的缓冲区大小(设置mszMachineNameList为NULL和pcchBufferLength为0),和第二次获取数据。
要求:
最低支持client-Windows XP
最低支持serverWindows服务器2003
HeaderPdh.h
LibraryPdh.lib
DLLPdh.dll
Unicode和ANSI namesPdhEnumMachinesHW(Unicode)和PdhEnumMachinesHA(ANSI)的
参见
PdhBindInputDataSource
PdhConnectMachine
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月23日
==英文原文==PdhEnumMachinesH Function
Returns a list of the computer names associated with counters in a log file. The computer names were either specified when adding counters to the query or when calling the PdhConnectMachine function. The computers listed include those that are currently connected and online, in addition to those that are offline or not returning performance data.
This function is identical to the PdhEnumMachines function, except that it supports the use of handles to data sources.
Syntax
C++
PDH_STATUS PdhEnumMachinesH(
__in PDH_HLOG hDataSource,
__out LPTSTR mszMachineNameList,
__inout LPDWORD pcchBufferLength
);
Parameters
hDataSource [in]
Handle to a data source returned by the PdhBindInputDataSource function.
mszMachineNameList [out]
Caller-allocated buffer to receive the list of null-terminated strings that contain the computer names. The list is terminated with two null-terminator characters. Set to NULL if pcchBufferLength is zero.
pcchBufferLength [in, out]
Size of the mszMachineNameList 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.
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 mszMachineNameList buffer is too small to contain all the data. This return value is expected if pcchBufferLength 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. 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 mszMachineNameList to NULL and pcchBufferLength to 0), and the second time to get the data.
Requirements
Minimum supported clientWindows XP
Minimum supported serverWindows Server 2003
HeaderPdh.h
LibraryPdh.lib
DLLPdh.dll
Unicode and ANSI namesPdhEnumMachinesHW (Unicode) and PdhEnumMachinesHA (ANSI)
See Also
PdhBindInputDataSource
PdhConnectMachine
Send comments about this topic to Microsoft
Build date: 7/23/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa372591(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:29:17