NetConnectionEnum

The NetConnectionEnum function lists all connections made to a shared resource on the server or all connections established from a particular computer. If there is more than one user using this connection, then it is possible to get more than one structure for the same connection, but with a different user name. The NetConnectionEnum function is obsolete. It is provided only for compatibility with LAN Manager and 16-bit versions of Windows. Win32-based applications should use the WNetEnumResource function.

Security Requirements

Admin or server, print, or comm operator group membership is required to successfully execute NetConnectionEnum.

NET_API_STATUS NetConnectionEnum(
  LPWSTR servername,     
  LPWSTR qualifier,      
  DWORD level,           
  LPTBYTE *bufptr,       
  DWORD prefmaxlen,      
  LPDWORD entriesread,   
  LPDWORD totalentries,  
  LPDWORD resume_handle, 
);
 

Parameters

servername
A pointer to a Unicode string containing the name of the remote server on which the function is to execute. A NULL pointer or string specifies the local computer.
qualifier
A pointer to a Unicode string containing a share name or computer name for the connections of interest. If it is a share name, then all the connections made to that share name are listed. If it is a computer name (for example, it starts with two backslash characters), then NetConnectionEnum lists all connections made from that computer to the server specified.
level
Level of information required. 0 and 1 are valid.
bufptr
On return a pointer to the return information structure is returned in the address pointed to by bufptr.
prefmaxlen
Prefered maximum length of returned data (in 8-bit bytes).
entriesread
On return the actual enumerated element count is located in the DWORD pointed to by entriesread.
totalentries
On return the total number of entries that could have been enumerated from the current resume position is located in the DWORD pointed to by totalentries.
Resume_handle
On return, a resume_handle is stored in the DWORD pointed to by resumehandle, and is used to continue an existing connection search. The handle should be zero on the first call and left unchanged for subsequent calls. If resume_handle is NULL, then no resume handle is stored.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in lmshare.h.
  Import Library: Use netapi32.lib (Windows NT) or svrapi.lib (Windows 95).

See Also

Networking (Net) Overview, Net Functions