V86MMGR_Free_Buffer

include v86mmgr.inc

mov     ebp, OFFSET32 ClientRegisters
mov     ebx, VMHandle
mov     ecx, NumBytes
stc                     ; set carry flag to copy, clear otherwise
lfs     esi, FarPtrMem  ; buffer to receive data if carry set
VxDcall V86MMGR_Free_Buffer
 

Frees a buffer that was allocated by the V86MMGR_Allocate_Buffer service, and optionally copies data from the translation buffer. Uses Flags.

ClientRegisters
Address of a Client_Reg_Struc structure containing the register values of the current VM.
VMHandle
Handle of the current virtual machine. The current virtual machine must be in protected mode.
NumBytes
Number of bytes to free (returned from the V86MMGR_Allocate_Buffer service).
FarPtrMem
Selector and offset address (in FS and ESI) of the extended memory buffer to receive the contents of the freed translation buffer if the carry flag is set. This parameter is ignored if the carry flag is clear.

The buffers are maintained as a stack. Therefore, the last buffer allocated must be the first buffer freed.