LocalFree (kernel32)
Last changed: -151.145.238.91

.
Summary
Frees the specified local memory object and invalidates its handle.

C# Signature:

[DllImport("kernel32.dll", SetLastError=true)]
static extern IntPtr LocalFree(IntPtr hMem);

User-Defined Types:

None.

Notes:

[2004-05-24 - Nicholas Paldino]

The SetLastError flag needs to be set to true in order to retain information that would be obtained from GetLastError in the event of an error being returned.

[2004-07-26 - Toby Patke]

If you need to access this function from a Pocket PC, the DLL you want is: \Windows\coredll.dll

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

System.Runtime.InteropServices.Marshal.FreeHGlobal

Documentation
LocalFree on MSDN