From aldeid
Jump to navigation Jump to search


Locks a global memory object and returns a pointer to the first byte of the object's memory block.

Note The global functions have greater overhead and provide fewer features than other memory management functions. New applications should use the heap functions unless documentation states that a global function should be used.


<syntaxhghlight lang="cpp"> LPVOID WINAPI GlobalLock(

 _In_ HGLOBAL hMem

); </syntaxhighlight>


hMem [in]
A handle to the global memory object. This handle is returned by either the GlobalAlloc or GlobalReAlloc function.

Return value

If the function succeeds, the return value is a pointer to the first byte of the memory block.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.