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.

Syntax


NET_API_STATUS NetUseGetInfo(
  _In_   LMSTR UncServerName,
  _In_   LMSTR UseName,
  _In_   DWORD Level,
  _Out_  LPBYTE *BufPtr
);

Parameters

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.

ValueMeaning
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.

 

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.

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

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Lmuse.h (include Lm.h)

Library

Netapi32.lib

DLL

Netapi32.dll

See also

NetUseEnum
Network Management Overview
Network Management Functions
Use Functions
USE_INFO_0
USE_INFO_1
USE_INFO_2
WNetGetConnection

 

 

Community Additions

ADD
Show:
© 2014 Microsoft