Int 21H [3.1] Function 5FH (95) Subfunction 02H Get redirection list entry

Allows inspection of the system redirection list, which associates local logical names with network files, directories, or printers. This function call is only available when Microsoft Networks is running and the file-sharing module (SHARE.EXE) has been loaded.

Call with:

AH = 5FH

AL = 02H

BX = redirection list index

DS:SI = segment:offset of 16-byte buffer to receive local device

name

ES:DI = segment:offset of 128-byte buffer to receive network name

Returns:

If function successful

Carry flag = clear

BH = device status flag

bit 0 = 0 if device valid

= 1 if not valid

BL = device type

03H if printer

04H if drive

CX = stored parameter value

DX = destroyed

BP = destroyed

DS:SI = segment:offset of ASCIIZ local device name

ES:DI = segment:offset of ASCIIZ network name

If function unsuccessful

Carry flag = set

AX = error code

Note:

The parameter returned in CX is a value that was previously passed to MS-DOS in register CX with Int 21H Function 5FH Subfunction 03H (Redirect Device). It represents data that is private to the applications which store and retrieve it and has no meaning to MS-DOS.

Example:

Get the local and network names for the device specified by the first redirection list entry.

local db 16 dup (?) ; receives local device name

network db 128 dup (?) ; receives network name

.

.

.

mov ax,5f02h ; function & subfunction

mov bx,0 ; redirection list entry 0

mov si,seg local ; local name buffer addr

mov ds,si

mov si,offset local

mov di,seg network ; network name buffer addr

mov es,di

mov di,offset network

int 21h ; transfer to MS-DOS

jc error ; jump if call failed

or bh,bh ; check device status

jnz error ; jump if device not valid

.

.

.