Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!mcsun!sunic!draken!d88-eli From: d88-eli@nada.kth.se (Erik Liljencrantz) Newsgroups: comp.lang.pascal Subject: Re: disable ^C in Turbo Pascal Message-ID: <2942@draken.nada.kth.se> Date: 14 Feb 90 07:08:14 GMT References: <116500002@uxa.cso.uiuc.edu> Reply-To: d88-eli@nada.kth.se (Erik Liljencrantz) Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 28 In article <116500002@uxa.cso.uiuc.edu> bcs33424@uxa.cso.uiuc.edu writes: > I'm writing a password program in Turbo Pascal for friend's > computer. The program is fine, but I can't disable control-C. > I've tried the break command under DOS, and the {C-}, {C+}, > {$U-}, and the {$U+} (the book I'm using is very vague). With- > out the control-C disabled, the program has no real effect. > Is there something I missed? Is there another compiler directive > I could use? Could the autoexec.bat be written so that, if > the password program is stopped by a ^C that it recalls the > password program, until it is ended normally? It's always possible to break AUTOEXEC.BAT and MS-DOS asks if you want to terminate the batch-file. The only possibility is to do something before the execution of AUTOEXEC.BAT begins, that is in CONFIG.SYS: Write a device- driver! The line DEVICE=device.sys in CONFIG.SYS loads a devicedriver and calls the initialization code in the driver. That code could display a password prompt, and refuse any CTRL-C or incorrect password. However, a devicedriver requires some (understatement...) assembly programming. And another thing: You can't protect the system from floppy boot. Anyone with a bootable floppy can enter the system... I've written a devicedriver (XTRALOCK.SYS). I can mail it to you (and others) if you are interested (it includes assembly source). -- Erik Liljencrantz | "No silly quotes!!" d88-eli@nada.kth.se | Embraquel D. Tuta