Examples
The following example retrieves the entry point address for the virtual device identified by My_Device_ID:
xor di, di ; set es:di to zero for version 2.x
mov es, di
mov bx, My_Device_ID
mov ax, 1684h
int 2Fh
mov ax, es
or ax, di
jz API_Is_Not_Supported
The following Windows 95 example retrieves the entry point address for the virtual device identified by specifying an 8-character space padded device name:
xor bx, bx ; bx = 0 indicates name-based
les di, lpName ; Name of device being queried
int 2Fh
mov word ptr [DevAddr], di
mov word ptr [DevAddr+2], es ; ES:DI contains entry point addr
or di, word ptr [DevAddr+2] ; or contains 0:0 on error
jz Error
Interrupt 2Fh Function 1685h
mov bx, [VM_Id] ; virtual-machine identifier
mov cx, [Flags] ; switch conditions
mov dx, word ptr [Priority+2]
mov si, word ptr [Priority] ; dx:si contains 32-bit priority boost
mov es, seg [CallBack]
mov di, offset [CallBack] ; es:di contains callback function address
mov ax, 1685h ; Switch VMs and CallBack
int 2Fh ; multiplex interrupt
Switch VMs and CallBack (Interrupt 2Fh Function 1685h) directs Windows to switch to a specific virtual machine and begin execution. After Windows switches, it calls the specified callback function allowing a device driver or TSR to access the data associated with the specified virtual machine. This function is typically used by MS-DOS device drivers and TSRs that support networks, and that need to perform functions in a specific virtual machine.
VM_Id
Identifies the virtual machine to switch to.
Flags
Specifies when to switch. This parameter is a combination of the following bit values.
Share with your friends: |