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_Device_Service
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
include vmm.inc
 
mov     eax, Service            ; specifies the service to hook
mov     esi, OFFSET32 HookProc  ; points to the hook procedure to install
VMMcall Hook_Device_Service
 
jc      not_installed           ; carry set if error
mov     [Real_Proc], esi
 
The Hook_Device_Service service allows one virtual device to monitor or
replace the services of another virtual device or of the VMM itself.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
Service    Specifies the virtual device or VMM service to hook.
 
HookProc   Points to the hook procedure to install. The hook procedure is
           called with the same parameters as the service specified by the
           Service parameter.
 
Return Value
 
The carry flag is clear and the ESI register contains the address of the
service specifed by the Service parameter if this service is successful.
Otherwise, the carry flag is set to indicate an error.
 
Comments
 
Virtual devices that use this service must use extreme care to preserve the
full functionality of the virtual device whose services are monitored or
replaced.
 
More than one virtual device can hook a device service. The last hook
installed is the first one called.
 
The hook procedure must save and restore registers that are not modified by
the hooked service. Also, if flags are a passed as an entry or exit
parameter, the hook procedure must also preserve the flags.
 
If the hooked service uses the C calling convention, the hook procedure must
copy the entire parameter stack frame before attempting to call the hooked
service.
 
Uses
 
ESI, Flags
 
                                      ♦