Platform SDK: Network Management |
The NetUseEnum function lists all current connections between the local computer and resources on remote servers.
Win32-based applications can also use the WNetOpenEnum and the WNetEnumResource functions to enumerate network resources or connections.
No special group membership is required to call the NetUseEnum function. This function cannot be executed on a remote server.
NET_API_STATUS NetUseEnum ( LPWSTR UncServerName, DWORD Level, LPBYTE *BufPtr, DWORD PreferedMaximumSize, LPDWORD EntriesRead, LPDWORD TotalEntries, LPDWORD ResumeHandle );
Value | Meaning |
---|---|
0 | Specifies a local device name and the share name of a remote resource. The BufPtr parameter points to an array of USE_INFO_0 structures. |
1 | Specifies 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. |
2 | Specifies 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. |
If the function succeeds, the return value is NERR_Success.
If the function fails, the return value is a Win32 API error code. For a list of error codes, see Error Codes.
To retrieve information about one network connection, you can call the NetUseGetInfo function.
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Unsupported.
Header: Declared in Lmuse.h; include Lm.h.
Library: Use Netapi32.lib.
Network Management Overview, Network Management Functions, Use Functions, USE_INFO_0, USE_INFO_1, USE_INFO_2, NetUseGetInfo, WNetEnumResource, WNetOpenEnum