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

 Syntax:
 USHORT BLXAPI DosReallocHuge(USHORT segcount,USHORT lastsize,SEL selector);

 Parameters:
 segcount  New count of full 64 Kb segments to allocate.
 lastsize  Size of last segment in bytes.
 selector  Selector originally returned by DosAllocHuge() when the
           memory block was initially allocated.

 Returns:
 None.

 Description:
 DosReallocHuge() changes the size of a memory block originally allocated
 with DosAllocHuge().

 Huge blocks can never be resized to a size larger than (segmax+1) 64 Kb
 blocks as specified in the original call to DosAllocHuge().

 Example:
 #include <stdlib.h>                                                         
 #include <stdio.h>                                                          
 #include <string.h>                                                         
 #include <blx286.h>                                                         
                                                                             
 void main (void)                                                            
 {                                                                           
 SEL selector;                                                               
                                                                             
 /* Allocate a 1MB block (16*64Kb) */                                        
 /* allowing for expansion to 2MB (32*64Kb) */                               
 if (DosAllocHuge(16,0,&selector,32,0) != 0)                                 
    {                                                                        
    printf("DosAllocHuge() failed\n");                                       
    exit(255);                                                               
    }                                                                        
 /* Attempt to reallocate block to 1.5MB (24*64Kb) */                        
 if (DosReallocHuge(24,0,selector) != 0)                                     
    {                                                                        
    printf("DosReallocHuge() failed\n");                                     
    exit(254);                                                               
    }                                                                        
 printf("Block successfully expanded to 1.5MB\n");                           
 DosFreeSeg(selector);                                                       
 }                                                                           

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