From 74970d953b3ce42e9e919396782cc4204e554f8a Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Tue, 13 Apr 2004 20:37:30 +0000 Subject: [PATCH] Correct int21/ax=4401: returned AL = old value, should set CY and DE_INVLDDATA if DH!=0 (RBIL is a little confusing here). git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@878 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/ioctl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/kernel/ioctl.c b/kernel/ioctl.c index 022062a..01c6dac 100644 --- a/kernel/ioctl.c +++ b/kernel/ioctl.c @@ -106,10 +106,17 @@ COUNT DosDevIOctl(lregs * r) /* can't set the status of a file. */ if (!(flags & SFT_FDEVICE)) return DE_INVLDFUNC; + /* RBIL says this is only for DOS < 6, but MSDOS 7.10 */ + /* returns this as well... and some buggy program relies*/ + /* on it :( */ + if (r->DH != 0) + return DE_INVLDDATA; + /* Undocumented: AL should get the old value */ + r->AL = s->sft_flags_lo; /* Set it to what we got in the DL register from the */ /* user. */ - r->AL = s->sft_flags_lo = SFT_FDEVICE | r->DL; + s->sft_flags_lo = SFT_FDEVICE | r->DL; break; case 0x02: