Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Blinker 5.10 Online Reference - <b> dosgetseglimit()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DosGetSegLimit()
------------------------------------------------------------------------------
 Purpose:
 Get the size limit of a segment selector.

 Syntax:
 USHORT BLXAPI DosGetSegLimit(SEL selector, PULONG seglimit);

 Parameters:
 selector  A valid selector number.
 seglimit  Pointer to a long integer to receive the size limit of the
           selector.

 Returns:
 The segment limit of the specified selector.

 Description:
 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);                        
 }                                                                           

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson