NetShareEnum

NetShareEnum retrieves information about each shared resource on a server. The NetShareEnum 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 comm, print, or server operator group membership is required to successfully execute NetShareEnum at level 2. No special group membership is required for level 0 or level 1 calls.

NET_API_STATUS NetShareEnum(
  LPWSTR servername,     
  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.
level
Level of information required. 0, 1, 2, and 502 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 resume_handle, and is used to continue an existing share 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