include vmm.inc mov edx, OFFSET32 RefData ; reference data (any doubleword) mov esi, OFFSET32 Callback ; callback procedure to call VMMcall Allocate_V86_Call_Back jc error mov [CallbackAddr], eax ; segment:offset for callback |
The Allocate_V86_Call_Back service installs a callback procedure that V86 mode applications can call to execute code in a virtual device. The service returns a callback address, specified as segment:offset pair. When V86 mode applications call this address, the system passes control to the callback procedure specified by the Callback parameter.
Virtual devices typically use this service to allow software running in a virtual machine to call APIs provided by the virtual device.
RefData
Points to reference data to be passed to the callback procedure.
Callback
Points to the callback procedure to install. For more information about the callback procedure, see the following “Comments” section.
If the carry flag is clear, the EAX register contains the address of the callback procedure. Otherwise, the carry flag is set to indicate that the callback procedure could not be installed.
The system calls the callback procedure as follows:
mov ebx, VM ; current VM handle
mov edx, OFFSET32 RefData ; points to reference data
mov ebp, OFFSET32 crs ; points to Client_Reg_Struc
call [Callback]
The VM parameter is a handle identifying the current virtual machine. The RefData parameter points to the reference data supplied when the callback procedure was installed, and crs points to a Client_Reg_Struc structure containing the register values for the virtual machine.
EAX, Flags