LocalUnlock
The LocalUnlock
function decrements the lock count associated with a memory object that was
allocated with the LMEM_MOVEABLE flag. This function has no effect on memory
objects allocated with the LMEM_FIXED flag.
BOOL LocalUnlock(
HLOCAL hMem |
// handle of local
memory object |
); |
|
Parameters
hMem
Identifies
the local memory object. This handle is returned by either the LocalAlloc
Return Values
If the memory
object is still locked after decrementing the lock count, the return value is
nonzero.
If the
function fails, the return value is zero. To get extended error information,
call GetLastError
Remarks
The internal
data structures for each memory object include a lock count that is initially
zero. For movable memory objects, the LocalLock
If the memory
object is already unlocked, LocalUnlock returns FALSE and GetLastError
reports ERROR_NOT_LOCKED. Memory objects allocated with the LMEM_FIXED flag
always have a lock count of zero and cause the ERROR_NOT_LOCKED error.
A process
should not rely on the return value to determine the number of times it must
subsequently call LocalUnlock for the memory block.
See Also