Function  44h   I/O Control for Devices (IOCTL)  Get or Set Device Information

entry AH 44h

AL 00h Get Device Information (from DX)

BX file or device handle

return DX device info

If bit 7 set: (character device)

bit 0: console input device

1: console output device

2: NUL device

3: CLOCK$ device

4: device is special

5: binary (raw) mode

6: not EOF

12: network device (DOS 3.x)

14: can process IOCTL control

strings (func 2-5)

If bit 7 clear: (file)

bits 0-5: block device number

6: file has not been written

12: Network device (DOS 3.x)

15: file is remote (DOS 3.x)

Function 44h I/O Control for Devices (IOCTL) Get or Set Device Information

entry AH 44h

00h Get Device Information (from DX)

note This function can be used to detect input and output redirection. Since

the handle for STDOUT is always 1, if after calling Int 21 with AX=4400h

and BX=0001h, the character device bit (bit 7) and the console output

device bit (bit 1) are set in DX, anything sent to STDOUT will appear on

the screen. If bit 7 is clear, we know output is being redirected to a

file. If bit 1 is zero, the redirection is to another device.