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_Page
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
include vmm.inc
 
mov     eax, PageNum            ; page number
mov     esi, OFFSET32 Callback  ; points to Address of trap routine
VMMcall Hook_V86_Page
 
The Hook_V86_Page service install a callback procedure to handle faults for
the specified page. Virtual devices, such as the virtual display device, use
this service to detect when particular address ranges are accessed.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
Page       Specifies the number of the V86 page to install the callback
           procedure for. This number must be within the range specified by
           the number of the last V86 page and 0FFh.
 
Callback   Points to the callback procedure to install. See the Comments
           section for more information about this procedure.
 
Return Value
 
The carry flag is clear if the service installs the callback procedure.
Otherwise, the carry flag is set to indicate an error such as an invalid
page number or the page is already hooked.
 
Comments
 
The system calls the callback procedure whenever a page fault occurs for the
specified page regardless of the current virtual machine.
 
The system calls the callback as follows:
 
 
mov     eax, Page     ; faulting page number
mov     ebx, VM       ; current VM handle
call    [Callback]
 
The Page parameter specifies the number of the page that caused the page
fault and VM is the handle of the current virtual machine. The EBP register
does not point to a client register structure.
 
The callback procedure must either map physical memory into page causing the
page fault or terminate the virtual machine. In unusual circumstances, the
virtual device may need to map the system nul page into the faulting page.
 
Virtual devices must not rely on the contents of the CR2 (page fault)
register. Instead, the callback procedure must use the Page parameter to
determine which page caused the fault.
 
Uses
 
Flags
 
                                      ♦