DosFreeSeg

DosFreeSeg

#define INCL_DOSMEMMGR

USHORT  rc = DosFreeSeg(Selector);

SEL              Selector;      /* Selector */

USHORT           rc;            /* return code */

Example

This example allocates a segment of 30,250 bytes and then discards the segment.

#define INCL_DOSMEMMGR

#define NUMBER_OF_BYTES 30250
#define ALLOC_FLAG SEG_GETTABLE

SEL    Selector;
USHORT rc;

   rc = DosAllocSeg(NUMBER_OF_BYTES,     /* # of bytes requested */
                    &Selector,           /* Selector allocated */
                    ALLOC_FLAG);         /* Allocation flags */
   rc = DosFreeSeg(Selector);            /* Segment selector */


[Back: DosFreeResource]
[Next: DosFSAttach]