@msdn=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netmgmt/netmgmt/netapibufferfree.asp @pinvoke=http://pinvoke.net/$$$.htm Summary: Frees the memory allocated by network management functions. !!!!C# Signature: [DllImport("Netapi32.dll", SetLastError=true)] static extern int NetApiBufferFree(IntPtr Buffer); !!!!VB .NET Signature: Declare Unicode Function NetApiBufferFree Lib "netapi32.dll" _ (ByVal buffer As IntPtr) As Long !!!!User-Defined Types: None. !!!!Notes: [2008-06-19, Christian Stoeckel] Changed VB.NET Signature from "ByRef buffer" to "ByVal buffer". With ByRef you get a significant memory leak, with ByVal everything is fine. [2004-06-11, Ray Ackley] Added VB definition & sample. [2004-05-20, Nicholas Paldino] There is no indication that the NetApiBufferFree function sets the last error code, so SetLastError attribute should not be set (this removes extra calls in the interop layer to store the last error code). Also, the CharSet property on the attribute need not be applied either, as there is only one version of this function. !!!!Tips & Tricks: referenced by NetWkstaGetInfo !!!!Sample Code: VB.NET: ' Edited down code to only show usage of NetApiBufferFree() Dim BufPtr As IntPtr 'in retval = NetShareEnum(SvrNameBldr, 2, BufPtr, MAX_PREFERRED_LENGTH, dwEntriesread, dwTotalentries, dwResumehandle) Call NetApiBufferFree(BufPtr) !!!!Alternative Managed API: TODO Documentation: NetApiBufferFree@msdn on MSDN
Edit netapi32.netapibu...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.