Jump to content

DosSubUnsetMem: Difference between revisions

From EDM2
Created page with "=== Syntax === rc = DosSubUnsetMem( ''pOffset'' ); === Parameters === PVOID ''pOffset'' (input) This is the offset of the memory pool which we no longer need. === Retur..."
 
Ak120 (talk | contribs)
No edit summary
Line 1: Line 1:
=== Syntax ===
=== Syntax ===
  rc = DosSubUnsetMem( ''pOffset'' );
  rc = DosSubUnsetMem( ''pOffset'' );


=== Parameters ===
=== Parameters ===
Line 10: Line 8:
   
   
=== Returns ===
=== Returns ===
  APIRET rc
APIRET rc
The following values can be returned
 
   
The following values can be returned:
{| border="1"
{|class="wikitable"
|0||NO_ERROR
|-
|-
|0
|532||ERROR_DOSSUB_CORRUPTED
|NO_ERROR
|}
|-
 
|532
|ERROR_DOSSUB_CORRUPTED
|}
=== Include Info ===
=== Include Info ===
  #define INCL_DOSMEMMGR
  #define INCL_DOSMEMMGR
  #include <os2.h>
  #include <os2.h>
  #include &lt;bsememf.h&gt;
  #include <bsememf.h>
 


=== Usage Explanation ===
=== Usage Explanation ===
DosSubUnsetMem is used to terminate a memory pool. It is used to allow the suballocation  
DosSubUnsetMem is used to terminate a memory pool. It is used to allow the suballocation  
function to release resources it used to manage the suballocation of the memory block. All  
function to release resources it used to manage the suballocation of the memory block. All  
calls to [[DosSubSetMem]] should be followed by a call to  
calls to [[DosSubSetMem]] should be followed by a call to DosSubUnsetMem. All calls to DosSubUnsetMem must occur before the memory block is freed.
DosSubUnsetMem. All calls to DosSubUnsetMem must occur before the memory block is freed.
 
 
=== Relevant Structures ===
=== Gotchas ===
   
   
=== Sample Code ===
=== Sample Code ===
Line 47: Line 34:


PVOID Offset;    /* Offset of the memory pool which we will terminate. */
PVOID Offset;    /* Offset of the memory pool which we will terminate. */
APIRET rc;        /* Just to take care of the return code.              */
APIRET rc;        /* Just to take care of the return code.              */


Line 59: Line 45:
   /* We have an error we must take care of. */
   /* We have an error we must take care of. */
}
}
</pre>  
</pre>
 
=== See Also ===
=== See Also ===
[[OS2 API:CPI:DosSubAllocMem|CPI:DosSubAllocMem]],
[[OS2 API:CPI:DosSubAllocMem|CPI:DosSubAllocMem]],
Line 65: Line 52:
[[OS2 API:CPI:DosSubSetMem|CPI:DosSubSetMem]]  
[[OS2 API:CPI:DosSubSetMem|CPI:DosSubSetMem]]  


 
[[Category:The OS/2 API Project]]
[[Category:They OS/2 API Project]]

Revision as of 19:31, 12 September 2016

Syntax

rc = DosSubUnsetMem( pOffset );

Parameters

PVOID pOffset (input)

This is the offset of the memory pool which we no longer need.

Returns

APIRET rc

The following values can be returned:

0 NO_ERROR
532 ERROR_DOSSUB_CORRUPTED

Include Info

#define INCL_DOSMEMMGR
#include <os2.h>
#include <bsememf.h>

Usage Explanation

DosSubUnsetMem is used to terminate a memory pool. It is used to allow the suballocation function to release resources it used to manage the suballocation of the memory block. All calls to DosSubSetMem should be followed by a call to DosSubUnsetMem. All calls to DosSubUnsetMem must occur before the memory block is freed.

Sample Code

#define INCL_DOSMEMMGR
#include 
#include 

PVOID Offset;     /* Offset of the memory pool which we will terminate. */
APIRET rc;        /* Just to take care of the return code.              */

/* Offset should be set to the offset of the memory pool which we are   */
/* about to terminate.                                                  */

rc = DosSubUnsetMem( Offset);

if (rc != 0)
{
   /* We have an error we must take care of. */
}

See Also

CPI:DosSubAllocMem, CPI:DosSubFreeMem, CPI:DosSubSetMem