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> dosmemavail()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DosMemAvail()
------------------------------------------------------------------------------
 Purpose:
 Get total available extended memory

 Syntax:
 USHORT BLXAPI DosMemAvail(PULONG bytesavail);

 Parameters:
 bytesavail  Pointer to a long integer to receive the number of bytes of
             available extended memory.

 Returns:
 The total available extended memory in bytes.

 Description:
 DosMemAvail() returns the amount of extended memory available which may be
 allocated with DosAllocSeg() and DosAllocHuge().

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

 Example:
 #include <stdio.h>                                                          
 #include <blx286.h>                                                         
                                                                             
 void main (void)                                                            
 {                                                                           
 ULONG       ext_mem_avail;                                                  
                                                                             
 if (DosMemAvail(&ext_mem_avail) != 0)                                       
    {                                                                        
    printf("Unable to determine free extended memory\n");                    
    exit(255);                                                               
    }                                                                        
 printf("Free extended memory is %08X bytes\n",ext_mem_avail);               
 }                                                                           

See Also: DosAllocHuge() DosAllocSeg() DosRealAvail()

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