Interrupt 2Fh Function 1684h

mov     bx, [DeviceID]  ; Device identifier

mov     ax, 1684h       ; Get Device Entry Point Address
int     2Fh             ; multiplex interrupt

mov     word ptr [DevAddr], di
mov     word ptr [DevAddr+2], es    ; es:di contains entry point address
 

Get Device Entry Point Address (Interrupt 2Fh Function 1684h) retrieves the entry point address for a virtual device's service functions. MS-DOS device drivers or TSRs typically use this function to communicate with virtual devices they have explicitly loaded.

DeviceID
Identifies a virtual device. If this value is zero, then the ES:DI registers point to an 8 character space-padded case-sensitive device name (Windows 95).

The return value is the entry-point address contained in the ES:DI register pair if the function is supported. Otherwise, ES:DI contain zero.

Any virtual device can provide service functions to be used by MS-DOS programs. For example, the virtual-display device provides services that the Windows old application program uses to display MS-DOS programs in a window. It is the responsibility of the MS-DOS program to provide the appropriate virtual-device identifier. The function returns a valid address if the virtual device supports the entry point.

MS-DOS programs call the entry point using a far call instruction. The services provided by the virtual device depend on the device. It is the responsibility of the MS-DOS program to set registers to values that are appropriate to the specific virtual device.

For versions of Windows prior to version 3.0, the program must set the ES:DI register pair to zero before calling this function.

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