VDMAD_Virtualize_Channel

include vdmad.inc

mov eax, Channel
move esi, OFFSET32 CallbackProc
VxDcall VDMAD_Virtualize_Channel
jz ErrorHandler
 

Allows another virtual device to claim ownership of a standard DMA channel. Uses EAX, EDX, flags

Channel
Number of channel.
CallbackProc
Address of the callback procedure. If this parameter is zero, no callback procedure is called.

The system calls the callback procedure by passing it the following input parameters:

EAX     ; DMA handle
EBX     ; virtual machine handle
 

The procedure can modify EAX, EBX, ECX, EDX, ESI, EDI, and flags.

In some cases a virtual device does not allow a virtual machine to perform DMA to a channel. Instead, the virtual device handles programming based on a private API and not on virtualized hardware I/O. This means it is possible to pass a zero to specify no callback procedure. VDMAD continues to trap the I/O for the channel, but never changes the physical state of the channel as a result of any virtual machine I/O.

The new owner registers a callback procedure that is called whenever the virtual state of the channel is changed as a result of I/O carried out in a virtual machine.