GlobalWire

Syntax

LPSTR GlobalWire(hMem)

This function moves a segment into low memory and locks it—a procedure that is extremely useful if an application must lock a segment for a long period of time. If a segment from the middle portion of memory is locked for a long period of time, it causes memory-management problems by reducing the size of the largest, contiguous available block of memory. The GlobalWire function moves a segment to the lowest possible address in memory and locks it, thereby freeing the memory area Windows uses most often.

Each time an application calls GlobalWire for an object, it must eventually call Global-UnWire for the object. The GlobalUnWire function decreases the lock count for the object. Other functions also can affect the lock count of a memory object. See the description of the GlobalFlags function for a list of the functions that affect the lock count.

An application must not call the GlobalUnlock function to unlock the object.

Parameter Type/Description  

hMem HANDLE Identifies the segment that will be moved and locked.  

Return Value

The return value points to the new segment location. It is NULL if the function failed.