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> dosfreerealseg()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DosFreeRealSeg()
------------------------------------------------------------------------------
 Purpose:
 Free a selector previously allocated with DosAllocRealSeg().

 Syntax:
 USHORT BLXAPI DosFreeRealSeg(SEL selector);

 Parameters:
 selector  Protected mode selector of a conventional memory block allocated
           through DosAllocRealSeg().

 Returns:
 None.

 Description:
 This function is used to free conventional memory blocks allocated through
 DosAllocRealSeg(), and should not be used to free any other type of selector
 or memory block.

 Note that the memory freed by DosFreeRealSeg() will only be returned to the
 DOS extender, not all the way to DOS, until the program exits. As a result,
 DosRealAvail() may not reflect the increase in memory, although
 DosAllocRealSeg() will still be able to allocate the memory again.

 Example:
 #include <stdlib.h>                                                         
 #include <stdio.h>                                                          
 #include <string.h>                                                         
 #include <blx286.h>                                                         
                                                                             
 void main(void)                                                             
 {                                                                           
 SEL         selector;                                                       
 USHORT      paragraph;                                                      
                                                                             
 /* Allocate a 4 Kb block */                                                 
 if (DosAllocRealSeg(4096, &paragraph, &selector) != 0)                      
    {                                                                        
    printf("DosAllocRealSeg() failed\n");                                    
    exit(255);                                                               
    }                                                                        
 printf("4 Kb conventional block allocated\n");                              
 printf("Selector for block : %04X\n",selector);                             
 printf("Segment of block : %04X\n",paragraph);                              
 if (DosFreeRealSeg(selector) != 0)                                          
    {                                                                        
    printf("DosFreeRealSeg() failed - selector=%04X\n", selector);           
    exit(254);                                                               
    }                                                                        
 }                                                                           

See Also: DosAllocRealSeg() DosFreeSeg() DosFreeSelector()

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