The GlobalLock function locks a global memory object and returns a pointer to the first byte of the object's memory block.
LPVOID GlobalLock( HGLOBAL hMem )
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.
EX1
void GlobalLock_Ex1() { int nBytes = 200; HGLOBAL hData = GlobalAlloc(GHND,nBytes); char* pstr = (char *)GlobalLock(hData) ; if(NULL==pstr) { out_str("failed to Lock the memory\n"); return ; } else printf("the first byte of the object's memory address: (0x)%x",pstr); GlobalUnlock(hData); GlobalFree(hData); }
GlobalReAlloc, GlobalReAlloc, GlobalFree, GlobalSize, GlobalUnlock
origin.h