网站首页  词典首页

请输入您要查询的函数:

 

术语 pdhenumobjectitemsh
释义 PdhEnumObjectItemsH
语法:
C++
PDH_STATUS PdhEnumObjectItemsH(
__in PDH_HLOG hDataSource,
__in LPCTSTR szMachineName,
__in LPCTSTR szObjectName,
__out LPTSTR mszCounterList,
__inout LPDWORD pcchCounterListLength,
__out LPTSTR mszInstanceList,
__inout LPDWORD pcchInstanceListLength,
__in DWORD dwDetailLevel,
DWORD dwFlags
);
PdhEnumObjectItemsH功能
返回指定对象的计数器和实例的名称在指定的计算机或指定的日志文件存在。
此功能是相同的PdhEnumObjectItems功能,除了它支持使用句柄数据源。
参数
hDataSource [in]
处理到数据源的PdhBindInputDataSource函数返回。
szMachineName [in]
NULL结尾的字符串,指定的计算机包含计数器和实例名称要枚举的名称。包括例如在计算机名领导斜线,,\\ \\计算机名。
如果szDataSource参数为NULL,您可以设置为NULL szMachineName指定本地计算机上。
szObjectName [in]
null结尾的字符串,指定对象的名称,其计数器和实例名称要枚举。
mszCounterList [out]
来电分配的缓冲区,它接收的空列表,终止指定的对象提供的计数器名称。该列表包含独特的计数器名称。这份名单是由两个终止NULL字符。设置为NULL,如果pcchCounterListLength参数为零。
pcchCounterListLength [ in , out ]
的大小mszCounterList缓冲区,在TCHARs。如果零输入,该函数返回PDH_MORE_DATA,并设置此参数所需的缓冲区大小。如果缓冲区比所需的大小,功能设置此参数的时候,往往有人使用的缓冲区的实际大小。如果在输入指定的大小是大于零,但比所需的大小少,您不应该依靠返回的大小重新分配缓冲区。
mszInstanceList [out]
来电分配的缓冲区,它接收的空列表,终止指定的对象提供的实例名称。该清单包含唯一实例名称。这份名单是由两个终止NULL字符。设置为NULL,如果pcchInstanceListLength参数为零。
pcchInstanceListLength [ in , out ]
的大小mszInstanceList缓冲区,在TCHARs。如果零输入,该函数返回PDH_MORE_DATA,并设置此参数所需的缓冲区大小。如果缓冲区比所需的大小,功能设置此参数的时候,往往有人使用的缓冲区的实际大小。如果在输入指定的大小是大于零,但比所需的大小少,您不应该依靠返回的大小重新分配缓冲区。
如果指定的对象不支持变量实例,然后返回的值是零。如果指定的对象不支持变量的实例,但目前还没有任何实例,则返回值为2,这是一个空字符串的大小MULTI_SZ名单。
dwDetailLevel [in]
演出详细的项目Level的回报。所有项目都指定详细程度或以下的将被退回(Level提高列出顺序)。此参数可以是下列值之一。
ValueMeaning
PERF_DETAIL_NOVICENovice用户级别的细节。
详细PERF_DETAIL_ADVANCEAdvanced用户级别。
PERF_DETAIL_EXPERTExpert用户级别的细节。
PERF_DETAIL_WIZARDSystem细节设计Level。
dwFlags
此参数必须为零。
返回值
如果函数成功,它返回ERROR_SUCCESS。
如果函数失败,返回值是一个系统错误代码或一种PDH错误代码。以下是可能的值。
返回codeDescription
PDH_MORE_DATAOne的缓冲区太小,无法遏制的名单。这个返回值,预计如果pcchCounterListLength或pcchInstanceListLength是在输入为零。如果在输入指定的大小是大于零,但比所需的大小少,您不应该依靠返回的大小重新分配缓冲区。
PDH_INVALID_ARGUMENTA参数无效。例如,在某些版本中您可以收到此错误如果在输入指定的大小是大于零但小于所需的大小。
PDH_MEMORY_ALLOCATION_FAILUREUnable分配内存支持这一功能。
PDH_CSTATUS_NO_MACHINEThe指定的计算机脱机或不可用。
PDH_CSTATUS_NO_OBJECTThe指定的对象找不到指定的计算机上或在指定的日志文件。
备注
您应该调用这个函数两次,第一次获得所需的缓冲区大小(设置为NULL的缓冲区和大小为0),并第二次获得数据。
这一职能连续调用将返回计数器和实例相同的名单,因为PdhEnumObjectItemsH将始终质疑的最后调用定义PdhEnumObjectsH或PdhEnumObjectItemsH性能对象列表。要刷新的性能对象,调用为TRUE bRefresh标志的值PdhEnumObjectsH之前调用PdhEnumObjectItemsH再次名单。
该实例和反名字的顺序是不确定的。
要求:
最低支持client-Windows XP
最低支持serverWindows服务器2003
HeaderPdh.h
LibraryPdh.lib
DLLPdh.dll
Unicode和ANSI namesPdhEnumObjectItemsHW(Unicode)和PdhEnumObjectItemsHA(ANSI)的
参见
PdhBindInputDataSource
PdhEnumObjectsH
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月23日
==英文原文==PdhEnumObjectItemsH Function
Returns the specified object's counter and instance names that exist on the specified computer or in the specified log file.
This function is identical to the PdhEnumObjectItems function, except that it supports the use of handles to data sources.
Syntax
C++
PDH_STATUS PdhEnumObjectItemsH(
__in PDH_HLOG hDataSource,
__in LPCTSTR szMachineName,
__in LPCTSTR szObjectName,
__out LPTSTR mszCounterList,
__inout LPDWORD pcchCounterListLength,
__out LPTSTR mszInstanceList,
__inout LPDWORD pcchInstanceListLength,
__in DWORD dwDetailLevel,
DWORD dwFlags
);
Parameters
hDataSource [in]
Handle to a data source returned by the PdhBindInputDataSource function.
szMachineName [in]
Null-terminated string that specifies the name of the computer that contains the counter and instance names that you want to enumerate. Include the leading slashes in the computer name, for example, \\\\computername.
If the szDataSource parameter is NULL, you can set szMachineName to NULL to specify the local computer.
szObjectName [in]
Null-terminated string that specifies the name of the object whose counter and instance names you want to enumerate.
mszCounterList [out]
Caller-allocated buffer that receives a list of null-terminated counter names provided by the specified object. The list contains unique counter names. The list is terminated by two NULL characters. Set to NULL if the pcchCounterListLength parameter is zero.
pcchCounterListLength [in, out]
Size of the mszCounterList 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.
mszInstanceList [out]
Caller-allocated buffer that receives a list of null-terminated instance names provided by the specified object. The list contains unique instance names. The list is terminated by two NULL characters. Set to NULL if the pcchInstanceListLength parameter is zero.
pcchInstanceListLength [in, out]
Size of the mszInstanceList 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.
If the specified object does not support variable instances, then the returned value will be zero. If the specified object does support variable instances, but does not currently have any instances, then the value returned is 2, which is the size of an empty MULTI_SZ list string.
dwDetailLevel [in]
Detail level of the performance items to return. All items that are of the specified detail level or less will be returned (the levels are listed in increasing order). This parameter can be one of the following values.
ValueMeaning
PERF_DETAIL_NOVICENovice user level of detail.
PERF_DETAIL_ADVANCEAdvanced user level of detail.
PERF_DETAIL_EXPERTExpert user level of detail.
PERF_DETAIL_WIZARDSystem designer level of detail.

