Jump to content

VDHAllocBlock: Difference between revisions

From EDM2
Created page with "This function allocates a block from the specified memory block pool. This block is allocated from fixed or swappable memory, depending on the value of the ''OptionFlag'' flag..."
 
Ak120 (talk | contribs)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
This function allocates a block from the specified memory block pool. This block is allocated from fixed or swappable memory, depending on the value of the ''OptionFlag'' flag when the block is created with ''VDHCreateBlockPool''.
#REDIRECT[[VDDR/2 - C Language Virtual DevHlp Services#VDHAllocBlock]]
 
==Syntax==
VDHAllocBlock(SourceBlockPool);
 
== Parameters ==
; '''SourceBlockPool''' (HBLOCK) : Handle to the pool of memory blocks from which to allocate a memory block.
 
== Constants ==
None. {list of used constants}
 
== Returns ==
:'''rc''' (PVOID) - returns
::Success: If the function is successful, it returns the address of the allocated memory block.
::Failure: If the function fails, it returns 0. ''VDHGetError''should be called to determine the nature of the problem. Note that passing an invalid memory block handle causes a system halt to occur.
 
== Remarks ==
'''Context Issues:''' This function can be called in the initialization or task context.
 
'''DOS Session Terminations:''' Any blocks allocated by a virtual device driver for use by the terminating DOS session are freed by using ''VDHFreeBlock''. Any block pools created for the DOS session should also be freed.
 
 
== Example Code ==
<PRE>
#include mvdm.h
 
HBLOCK    SourceBlockPool;  /*  Handle to a memory block pool */
PVOID    rc;
 
rc = VDHAllocBlock(SourceBlockPool);
</PRE>
 
== Related Functions ==
 
[[Category:VDD]]

Latest revision as of 19:53, 11 July 2019