en:docs:fapi:dossubfree

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:docs:fapi:dossubfree [2018/08/30 16:47] – created prokusheven:docs:fapi:dossubfree [2021/12/05 11:05] (current) prokushev
Line 1: Line 1:
 +{{page>en:templates:fapiint}}
 +
 +====== DosSubFree ======
  
 This call frees memory previously allocated by DosSubAlloc.  This call frees memory previously allocated by DosSubAlloc. 
  
-==Syntax== +===== Syntax ===== 
- DosSubFree (SegSelector, BlockOffset, Size)+<code c> 
 +DosSubFree (SegSelector, BlockOffset, Size) 
 +</code>
  
-==Parameters== +===== Parameters ===== 
-;SegSelector (SEL) - input : Data segment selector. + 
-;BlockOffset (USHORT) - input : Memory block offset. The value specified must equal the BlockOffset returned on a previous DosSubAlloc call. +  * SegSelector ([[SEL]]) - input : Data segment selector. 
-;Size (USHORT) - input :  Size, in bytes, of the block to be freed.+  BlockOffset ([[USHORT]]) - input : Memory block offset. The value specified must equal the BlockOffset returned on a previous DosSubAlloc call. 
 +  Size ([[USHORT]]) - input :  Size, in bytes, of the block to be freed. 
 + 
 +===== Return Code ===== 
 + 
 +rc ([[USHORT]]) - return
  
-==Return Code== 
- rc (USHORT) - return 
 Return code descriptions are: Return code descriptions are:
-* 0          NO_ERROR  
-* 312        ERROR_DOSSUB_OVERLAP  
-* 313        ERROR_DOSSUB_BADSIZE 
  
-==Remarks== +  * 0          NO_ERROR  
-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.+  * 312        ERROR_DOSSUB_OVERLAP  
 +  * 313        ERROR_DOSSUB_BADSIZE
  
-The allocated segment is freed by calling DosFreeSeg. +===== Remarks =====
  
-==Example Code== +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. 
-===C Binding=== + 
-<PRE>+The allocated segment is freed by calling [[DosFreeSeg]].  
 + 
 +===== Example Code ===== 
 + 
 +==== C Binding ===
 + 
 +<code c>
 #define INCL_DOSMEMMGR #define INCL_DOSMEMMGR
  
Line 34: Line 46:
  
 USHORT           rc;            /* return code */ USHORT           rc;            /* return code */
-</PRE>+</code>
  
-===MASM Binding=== +==== MASM Binding ===
-<PRE>+ 
 +<code asm>
 EXTRN  DosSubFree:FAR EXTRN  DosSubFree:FAR
 INCL_DOSMEMMGR      EQU 1 INCL_DOSMEMMGR      EQU 1
Line 45: Line 58:
 PUSH   WORD    Size          ;Size of block in bytes PUSH   WORD    Size          ;Size of block in bytes
 CALL   DosSubFree CALL   DosSubFree
 +</code>
 Returns WORD Returns WORD
-</PRE> 
- 
  
-====== Note ======+===== Note =====
  
 Text based on [[http://www.edm2.com/index.php/DosSubFree]] Text based on [[http://www.edm2.com/index.php/DosSubFree]]