From 8343368565b5880fa9dc079c3a3569ebfc6ed4bc Mon Sep 17 00:00:00 2001 From: Kenneth J Davis Date: Fri, 15 Jul 2011 23:32:38 +0000 Subject: [PATCH] add int 2f subfunc 122B and 122D from Eduardo Casino [from UNSTABLE branch] git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1685 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/inthndlr.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/kernel/inthndlr.c b/kernel/inthndlr.c index d3e44af..a0666ec 100644 --- a/kernel/inthndlr.c +++ b/kernel/inthndlr.c @@ -1961,12 +1961,40 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs r) r.FLAGS &= ~FLG_CARRY; break; + case 0x2b: /* Device I/O Control */ + if (r.BP < 0x4400 || r.BP > 0x44ff) + goto error_invalid; + { + lregs lr; + lr.AX = r.BP; + lr.BX = r.BX; + lr.CX = r.CX; + lr.DX = r.DX; + lr.DI = r.DI; + lr.SI = r.SI; + lr.DS = r.DS; + rc = DosDevIOctl(&lr); /* can set critical error code! */ + } + + if (rc < SUCCESS) + { + r.AX = -rc; + if (rc != DE_DEVICE && rc != DE_ACCESS) + CritErrCode = r.AX; + goto error_carry; + } + break; + case 0x2c: /* added by James Tabor For Zip Drives Return Null Device Pointer */ /* by UDOS+RBIL: get header of SECOND device driver in device chain, omitting the NUL device TE */ r.BX = FP_SEG(nul_dev.dh_next); r.AX = FP_OFF(nul_dev.dh_next); + break; + + case 0x2d: /* Get Extended Error Code */ + r.AX = CritErrCode; break; @@ -2015,6 +2043,7 @@ error_exit: r.AX = -rc; if (CritErrCode == SUCCESS) CritErrCode = r.AX; /* Maybe set */ +error_carry: r.FLAGS |= FLG_CARRY; }