Add this page to your book
Remove this page from your book
Table of Contents
This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS
Note: This is legacy API call. It is recommended to use 32-bit equivalent
This call frees memory previously allocated by DosSubAlloc.
DosSubFree (SegSelector, BlockOffset, Size)
rc (USHORT) - return
Return code descriptions are:
- 0 NO_ERROR
- 312 ERROR_DOSSUB_OVERLAP
- 313 ERROR_DOSSUB_BADSIZE
DosSubFree specifies the offset of a block of memory previously suballocated by a DosSubAlloc request. If the block specified overlaps memory in the segment that is not suballocated, an error is returned. Like DosSubAlloc, the size parameter must be a multiple of four bytes; otherwise, it is rounded up to a multiple of four bytes.
The allocated segment is freed by calling DosFreeSeg.
#define INCL_DOSMEMMGR USHORT rc = DosSubFree(SegSelector, BlockOffset, Size); SEL SegSelector; /* Segment selector */ USHORT BlockOffset; /* Offset of memory block to free */ USHORT Size; /* Size of block in bytes */ USHORT rc; /* return code */
EXTRN DosSubFree:FAR INCL_DOSMEMMGR EQU 1 PUSH WORD SegSelector ;Segment selector PUSH WORD BlockOffset ;Offset of memory block to free PUSH WORD Size ;Size of block in bytes CALL DosSubFree
Text based on http://www.edm2.com/index.php/DosSubFree