Virtual Devices (3.1) (vdag31qh.hlp) (Table of Contents; Topic list)
Allocate_PM_Call_Back
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
include vmm.inc
 
mov     edx, OFFSET32 RefData   ; reference data (any doubleword)
mov     esi, OFFSET32 Callback  ; callback procedure to call
VMMcall Allocate_PM_Call_Back
 
jc      error
mov     [CallbackAddr], eax     ; selector:offset for callback
 
The Allocate_PM_Call_Back service installs a callback procedure that
protected-mode applications can call to execute code in a virtual device.
The service returns a callback address, specified as selector:offset pair.
When protected-mode applications call this address, the system passes
control to the callback procedure specified by the Callback parameter.
 
Virtual devices typically use this service to allow software running in a
virtual machine to call APIs provided by the virtual device.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
RefData    Points to reference data to be passed to the callback procedure.
 
Callback   Points to the callback procedure to install. See the Comments
           section for more information about the procedure.
 
Return Value
 
If the carry flag is clear, the EAX register contains the address of the
callback procedure. Otherwise, the carry flag is set to indicate that the
callback procedure could not be installed.
 
Comments
 
The system calls the callback procedure as follows:
 
mov     ebx, VM                 ; current VM handle
mov     edx, OFFSET32 RefData   ; points to 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 points to the reference data supplied when the callback
procedure was installed, and crs points to a Client_Reg_Struc structure
containing the register values for the virtual machine.
 
Uses
 
EAX, Flags
 
See Also
 
Allocate_V86_Call_Back