Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!aplcen!news From: tcs@mailer.jhuapl.edu (Carl Schelin) Newsgroups: comp.os.msdos.programmer Subject: Abort, Retry, Fail (Summary) Message-ID: <1991Apr19.131352.255@aplcen.apl.jhu.edu> Date: 19 Apr 91 13:13:52 GMT Sender: news@aplcen.apl.jhu.edu (USENET News System) Organization: Johns Hopkins University - Applied Physics Lab Lines: 50 A few days ago I asked for assistance in solving a problem I was having. The response was overwhelming. I want to thank everyone who sent me e-mail and especially the answer that solved the last question. Most everyone pointed to setvect() to take over the critical error handler (int 24) which worked with mixed results. While it would work fine on A: upon bypassing it, it would choke on B: and loop until booted. If it encountered an unlinked network drive, it would drop to Dos after invoking the handler. Since Borland C++'s Programmer's Guide (page 281) said "A function of type interrupt will automatically save (in addition to SI, DI, and BP) the registers AX through DX, ES, and DS. These same registers are restored on exit from the interrupt handler.", I was under the mistaken impression that I could do nothing to the registers since the values saved would be restored after the handler returned. I was wrong as Frank Whaley's code segment pointed out: void interrupt criterr(bp, di, si, ds, es, dx, cx, bx, ax) unsigned bp, di, si, ds, es, dx, cx, bx, ax; { /* return 'fail' */ ax = (ax & 0xFF00) + 3; } Once I added "ax = ..." to the handler, everything returned and I was able to continue. As a final bit of information, here are the values returned by dx when you generate int 21 with AX = 0x4409: VDISK = 0x0800 BERNOULLI = 0x0802 LOCAL = 0x0840 LOCAL = 0x0842 /* for Compaq Dos v4.01 */ NETWORK = 0x1756 EXTERN = 0x4840 /* external 3.5" for example */ SUBST = 0x8840 Joined and Assigned drives take the characteristics of the original drive in this case. I've sent this information to Ralf Brown (INTER291 interrupt list). It may be a correction to his list. Once again, thanks everyone and especially Frank Whaley (few@gupta.com). Carl Schelin tcs@mailer.jhuapl.edu