Jump to content

VDHAllocBlock

From EDM2
Revision as of 04:30, 30 August 2017 by Martini (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.

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. VDHGetErrorshould 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

#include mvdm.h

HBLOCK    SourceBlockPool;  /*  Handle to a memory block pool */
PVOID     rc;

rc = VDHAllocBlock(SourceBlockPool);

Related Functions