NetUseGetInfo function (lmuse.h)
The NetUseGetInfo function retrieves information about a connection to a shared resource.
You can also use the WNetGetConnection function to retrieve the name of a network resource associated with a local device.
Syntax
NET_API_STATUS NET_API_FUNCTION NetUseGetInfo(
[in] LMSTR UncServerName,
[in] LMSTR UseName,
[in] DWORD LevelFlags,
[out] LPBYTE *bufptr
);
Parameters
[in] UncServerName
The UNC name of 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.
[in] UseName
A pointer to a string that specifies the name of the connection for which to return information.
This string is Unicode if _WIN32_WINNT or FORCE_UNICODE are defined.
[in] LevelFlags
The information level of the data requested. This parameter can be one of the following values.
Value | Meaning |
---|---|
|
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. |
|
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. |
|
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. |
[out] bufptr
A pointer to the buffer that receives the data. 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. For more information, see Network Management Function Buffers and Network Management Function Buffer Lengths.
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.
Remarks
No special group membership is required to call the NetUseGetInfo function. This function cannot be executed on a remote server except in cases of downlevel compatibility.
To list all current connections between the local computer and resources on remote servers, you can call the NetUseEnum function.
This function applies only to the Server Message Block (LAN Manager Workstation) client. The NetUseGetInfo function does not support Distributed File System (DFS) shares. To retrieve information for a share using a different network provider (WebDAV or a DFS share, for example), use the WNetGetConnection function.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | lmuse.h (include Lm.h) |
Library | Netapi32.lib |
DLL | Netapi32.dll |