From c6fafbbb2d4318d292d0119b560cdefa2c00822f Mon Sep 17 00:00:00 2001 From: Kenneth J Davis Date: Thu, 22 Jul 2021 22:31:45 -0400 Subject: [PATCH] int 21h/4400h only return low byte of SFT flags if not a device, part of dosemu2/fdpp bug #147 fix - https://github.com/dosemu2/fdpp/commit/b2b55fc1af2b7e65cf98c2c393565cc2f8418ee0 --- kernel/ioctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/ioctl.c b/kernel/ioctl.c index 9ea4d7a..c17ff0b 100644 --- a/kernel/ioctl.c +++ b/kernel/ioctl.c @@ -114,10 +114,10 @@ int DosDevIOctl(lregs * r) { case 0x00: /* Get the flags from the SFT */ + r->AX = flags & 0xff; if (flags & SFT_FDEVICE) - r->AX = (flags & 0xff) | (s->sft_dev->dh_attr & 0xff00); - else - r->AX = flags; + r->AX |= (s->sft_dev->dh_attr & 0xff00); + /* else: files/networks return 0 in AH/DH */ /* Undocumented result, Ax = Dx seen using Pcwatch */ r->DX = r->AX; return SUCCESS;