网站首页  词典首页

请输入您要查询的函数:

 

术语 pdhenumobjects
释义 PdhEnumObjects
语法:
C++
PDH_STATUS PdhEnumObjects(
__in LPCTSTR szDataSource,
__in LPCTSTR szMachineName,
__out LPTSTR mszObjectList,
__inout LPDWORD pcchBufferLength,
__in DWORD dwDetailLevel,
__in BOOL bRefresh
);
PdhEnumObjects功能
返回对象的列表指定的计算机上或在指定的日志文件中提供。
要使用句柄数据源,使用PdhEnumObjectsH功能。
参数
szDataSource [in]
NULL结尾的字符串,指定日志文件的名称用于枚举的性能对象。如果为NULL,该函数使用在szMachineName参数指定枚举计算机的名称。
szMachineName [in]
null结尾的字符串,指定用于枚举性能对象的计算机的名称。包括例如在计算机名领导斜线,,\\ \\计算机名。
如果szDataSource参数为NULL,您可以设置为NULL szMachineName指定本地计算机上。
mszObjectList [out]
来电分配的缓冲区,它接收对象名单。列表中的每个对象的名称是终止空字符。该清单将终止两个零终止字符。设置为NULL,如果pcchBufferLength参数为零。
pcchBufferLength [ in , out ]
的大小mszObjectList缓冲区,在TCHARs。如果零输入,该函数返回PDH_MORE_DATA,并设置此参数所需的缓冲区大小。如果缓冲区比所需的大小,功能设置此参数的时候,往往有人使用的缓冲区的实际大小。如果在输入指定的大小是大于零,但比所需的大小少,您不应该依靠返回的大小重新分配缓冲区。
Windows XP和Windows 2000:添加一个所需的缓冲区大小。
dwDetailLevel [in]
演出详细的项目Level的回报。所有项目都指定详细程度或以下的将被退回(Level提高列出顺序)。此参数可以是下列值之一。
ValueMeaning
PERF_DETAIL_NOVICENovice用户级别的细节。
详细PERF_DETAIL_ADVANCEAdvanced用户级别。
PERF_DETAIL_EXPERTExpert用户级别的细节。
PERF_DETAIL_WIZARDSystem细节设计Level。
bRefresh [in]
指示,如果缓存的对象名单应自动刷新。指定下列值之一。如果您调用这个函数两次,一次获得列表的大小和第二次获得实际的名单,设置此参数为TRUE在第一次调用,并在第二次调用假。如果这两个电话都为真,第二个电话也可以返回PDH_MORE_DATA,因为该对象数据可能调用之间变化。
ValueMeaning
TRUEThe对象自动刷新缓存的对象之前返回。
FALSEDo不会自动刷新缓存。
返回值
如果函数成功,它返回ERROR_SUCCESS。
如果函数失败,返回值是一个系统错误代码或一种PDH错误代码。以下是可能的值。
返回codeDescription
PDH_MORE_DATAThe mszObjectList缓冲区太小举行的对象列表。这个返回值,预计如果pcchBufferLength是在输入为零。如果在输入指定的大小是大于零,但比所需的大小少,您不应该依靠返回的大小重新分配缓冲区。
PDH_CSTATUS_NO_MACHINEThe指定的计算机脱机或不可用。
PDH_CSTATUS_NO_OBJECTThe指定的对象找不到。
PDH_INVALID_ARGUMENTA参数无效。例如,在某些版本中您可以收到此错误如果在输入指定的大小是大于零但小于所需的大小。
Windows 2000中:PDH_INSUFFICIENT_BUFFER可能是一个额外的返回值,这表明,mszObjectList缓冲区太小举行的对象列表。使用pcchBufferLength参数分配所需大小的缓冲区。
备注
您应该调用这个函数两次,第一次获得所需的缓冲区大小(设置mszObjectList为NULL和pcchBufferLength为0),和第二次获取数据。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderPdh.h
LibraryPdh.lib
DLLPdh.dll
Unicode and ANSI namesPdhEnumObjectsW (Unicode) and PdhEnumObjectsA (ANSI)
参见
PdhEnumObjectItems
PdhEnumObjectsH
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月23日
==英文原文==PdhEnumObjects Function
Returns a list of objects available on the specified computer or in the specified log file.
To use handles to data sources, use the PdhEnumObjectsH function.
Syntax
C++
PDH_STATUS PdhEnumObjects(
__in LPCTSTR szDataSource,
__in LPCTSTR szMachineName,
__out LPTSTR mszObjectList,
__inout LPDWORD pcchBufferLength,
__in DWORD dwDetailLevel,
__in BOOL bRefresh
);
Parameters
szDataSource [in]
Null-terminated string that specifies the name of the log file used to enumerate the performance objects. If NULL, the function uses the computer specified in the szMachineName parameter to enumerate the names.
szMachineName [in]
Null-terminated string that specifies the name of the computer used to enumerate the performance objects. 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.
mszObjectList [out]
Caller-allocated buffer that receives the list of object names. Each object name in this list is terminated by a null character. The list is terminated with two null-terminator characters. Set to NULL if the pcchBufferLength parameter is zero.
pcchBufferLength [in, out]
Size of the mszObjectList 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.
Windows XP and Windows 2000: Add one to the required buffer size.
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.

bRefresh [in]
Indicates if the cached object list should be automatically refreshed. Specify one of the following values. If you call this function twice, once to get the size of the list and a second time to get the actual list, set this parameter to TRUE on the first call and FALSE on the second call. If both calls are TRUE, the second call may also return PDH_MORE_DATA because the object data may have changed between calls.
ValueMeaning
TRUEThe object cache is automatically refreshed before the objects are returned.
FALSEDo not automatically refresh the cache.

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 mszObjectList buffer is too small to hold the list of objects. 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_CSTATUS_NO_MACHINEThe specified computer is offline or unavailable.
PDH_CSTATUS_NO_OBJECTThe specified object could not be found.
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.

Windows 2000: PDH_INSUFFICIENT_BUFFER is an additional possible return value, which indicates that the mszObjectList buffer is too small to hold the list of objects. Use the pcchBufferLength parameter to allocate the required size buffer.
Remarks
You should call this function twice, the first time to get the required buffer size (set mszObjectList to NULL and pcchBufferLength 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 namesPdhEnumObjectsW (Unicode) and PdhEnumObjectsA (ANSI)
See Also
PdhEnumObjectItems
PdhEnumObjectsH
Send comments about this topic to Microsoft
Build date: 7/23/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa372600(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:35