Declare_Virtual_Device

include vmm.inc

Declare_Virtual_Device Name, MajorVer, MinorVer, CtrlProc, DeviceNum,
                       InitOrder, V86Proc, PMProc
 

Defines the name, device number, control procedure, and other attributes of a virtual device. Every virtual device must use the Declare_Virtual_Device macro.

Name
Name of the virtual device.
MajorVer
Value specifying the major version number for the virtual device.
MinorVer
Value specifying the minor version number for the virtual device.
CtrlProc
Name of the control procedure for the virtual device. The control procedure handles all system control messages sent to the virtual device. For most virtual devices, this parameter is the name of the procedure created by the Begin_Control_Dispatch macro.
DeviceNum
Device identifier for the virtual device. If the virtual device replaces an existing virtual device, the device identifier must be identical to the device identifier of the virtual device being replaced. Otherwise, the value must be Undefined_Device_ID or a value previously obtained from Microsoft.

Since Windows 95 supports name-based VxD services, it is no longer necessary to obtain a virtual device identifier from Microsoft. Instead, set the DeviceNum to Undefined_Device_ID and use name-based services to access your VxD. (Do not make up device numbers.)

InitOrder
Value specifying the initialization order of the virtual device relative to other virtual devices. If you are replacing an existing virtual device, this value must be the same as that of the device you are replacing. If your device is not sensitive to initialization order, use Undefined_Init_Order. If your device needs to initialize at a particular time relative to another device, make the initialization order relative to the init order of that other device. When doing so, use a generous offset such as XX_Init_Order + 00040000h or XX_Init_Order – 0004000h, so as to allow room for additional devices to be inserted later. Do not use values like XX_Init_Order + 1 or XX_Init_Order – 1. Do not use VMM_Init_Order or Debug_Init_Order.
V86Proc
Name of the V86-mode API procedure. This procedure processes any calls to the virtual device made by V86-mode applications running in a virtual machine. This parameter is optional.
PMProc
Name of the protected-mode API procedure. This procedure processes any calls to the virtual device made by protected-mode applications running in a virtual machine. This parameter is optional.

See Also

Begin_Control_Dispatch