Allocate_V86_Call_Back


include vmm.inc

mov     edx, RefData            ; reference data (any doubleword)
mov     esi, OFFSET32 Callback  ; callback function to call
VMMcall Allocate_V86_Call_Back

jc      error
mov     [CallbackAddr], eax     ; segment:offset for callback

Registers a callback function that V86 mode applications can call. Virtual devices use this service to provide an interface that is available to software in a VM. Uses EAX, Flags.

RefData

Reference data to be passed to the callback procedure. Can be any 32-bit value, but is typically the address of a driver-defined structure.

Callback

Address of the callback procedure. For more information about the callback procedure, see below.

The system calls the callback procedure as follows:


mov     ebx, VM             ; current VM handle
mov     edi, hCurThread     ; current thread handle
mov     edx, RefData        ; 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 is the value supplied when the callback procedure was installed, and crs points to a Client_Reg_Struc structure containing the register values for the virtual machine.

See also Allocate_PM_Call_Back