_AddInstanceItem

include vmm.inc

VMMCall _AddInstanceItem, <<OFFSET32 InstStruc>, flags>

or      eax, eax        ; nonzero if added, zero if error
jz      not_added
 

Identifies a region of instance data in the V86 address space. Uses EAX, ECX, EDX, and Flags.

InstStruc
Address of an InstDataStruc structure containing information about the block of memory to instance.
flags
Operation flags. Must be zero.

To prevent errors, a virtual device must not change the location and content of any InstDataStruc structures until after the system has completed its initialization. To achieve this, a virtual can either statically allocate the structures in its INIT data segment or dynamically allocate the structures on the system heap using the _HeapAllocate service. If the structures are in the INIT data segment, the system automatically frees the structure when it reclaims the INIT segment space. If the structures are in the system heap, the virtual device must free the structures using the _HeapFree service while processing the Sys_VM_Init message.

If a virtual device the structures on the system heap, it must not attempt to reallocate the structure before system initialization has completed because this invalidates the structure address.

Only one, contiguous region of instance data can be identified with each structure. The virtual device can cut down the call overhead and data space requirements by coalescing adjacent blocks of instance data and identifying the coalesced blocks as a single instance item.

See Also

InstDataStruc