Hook_Device_V86_API

include vmm.inc

mov eax, ID ; device ID

mov esi, OFFSET32 Callback ; points to new API callback

VMMcall Hook_Device_V86_API


The Hook_Device_V86_API service installs an API callback procedure allowing a virtual device to intercept calls to the V86 mode API of another virtual device. This service is intended to support virtual devices that need to monitor calls to the APIs of other virtual devices.

Most virtual devices will never need this service.

Parameters

ID

Specifies the identifier for the virtual device to monitor.

Callback

Points to the callback procedure to install. For more information about the callback procedure, see the following “Comments” section.

Return Value

The carry flag is clear and the ESI register contains the address of the previous callback procedure if the service is successful. Otherwise, the carry flag is set to indicate the specified virtual device does not support an API.

Comments

The system calls the callback procedure whenever an application in a virtual machine calls the API for the specified virtual machine. The system calls the callback as follows:

mov ebx, VM ; current VM handle

mov ebp, OFFSET32 crs ; points to Client_Reg_Struc

call [Callback]

The VM parameter is a handle identifying the current virtual machine and the crs parameter points to a Client_Reg_Struc structure containing the register values of the current virtual machine. Other registers contain the parameter values intended for the API.

The callback procedure can carry out tasks but eventually must pass execution to the previous API callback procedure, preserving the EBX and EBP registers when it calls.

Uses

ESI, Flags

See Also

Hook_Device_PM_API