LocalFree

2.x

  HLOCAL LocalFree(hloc)    
  HLOCAL hloc; /* handle of local memory object */

The LocalFree function frees the given local memory object (if the object is not locked) and invalidates its handle.

Parameters

hloc

Identifies the local memory object to be freed.

Return Value

The return value is NULL if the function is successful. Otherwise, it is equal to the hloc parameter.

Comments

An application cannot use the LocalFree function to free a locked memory object—that is, a memory object with a lock count greater than zero.

After freeing the handle of the memory object, an application cannot use the handle again. An attempt to free the same memory object more than once can cause Windows to terminate abnormally.

See Also

LocalFlags, LocalLock