Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

NetUseGetInfo function

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.


  _In_  LMSTR  UncServerName,
  _In_  LMSTR  UseName,
  _In_  DWORD  Level,
  _Out_ LPBYTE *BufPtr


UncServerName [in]

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.

UseName [in]

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.

Level [in]

The information level of the data requested. This parameter can be one of the following values.


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.


BufPtr [out]

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.


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.


Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]


Lmuse.h (include Lm.h)





See also

Network Management Overview
Network Management Functions
Use Functions



Community Additions

© 2015 Microsoft