[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DosReallocHuge()              Resize extended memory block of up to 16 MB.
------------------------------------------------------------------------------

 Function : Resize an extended memory block of up to 16 MB.

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

 segcount   New count of full 64kb segments to allocate.

 lastsize   Size of last segment in bytes.

 selector   Selector originally returned by DosAllocHuge() when the memory
            block was initially allocated.

 Return   : None

 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);
    }

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson