Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!husc6!mit-eddie!nathan
From: nathan@eddie.MIT.EDU (Nathan Glasser)
Newsgroups: comp.sys.ibm.pc
Subject: Re: DOS Critical-error handler
Message-ID: <6380@eddie.MIT.EDU>
Date: Sat, 25-Jul-87 05:21:14 EDT
Article-I.D.: eddie.6380
Posted: Sat Jul 25 05:21:14 1987
Date-Received: Sat, 25-Jul-87 21:36:02 EDT
References: <1871@isis.UUCP> <1610020@hpcvlo.HP.COM>
Reply-To: nathan@eddie.MIT.EDU (Nathan Glasser)
Organization: MIT, EE/CS Computer Facilities, Cambridge, MA
Lines: 33

In article <1610020@hpcvlo.HP.COM> everett@hpcvlo.HP.COM (Everett Kaser) writes:
>This is a code fragment that I used in a recent program.  It seems to do the
>job.  The effect is that the Abort, Retry, or Ignore message is suppressed,
>and the application receives a CY flag set upon return from the function call
>to indicate an error occurred during the call.
>
>; actual critical error handling routine.  can be far more complex, but this
>; should suffice to keep the Abort, Retry, or Ignore message from appearing.
>;
>criterr	proc	far
>	mov	al,0			; tell DOS to ignore error, but return
>ctrlc:					; the CY flag set so application
>	iret				; knows an error occurred
>criterr	endp

Returning 0 in al is documented as telling dos to ignore the error,
while returning 3 is documented as aborted the system call in progress.
The documentation also warns returning 0 will cause dos to think
the call was successful, and may cause various problems.

The other day, in fact, I was setting this stuff up by myself, and
I decided to return 3 after doing some testing. It seems that it may
be random whether the carry flag is set when returning 0 (am not sure).
It always seems to return the carry flag if you use 3.

E.g. when using a Lattice C program, a read is apparently successful
(at least sometimes) if I return 0, but never is if I return 3.
The read will end up putting garbage in your buffer in the former case.
-- 
				Nathan Glasser
				nathan@mit-eddie.uucp (usenet)
fnord				nathan@xx.lcs.mit.edu (arpa)
"A tribble is the only love that money can buy."