◄Up► ◄Next► ◄Previous► ──────────────────────────────────────────────────────────────────────────── include vmm.inc VMMcall _AddInstanceItem, <<OFFSET32 InstStruc>, flags> or eax, eax ; nonzero if added, zero if error jz not_added The _AddInstanceItem service identifies a region of instance data in the V86 address space. Parameter Description ──────────────────────────────────────────────────────────────────────────── InstStruc Points to an InstDataStruc structure containing information about the block of memory to instance. flags Specifies the operation flags. This parameter must be set to 0. Return Value The EAX register contains a nonzero value if the service is successful. Otherwise EAX contains zero to indicate an error. Comments 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 staticly 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 since 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. Uses EAX See Also InstDataStruc ♦