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> dosreallocseg()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DosReallocSeg()
------------------------------------------------------------------------------
 Purpose:
 Resize an extended memory block of up to 64 Kb.

 Syntax:
 USHORT BLXAPI DosReallocSeg(USHORT size, SEL selector);

 Parameters:
 size      New size of segment in bytes (0 = 64 Kb).
 selector  Selector originally returned by DosAllocSeg() when the
           memory block was allocated.

 Returns:
 None.

 Description:
 DosReallocSeg() changes the size of a memory block originally allocated
 with DosAllocSeg(). The block may not be reallocated to a size larger than
 64 Kb (use DosAllocHuge()/DosReallocHuge() to allocate/reallocate huge
 memory blocks).

 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("4Kb block allocated at : %04X\n",selector);                         
 /* Expand block to 8Kb */                                                   
 if (DosReallocSeg(8192, &selector) != 0)                                    
    {                                                                        
    printf("DosReallocSeg() failed\n");                                      
    exit(254);                                                               
    }                                                                        
 printf("Block successfully expanded to 8 kb\n");                            
 DosFreeSeg(selector);                                                       
 }                                                                           

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