Virtual Devices (3.1) (vdag31qh.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Hook_V86_Int_Chain
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
include vmm.inc
 
mov     eax, Interrupt          ; number of interrupt to hook
mov     esi, OFFSET32 HookProc  ; points to hook procedure
VMMcall Hook_V86_Int_Chain
 
jc      not_installed       ; carry set if procedure not installed
 
The Hook_V86_Int_Chain service installs a hook procedure that the system
calls whenever the specified interrupt occurs. Virtual devices use this
service to monitor software interrupts and simulated hardware interrupts in
V86 mode.
 
This service is only available during initialization.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
Interrupt  Specifies the number of the interrupt for which to install the
           hook procedure.
 
HookProc   Points to the hook procedure. See the Comments section for more
           information about this procedure.
 
Return Value
 
The carry flag is clear if the hook procedure is installed. The carry flag
is set to indicate an error such as an invalid interrupt number.
 
Comments
 
The system calls the hook procedure whenever the corresponding interrupt
occurs, a virtual device calls the Simulate_Int service, or the system
simulates a hardware interrupt. This means a hook procedure must make no
assumptions about the origin of the interrupt.
 
The system calls the procedure as follows:
 
mov     eax, Interrupt      ; number of interrupt hooked
mov     ebx, VM             ; current VM handle
mov     ebp, OFFSET32 crs   ; points to a Client_Reg_Struc
call    [HookProc]
 
jc      pass_to_next        ; carry set if interrupt not serviced
 
The Interrupt parameter is the number of the current interrupt, VM is a
handle identifying the current virtual machine, and crs points to a
Client_Reg_Struc structure containing the register values of the current
virtual machine. If the hook procedure services the interrupt, it must clear
the carry flag to prevent the system from passing the interrupt to the next
hook procedure.
 
Any number of virtual devices can install a hook procedure for a given
interrupt. The system always calls the last hook procedure first. A hook
procedure either services the interrupt or directs the system to pass the
interrupt to the next hook procedure. If no hook procedure services the
interrupt, the system reflects the interrupt to the virtual machine.
 
This service is recommended instead of hooking the V86 interrupt vector
directly.
 
Uses
 
Flags
 
See Also
 
Set_V86_Int_Vector, Simulate_Int