GlobalUnlock
The GlobalUnlock
function decrements the lock count associated with a memory object that was
allocated with the GMEM_MOVEABLE flag. This function has no effect on memory
objects allocated with the GMEM_FIXED flag.
BOOL GlobalUnlock(
HGLOBAL hMem |
// handle to the
global memory object |
); |
|
Parameters
hMem
Identifies
the global memory object. This handle is returned by either the GlobalAlloc
Return Values
If the memory
object is still locked after decrementing the lock count, the return value is a
nonzero value.
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 GlobalLock
Memory
objects allocated with the GMEM_FIXED flag always have a lock count of zero. If
the specified memory block is fixed memory, this function returns TRUE.
If the memory
object is already unlocked, GlobalUnlock returns FALSE and GetLastError
A process
should not rely on the return value to determine the number of times it must
subsequently call GlobalUnlock for a memory object.
See Also