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

 Function : Resize an extended memory block of up to 64kb.

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

 size       New size of segment in bytes (0 = 64 Kb).

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

 Return   : None

 DosReallocSeg() changes the size of a memory block originally allocated with
 DosAllocSeg(). The block may not be reallocated to a size larger than 64kb
 (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("4K 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 8kb\n");
    DosFreeSeg(selector);
    }

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