Article View: comp.os.msdos.programmer
Article #6621Re: Disable CTRL+BREAK from a TP6 program
From: Tom Stephenson
Date: Sun, 22 Nov 1992 00:57
Date: Sun, 22 Nov 1992 00:57
51 lines
2158 bytes
2158 bytes
In article <Nov18.202206.59161@yuma.ACNS.ColoState.EDU>, hallch@CS.ColoState.EDU
(christopher hall) writes:
|>
|> >I am writing a TP6 program which requires the CTRL+BREAK sequence to be
|> >disabled, as it loads in data tables and manipulates them in real time.
|> >If CTRL+BREAK is pressed then the program bombs out and leaves the tables
|> >in a real mess.
|> >
|>
|> I played around with this problem a few years ago. The solution I came
|> up with was to hook the Ctrl-Break interrupt. I don't remember what it
|> was (I think it was around 24h). The only thing my interrupt was to do
|> was return immediately to its caller. I used this when I had to write
|> a simple program for a teacher of mine (he wanted students to have to
|> enter a password without being able to break of out the program).
|>
|> Hope this helps.
|>
|> Chris Hall :-)
I wrote a program that allows me to have a password on my DOS machine. (I have
teenage people at home that think they are hackers). The attached code is the
key element to the puzzle. The function getkeychar returns the characters input
from the keyboard including ^C or ^Z etc.
You can use them in your password if you want. The entire source is available if
you want it. I just wrote the program to emulate UNIX login process.
/* Code fragment from main */
while ((c = getkeychar()) != 0x0d){
str[i] = c;
i++;
}
/*keyboard function to replace getchar() */
getkeychar()
{
int c;
inreg.h.ah = 0x07;
intdos (&inreg, &outreg);
c = outreg.h.al;
return (c);
}
Good Luck...
Tom Stephenson
Technical Details
Message-ID:
<1992Nov22.005737.15056@odin.corp.sgi.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!olivea!sgigate!sgi!fido!zola!sgihub!odin!ymp.esd.sgi.com!tomsReferences:
<1992Nov18.141829.813@bradford.ac.uk> <Nov18.202206.59161@yuma.ACNS.ColoState.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!sgigate!sgi!fido!zola!sgihub!odin!ymp.esd.sgi.com!toms From: toms@ymp.esd.sgi.com (Tom Stephenson) Newsgroups: comp.os.msdos.programmer Subject: Re: Disable CTRL+BREAK from a TP6 program Message-ID: <1992Nov22.005737.15056@odin.corp.sgi.com> Date: 22 Nov 92 00:57:37 GMT References: <1992Nov18.141829.813@bradford.ac.uk> <Nov18.202206.59161@yuma.ACNS.ColoState.EDU> Sender: news@odin.corp.sgi.com (Net News) Organization: Silicon Graphics, Inc. Lines: 51 Nntp-Posting-Host: ymp.esd.sgi.com