Platform SDK: Network Management

NetAccessEnum

Windows 95/98: The NetAccessEnum function retrieves information about each access permission record.

Windows NT/2000: The NetAccessEnum function is obsolete on Windows NT/Windows 2000. Win32-based applications should use the GetFileSecurity and SetFileSecurity functions.

Security Requirements

Requires Admin privilege to successfully execute on a computer that has local security enabled.

extern API_FUNCTION
 NetAccessEnum(
  const char FAR * pszServer, 
  char FAR * pszBasePath, 
  short fsRecursive, 
  short sLevel, 
  char FAR * pbBuffer, 
  unsigned short cbBuffer, 
  unsigned short FAR * pcEntriesRead, 
  unsigned short FAR * pcTotalAvail 
);

Parameters

pszServer
Pointer to a string specifying the name of the remote server on which the function is to execute. The string must begin with \\. If this parameter is NULL, the local computer is used.
pszBasePath
Pointer to a string that contains a base pathname for the resource. A NULL pointer or NULL string means no base path is to be used. The path can be specified as a universal naming convention (UNC) pathname.
fsRecursive
Specifies a flag that enables or disables recursive searching.

If this parameter is equal to zero, the NetAccessEnum function returns entries for the resource named as the base path by the pszBasePath parameter, and for the resources directly below that base path.

If this parameter is nonzero, the function returns entries for all access-control lists (ACLs) that have pszBasePath at the beginning of the resource name.

sLevel
Specifies the information level of the data. This parameter can be one of the following values.
Value Meaning
0 The pbBuffer parameter points to an access_info_0 structure.
1 The pbBuffer parameter points to an access_info_1 structure.

pbBuffer
Pointer to the buffer that receives the access information structure. The format of this data depends on the value of the sLevel parameter.
cbBuffer
Specifies the size, in bytes, of the buffer pointed to by the pbBuffer parameter.
pcEntriesRead
Pointer to an unsigned short integer that receives the count of elements actually enumerated. The count is valid only if the NetAccessEnum function returns NERR_Success or ERROR_MORE_DATA.
pcTotalAvail
Pointer to an unsigned short integer that receives the total number of entries that could have been enumerated. The count is valid only if the NetAccessEnum function returns NERR_Success or ERROR_MORE_DATA.

Return Values

If the function succeeds, the return value is NERR_Success.

If the function fails, the return value is a Win32 API error code. For a list of error codes, see Error Codes.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Lmaccess.h (Windows NT/2000) or Svrapi.h (Windows 95/98); include Lm.h (Windows NT/2000).
  Library: Use Netapi32.lib (Windows NT/2000) or Svrapi.lib (Windows 95/98).

See Also

Network Management Overview, Network Management Functions, Access Functions, access_list, access_info_0, access_info_1, NetAccessCheck, NetAccessGetInfo