en:docs:fapi:dossubfree

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:docs:fapi:dossubfree [2020/12/04 13:01] prokusheven:docs:fapi:dossubfree [2021/12/05 11:05] (current) prokushev
Line 1: Line 1:
-{{logos:os2.gif?35x35}} {{logos:dos.gif?35x35}}+{{page>en:templates:fapiint}}
  
 ====== DosSubFree ====== ====== DosSubFree ======
Line 5: Line 5:
 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 37: 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 48: 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]]