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> dosfreeselector()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DosFreeSelector()
------------------------------------------------------------------------------
 Purpose:
 Free a selector allocated with DosMapRealSeg(), DosCreateCSAlias() or
 DosCreateDSAlias().

 Syntax:
 USHORT BLXAPI DosFreeSelector(SEL selector);

 Parameters:
 selector  Selector allocated through DosMapRealSeg(), DosCreateCSAlias()
           or DosCreateDSAlias().

 Returns:
 None.

 Description:
 This function is used to free alias selectors (created with
 DosCreateDSAlias() or DosCreateCSAlias()) or selectors created using
 DosMapRealSeg(), and should not be used to free any other type of selector.

 Example:
 #include <stdlib.h>                                                         
 #include <stdio.h>                                                          
 #include <string.h>                                                         
 #include <blx286.h>                                                         
                                                                             
 #define VID_BUF 0xB800                                                      
 #define VID_SIZE 0x8000l                                                    
                                                                             
 unsigned char far *VideoBuffer;                                             
                                                                             
 void main (void)                                                            
 {                                                                           
 SEL         selector;                                                       
 ULONG    screen_address;                                                    
                                                                             
 /* Get a selector that corresponds to the screen buffer */                  
 if (DosMapRealSeg(VID_BUF,VID_SIZE,&selector) != 0)                         
    {                                                                        
    printf("Unable to map screen segment\n");                                
    exit(255);                                                               
    }                                                                        
 VideoBuffer = MK_FP(selector,0);                                            
 *VideoBuffer[0] = "X";        /* Write to screen */                         
 if (DosFreeSelector(selector)==0)                                           
    printf("Video buffer selector now invalid\n");                           
 }                                                                           

See Also: DosFreeRealSeg() DosFreeSeg()

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