dwFlags
This parameter must be 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_MORE_DATAOne of the buffers is too small to contain the list of names. This return value is expected if pcchCounterListLength or pcchInstanceListLength 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.
PDH_MEMORY_ALLOCATION_FAILUREUnable to allocate memory to support this function.
PDH_CSTATUS_NO_MACHINEThe specified computer is offline or unavailable.
PDH_CSTATUS_NO_OBJECTThe specified object could not be found on the specified computer or in the specified log file.

Remarks
You should call this function twice, the first time to get the required buffer size (set the buffers to NULL and the sizes to 0), and the second time to get the data.
Consecutive calls to this function will return identical lists of counters and instances, because PdhEnumObjectItemsH will always query the list of performance objects defined by the last call to PdhEnumObjectsH or PdhEnumObjectItemsH. To refresh the list of performance objects, call PdhEnumObjectsH with a bRefresh flag value of TRUE before calling PdhEnumObjectItemsH again.
The order of the instance and counter names is undetermined.
Requirements
Minimum supported clientWindows XP
Minimum supported serverWindows Server 2003
HeaderPdh.h
LibraryPdh.lib
DLLPdh.dll
Unicode and ANSI namesPdhEnumObjectItemsHW (Unicode) and PdhEnumObjectItemsHA (ANSI)
See Also
PdhBindInputDataSource
PdhEnumObjectsH
Send comments about this topic to Microsoft
Build date: 7/23/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa372599(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:24:10