Interrupt 2Fh Function 4B05h Identify Instance Data

mov bx, 0

mov es, bx ;es:bx is zero

mov dx, WORD PTR [Service]

mov cx, WORD PTR [Service+2] ;cx:dx is addr of serv-function handler

mov ax, 4B05h ;Identify Instance Data

int 2Fh ;Multiplex Interrupt

mov cx, es

or cx, bx

je no_instancedata ;es:bx is zero if no instance data chain

Identify Instance Data (Interrupt 2Fh Function 4B05h) identifies instance data maintained by a client program. A task switcher calls this function to create a linked list of instance data blocks for all client programs running on the system. Client programs with instance data must intercept Interrupt 2Fh and process Identify Instance Data when they receive the function call.

Parameter

Service

Points to the service-function handler for the task switcher. A client program can use this address to call the task switcher's service functions, such as Test Memory Region (Service Function 0001h).

Return Value

If any client programs have instance data, the ES:BX registers contain the address of an SWSTARTUPINFO structure. Otherwise, the ES:BX registers contain zero.

Comments

A client program's Interrupt 2Fh handler processes this function. If the client program does not have instance data, its handler must use the jmp instruction to transfer control to the previous Interrupt 2Fh handler (whose address the client program must save when it installs its own handler). If a client has instance data, its Interrupt 2Fh handler must first pass Identify Instance Data to any other client programs by pushing the flags and using the call instruction to call the previous handler. The handler must not modify registers before calling the previous handler.

When the previous handler returns, the ES:BX registers contain either zero or the address of an SWSTARTUPINFO structure for another client program. In either case, before the client program can return from the interrupt, it must fill its own SWSTARTUPINFO structure, copy the ES:BX contents to the sisNextDev field of its own structure, and copy the address of its SWSTARTUPINFO structure into the ES:BX registers.

The SWSTARTUPINFO structure has the following form:

SWSTARTUPINFO STRUC

sisVersion dw 3 ;ignored

sisNextDev dd ? ;points to prev handler's SWSTARTUPINFO

sisVirtDevFile dd 0 ;ignored

sisReferenceData dd ? ;ignored

sisInstanceData dd ? ;points to SWINSTANCEITEM structures

SWSTARTUPINFO ENDS

For a full description of the SWSTARTUPINFO and SWINSTANCEITEM structures, see Section 7.11, “Structures.”

A client program processing Identify Instance Data can enable interrupts and call any MS-DOS system function. Although the client program modifies the AX, ES, and BX registers, it must preserve all other registers.

See Also

Service Function 0001h Test Memory Region