From bb3351bdd060c6272136a48eb542cd79dfee3382 Mon Sep 17 00:00:00 2001 From: Kenneth J Davis Date: Sat, 10 Dec 2005 02:41:43 +0000 Subject: [PATCH] add int 2f subfunc 122B and 122D from Eduardo Casino git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/branches/UNSTABLE@1163 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 3e1905a..369cae8 100644 --- a/kernel/inthndlr.c +++ b/kernel/inthndlr.c @@ -2233,12 +2233,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; /* fall through only to re-use break */ case 0x2e: /* GET or SET error table addresse - ignored called by MS debug with DS != DOSDS, printf @@ -2285,6 +2313,7 @@ error_exit: r.AX = -rc; if (CritErrCode == SUCCESS) CritErrCode = r.AX; /* Maybe set */ +error_carry: r.FLAGS |= FLG_CARRY; }