网站首页  词典首页

请输入您要查询的函数:

 

术语 netuseenum
释义 NetUseEnum
语法:
C++
NET_API_STATUS NetUseEnum(
__in LMSTR UncServerName,
__in DWORD Level,
__out LPBYTE *BufPtr,
__in DWORD PreferedMaximumSize,
__out LPDWORD EntriesRead,
__out LPDWORD TotalEntries,
__inout LPDWORD ResumeHandle
);
NetUseEnum功能
列出的NetUseEnum函数之间的本地计算机和远程服务器上的资源,目前所有的连接。
您还可以使用WNetOpenEnum和WNetEnumResource函数来枚举网络资源或连接。
参数
UncServerName [in]
在计算机上执行此功能的UNC名称。如果这是参数为NULL,则使用本地计算机。如果UncServerName参数指定远程计算机,然后在远程计算机必须支持远程RPC调用使用传统的远程访问协议的机制。
这个字符串是Unicode或FORCE_UNICODE如果_WIN32_WINNT定义。
Level [in]
数据的信息化Level的要求。此参数可以是下列值之一。
ValueMeaning
0Specifies本地设备的名称和远程资源的共享名称。在BufPtr参数指向一个USE_INFO_0结构的数组。
1Specifies信息之间的本地设备和共享的资源,包括连接状态和连接类型。在BufPtr参数指向一个USE_INFO_1结构的数组。
2Specifies有关地方之间的设备和共享资源的连接。信息包括连接状态,连接类型,用户名和域名。在BufPtr参数指向一个USE_INFO_2结构的数组。
BufPtr [out]
一个缓冲区,接收信息结构的指针。这些数据的格式取决于该级别的参数值。此缓冲区分配制度,必须使用NetApiBufferFree释放函数的信息时,不再需要。请注意,您必须释放缓冲区,即使函数ERROR_MORE_DATA失败。
PreferedMaximumSize [in]
首选的最大长度,以字节的数据返回。如果MAX_PREFERRED_LENGTH指定,函数分配用于数据所需的内存量。如果其他值在这个参数指定,它可以限制的字节数函数返回。如果缓冲区大小不足以容纳所有作品,该函数返回ERROR_MORE_DATA。有关更多信息,请参阅网络管理功能,缓冲器和网络管理功能缓冲区长度。
EntriesRead [out]
一个值,接收元素计数实际列举的指针。
TotalEntries [out]
一个值,得到了本来可以参赛作品总数的指针从当前列举的恢复状况。请注意,应用程序应考虑仅作为提示此值。
ResumeHandle [ in , out ]
一个值,包含一个恢复处理,用来继续搜索指针。手柄应在第一次调用零,离开后续调用不变。如果ResumeHandle为NULL,则没有恢复处理存储。
返回值
如果函数成功,返回值是NERR_Success。
如果函数失败,返回值是一个系统错误代码。对于一个错误代码的列表,请参见系统错误代码。
返回codeDescription
ERROR_INVALID_PARAMETERAn无效的参数传递给函数。此错误,则返回一个NULL指针,如果是在BufPtr或entriesread参数传递。
ERROR_MORE_DATAThere是更多的数据返回。返回此错误,如果缓冲区大小不足以容纳所有条目。
ERROR_NOT_SUPPORTEDThe不支持请求。返回此错误,如果UncServerName参数,不为NULL和远程服务器不支持远程RPC调用使用传统的远程访问协议的机制。
OtherUse FormatMessage获取返回的错误消息字符串。
备注
没有特殊组成员必须调用NetUseEnum功能。此函数不能执行远程服务器上的除外下级兼容使用旧例远程访问协议。
检索有关一个网络连接的信息,您可以调用NetUseGetInfo功能。
此功能仅适用于服务器消息块(LAN管理工作站)客户端。该NetUseEnum函数不支持分布式文件系统(DFS)的股票。枚举股份使用不同的网络提供商控制(WebDAV或DFS共享,例如),使用WNetOpenEnum,WNetEnumResource和WNetCloseEnum功能。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderLmuse.h(包括Lm.h或Lmcons.h)
LibraryNetapi32.lib
DLLNetapi32.dll
参见
NetUseGetInfo
网络管理概述
网络管理功能
使用功能
USE_INFO_0
USE_INFO_1
USE_INFO_2
WNetCloseEnum
WNetEnumResource
WNetOpenEnum
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月13日
==英文原文==NetUseEnum Function
The NetUseEnum function lists all current connections between the local computer and resources on remote servers.
You can also use the WNetOpenEnum and the WNetEnumResource functions to enumerate network resources or connections.
Syntax
C++
NET_API_STATUS NetUseEnum(
__in LMSTR UncServerName,
__in DWORD Level,
__out LPBYTE *BufPtr,
__in DWORD PreferedMaximumSize,
__out LPDWORD EntriesRead,
__out LPDWORD TotalEntries,
__inout LPDWORD ResumeHandle
);
Parameters
UncServerName [in]
The UNC name of the computer on which to execute this function. If this is parameter is NULL, then the local computer is used. If the UncServerName parameter specified is a remote computer, then the remote computer must support remote RPC calls using the legacy Remote Access Protocol mechanism.
This string is Unicode if _WIN32_WINNT or FORCE_UNICODE are defined.
Level [in]
The information level of the data requested. This parameter can be one of the following values.
ValueMeaning
0Specifies a local device name and the share name of a remote resource. The BufPtr parameter points to an array of USE_INFO_0 structures.
1Specifies information about the connection between a local device and a shared resource, including connection status and type. The BufPtr parameter points to an array of USE_INFO_1 structures.
2Specifies information about the connection between a local device and a shared resource. Information includes the connection status, connection type, user name, and domain name. The BufPtr parameter points to an array of USE_INFO_2 structures.

