[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
DosGetSegLimit() Get size limit of segment selector.
------------------------------------------------------------------------------
Function : Get the size limit of a segment selector.
Syntax : USHORT BLXAPI DosGetSegLimit( SEL selector,
PULONG seglimit);
selector A valid selector number.
seglimit Pointer to a long integer to receive the size limit of the
selector.
Return : The segment limit of the specified selector.
The segment limit is the highest offset within a segment that can be
addressed.
Example:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <blx286.h>
#define VID_BUF 0xB800
#define VID_SIZE 0x8000l
void main (void)
{
SEL video_buffer;
ULONG seglimit;
/* Get selector that corresponds to the screen buffer */
if (DosMapRealSeg(VID_BUF,VID_SIZE,&video_buffer) != 0)
{
printf("Unable to map screen segment\n");
exit(255);
}
printf("Selector for video buffer %04X\n",video_buffer);
if (DosGetSegLimit(video_buffer, &seglimit) == 0)
/* Value returned should be 0x7fff in this example */
printf("Screen segment limit : %08X\n",seglimit);
}
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson