dos12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DosSubFree (1.2)
Function Group  Overview  Changes               Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSMEMMGR
 
USHORT DosSubFree(sel, offBlock, cbBlock)
SEL sel;            /* segment selector                 */
USHORT offBlock;    /* block offset                     */
USHORT cbBlock;     /* number of bytes in block to free */
 
The DosSubFree function frees memory that was allocated previously by using
the DosSubAlloc function.
 
The DosSubFree function is a family API function.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
sel        Specifies the selector of the data segment from which the memory
           should be freed.
 
offBlock   Specifies the offset of the memory block to be freed. This offset
           must have been created previously by using the DosSubAlloc
           function.
 
cbBlock    Specifies the size (in bytes) of the block to free. This
           parameter should be a multiple of 4. If it is not, it will be
           rounded up.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
 
     ERROR_DOSSUB_BADSIZE
     ERROR_DOSSUB_OVERLAP
 
Comments
 
DosSubFree can be issued from ring 2 or ring 3; and the suballocation
segment can be either a ring-2 or a ring-3 segment.
 
See Also
 
DosAllocSeg, DosSubAlloc, DosSubSet