BufPtr [out]
A pointer to the buffer that receives the information structures. The format of this data depends on the value of the Level parameter. This buffer is allocated by the system and must be freed using the NetApiBufferFree function when the information is no longer needed. Note that you must free the buffer even if the function fails with ERROR_MORE_DATA.
PreferedMaximumSize [in]
The preferred maximum length, in bytes, of the data to return. If MAX_PREFERRED_LENGTH is specified, the function allocates the amount of memory required for the data. If another value is specified in this parameter, it can restrict the number of bytes that the function returns. If the buffer size is insufficient to hold all entries, the function returns ERROR_MORE_DATA. For more information, see Network Management Function Buffers and Network Management Function Buffer Lengths .
EntriesRead [out]
A pointer to a value that receives the count of elements actually enumerated.
TotalEntries [out]
A pointer to a value that receives the total number of entries that could have been enumerated from the current resume position. Note that applications should consider this value only as a hint.
ResumeHandle [in, out]
A pointer to a value that contains a resume handle which is used to continue the search. The handle should be zero on the first call and left unchanged for subsequent calls. If ResumeHandle is NULL, then no resume handle is stored.
Return Value
If the function succeeds, the return value is NERR_Success.
If the function fails, the return value is a system error code. For a list of error codes, see System Error Codes .
Return codeDescription
ERROR_INVALID_PARAMETERAn invalid parameter was passed to the function. This error is returned if a NULL pointer is passed in the BufPtr or entriesread parameters.
ERROR_MORE_DATAThere is more data to return. This error is returned if the buffer size is insufficient to hold all entries.
ERROR_NOT_SUPPORTEDThe request is not supported. This error is returned if the UncServerName parameter was not NULL and the remote server does not support remote RPC calls using the legacy Remote Access Protocol mechanism.
OtherUse FormatMessage to obtain the message string for the returned error.

Remarks
No special group membership is required to call the NetUseEnum function. This function cannot be executed on a remote server except in cases of downlevel compatibility using the legacy Remote Access Protocol.
To retrieve information about one network connection, you can call the NetUseGetInfo function.
This function applies only to the Server Message Block (LAN Manager Workstation) client. The NetUseEnum function does not support Distributed File System (DFS) shares. To enumerate shares using a different network provider (WebDAV or a DFS share, for example), use the WNetOpenEnum, WNetEnumResource, and WNetCloseEnum functions.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderLmuse.h (include Lm.h or Lmcons.h)
LibraryNetapi32.lib
DLLNetapi32.dll
See Also
NetUseGetInfo
Network Management Overview
Network Management Functions
Use Functions
USE_INFO_0
USE_INFO_1
USE_INFO_2
WNetCloseEnum
WNetEnumResource
WNetOpenEnum
Send comments about this topic to Microsoft
Build date: 8/13/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa370647(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:17:10