LocalLock

2.x

  void NEAR* LocalLock(hloc)    
  HLOCAL hloc; /* handle of local memory object */

The LocalLock function retrieves a pointer to the given local memory object. LocalLock increments (increases by one) the lock count of movable objects and locks the memory.

Parameters

hloc

Identifies the local memory object to be locked.

Return Value

The return value points to the first byte of memory in the local object, if the function is successful. It is NULL if the object has been discarded or an error occurs.

Comments

Each time an application calls LocalLock for an object, it must eventually call LocalUnlock for the object.

This function will return NULL if an application attempts to lock a memory object with a size of 0 bytes.

The LocalUnlock function decrements (decreases by one) the lock count for the object if LocalLock incremented the count. Other functions can also affect the lock count of a memory object.

Locked memory will not be moved or discarded unless the memory object is reallocated by the LocalReAlloc function. The object remains locked in memory until its lock count is decreased to zero.

Discarded objects always have a lock count of zero.

See Also

LocalFlags, LocalReAlloc, LocalUnlock