3.3 Segment Functions

Segment functions allocate, free, and convert selectors; lock and unlock memory objects referenced by selectors; and retrieve information about segments. Following are the selector functions:

Function Description

AllocDStoCSAlias Accepts a data-segment (DS) selector and returns a code-segment (CS) selector that can be used to execute code in a data segment.
AllocSelector Allocates a new selector.
FreeSelector Frees a selector originally allocated by the Alloc-DStoCSAlias or AllocSelector function.
GetCodeInfo Retrieves information about a code segment.
GetSelectorBase Returns the base of a selector.
GetSelectorLimit Returns the limit of a selector.
GlobalFix Prevents a global memory object from moving in linear memory.
GlobalPageLock Page-locks the memory associated with the specified global selector and increments its page-lock count. Memory that is page-locked cannot be moved or paged out to disk.
GlobalPageUnlock Decrements the page-lock count for the memory associated with the specified global selector. If the page-lock count reaches zero, the memory can be moved and paged out to disk.
GlobalUnfix Unlocks a global memory object previously fixed by the GlobalFix function.
LockSegment Locks a segment in memory.
PrestoChangoSelector Generates a temporary code selector that corresponds to a given data selector or a temporary data selector that corresponds to a given code selector.
SetSelectorBase Sets the base of a selector.
SetSelectorLimit Sets the limit of a selector.
UnlockSegment Unlocks a segment previously locked by the LockSegment function.

Note:

An application should not use these functions unless it is absolutely necessary. Use of these functions violates preferred Windows programming practices.