Platform SDK: Network Management |
The NetUseGetInfo function retrieves information about a connection to a shared resource.
Win32-based applications can also use the WNetGetConnection function to retrieve the name of a network resource associated with a local device.
No special group membership is required to call the NetUseGetInfo function. This function cannot be executed on a remote server.
NET_API_STATUS NetUseGetInfo ( LPWSTR UncServerName, LPWSTR UseName, DWORD Level, LPBYTE *BufPtr );
Value | Meaning |
---|---|
0 | Specifies a local device name and the share name of a remote resource. The BufPtr parameter is a pointer to a USE_INFO_0 structure. |
1 | Specifies information about the connection between a local device and a shared resource, including connection status and type. The BufPtr parameter is a pointer to a USE_INFO_1 structure. |
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 is a pointer to a USE_INFO_2 structure. |
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 list all current connections between the local computer and resources on remote servers, you can call the NetUseEnum 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, WNetGetConnection, NetUseEnum