Next: Get_Next_Selector_Increment_Value
Up: Functions and Procedures
Previous: Free_Ldt_Descriptor
Function Segment_To_Descriptor (Seg : Word) : Word;
Segment_To_Descriptor Maps a real mode segment (paragraph) address
(in Seg) onto an descriptor that can be used by a protected mode
program to access the same memory.
The function returns a selector to the DOS real-mode segment.
Notes:
- Only works with real DPMI.
- The descriptors limit will be set to 64KB.
- multiple calls to this function with the same segment address will
return the same selector.
- Descriptors created by this function can never be modified or freed.
For this reason this function shouldn't be used too often. Programs
which need to examine various real mode addresses using the same
selector should use the function allocate_ldt_descriptors and change
the base address as necessary.
None.
- Example
-
uses go32;
var r : trealregs;
VGAsel : word;
begin
r.realeax := $13; realintr($10, r);
{ set VGA mode 13h }
VGASel := segment_to_descriptor($A000);
{...}
seg_fillchar(VGAsel, 100*320+6, 1, 15);
{ put a pixel at (6/100) in color 15 }
readln;
{...}
r.realeax := $3; realintr($10, r);
end.
Michael Van Canneyt
Tue Mar 31 16:46:10 CEST 1998