Function 4409h Is Drive Remote

mov bl, Drive ;0 = default, 1 = A, 2 = B, etc.

mov ax, 4409h ;Is Drive Remote

int 21h

jc error_handler ;carry set means error

test dx, 1000h ;bit 12 set means drive is remote

jnz remote_device

Is Drive Remote (Function 4409h) determines whether the specified drive is local (attached to the computer running the program) or remote (on a network server).

Parameter

Drive

Specifies the drive to check (0 = default drive, 1 = A, 2 = B, etc.).

Return Value

If the function is successful, the carry flag is clear and the DX register contains the device-attribute value. Otherwise, the carry flag is set and the AX register contains an error value, which may be one of the following:

Value Name

0001h ERROR_INVALID_FUNCTION
000Fh ERROR_INVALID_DRIVE

Comments

Bit 12 in the DX register specifies whether the drive is local or remote. If bit 12 is 1, the drive is remote and the other bits in the DX register are zero.

If bit 12 is zero, the drive is not a network drive, and the bits in the DX register have the following meaning:

Bit Description

1 1 = Drive uses 32-bit sector addressing.
6 1 = Drive accepts Generic IOCTL for Block Devices, Get Logical Drive Map, and Set Logical Drive Map (Functions 440Dh, 440Eh, and 440Fh).
7 1 = Drive accepts Query IOCTL Device (Function 4411h).
9 1 = Drive is local but shared by other computers in the network.
11 1 = Drive accepts Does Device Use Removable Media (Function 4408h).
13 1 = Drive requires media descriptor in FAT.
14 1 = Drive accepts Receive Control Data from Block Device and Send Control Data to Block Device (Functions 4404h and 4405h).
15 1 = Substitution drive (for example, set by the subst command).

All other bits are zero.