waters@viking.DEC (Lester Waters) (05/27/85)
The console device can be changed under MS-DOS (versions 2.0 and later) by altering the following file handles: 0000h - Standard Input Device 0001h - Standard Output Device 0002h - Standard Error Device The following steps can be used to change the console device: 1) Open the 'new' console device (such as AUX) using the DOS function 3Dh (INT 21h). Svae the file handle returned by this call. Be sure that this device has console capability (i.e., is not a block device and supports both input and output -- see the IOCTL - "get device information" DOS function AX=4400h, INT 21h). 2) Using DOS function 3Eh of INT 21h, close file handles 0000h, 0001h, and 0002h. 3) Using DOS function 45h of INT 21h, duplicate the file handle returned by step 1. Do this call three times. The AX register should return the vales 0000h, 0001h, and 0002h, respectively. These handles now point to your 'new' standard input, output, and error devices. 4) Using DOS function 3Eh of INT 21h, close the fule handle returned by step 1. Note that file handles 0000h, 0001h, and 0002h will still remain open and point to the new console device. When you want to change back to the console device, repeat the above steps, but use 'CON' instead of 'AUX' in step 1 for the file name. Be aware that the AUX device requires modem signals: DTR/DSR and RTS/CTS. If your AUX device does not support modem signals, then you will need to have a cable which connects the above signal pairs DTR to DSR and CTS to RTS. See the IBM Tech Ref for further information on modem signals. Lester Waters Waters%Viking.DEC@DECWRL.ARPA ...!decvax!decwrl!dec-rhea!dec-viking!waters