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> dosfreeseg()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DosFreeSeg()
------------------------------------------------------------------------------
 Purpose:
 Free a memory block allocated with DosAllocSeg() or DosAllocHuge().

 Syntax:
 USHORT BLXAPI DosFreeSeg(SEL selector);

 Parameters:
 selector  Protected mode selector of a memory block allocated through
           DosAllocSeg() or DosAllocHuge().

 Returns:
 None.

 Description:
 This function is used to free memory blocks allocated through DosAllocSeg()
 or DosAllocHuge() 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>                                                         
                                                                             
 void main (void)                                                            
 {                                                                           
 SEL         selector;                                                       
                                                                             
 /* Allocate a 4Kb block */                                                  
 if (DosAllocSeg(4096, &selector, 0) != 0)                                   
    {                                                                        
    printf("DosAllocSeg() failed\n");                                        
    exit(255);                                                               
    }                                                                        
 printf("4 Kb block allocated at : %04X\n",selector);                        
 if (DosFreeSeg(selector) != 0)                                              
    {                                                                        
    printf("DosFreeSeg() failed - selector = %04X\n", selector);             
    exit(254);                                                               
    }                                                                        
 }                                                                           

See Also: DosFreeRealSeg() DosFreeSelector()

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