Skip to content

Latest commit

 

History

History
76 lines (59 loc) · 2.98 KB

NetApiBufferFree.md

File metadata and controls

76 lines (59 loc) · 2.98 KB

Home

Function name : NetApiBufferFree

Group: Network Management - Library: netapi32


Frees the memory that the NetApiBufferAllocate function allocates. Call NetApiBufferFree to free the memory that other network management functions return on Windows NT, Windows 2000, and Windows XP.


Code examples:

Enumerating files opened on the network
Enumerating servers of the specified type (e.g. SQL Server) in the primary domain
Retrieving the name of the primary domain controller (PDC) and join status information
Retrieving information about all users currently logged on to the workstation (WinNT only)
Enumerating connections made to a shared resource for the local computer (WinNT only)
Obtaining information about all user accounts on a server (WinNT only)
How to enumerate, add and delete shares on the local computer (WinNT/XP)
Enumerating global and local group accounts on a server (WinNT/XP/2K)
Retrieving configuration information for the specified server (Win2000/XP)
Obtaining names of local and global groups for current user (WinNT/XP/2K)
Using NetWkstaTransportEnum to obtain MAC Address of remote server
Retrieving configuration information for the specified workstation (Win2000/XP)
Adding and deleting User Accounts
Adding and deleting Scheduled Tasks using NetScheduleJob API functions
Using the NetMessageBufferSend to send messages on the network
Enumerating network sessions established on a server
Finding out if the current user is the Guest account

Declaration:

NET_API_STATUS NetApiBufferFree(
  LPVOID Buffer
);  

FoxPro declaration:

DECLARE INTEGER NetApiBufferFree IN netapi32;
	INTEGER Buffer  

Parameters:

Buffer [in] Pointer to a buffer returned previously by another network management function.


Return value:

If the function succeeds, the return value is NERR_Success (0). If the function fails, the return value is a system error code.


Comments:

Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Unsupported.

Various NetApi functions

  • NetServerEnum
  • NetConnectionEnum
  • NetUserEnum
  • NetWkstaUserEnum
  • NetShareEnum
  • NetGetDCName
  • NetGroupEnum
  • NetLocalGroupEnum and more... implicitly allocate a memory buffer and require it to be freed after the call is complete.