diff --git a/src/dos/dos_ioctl.cpp b/src/dos/dos_ioctl.cpp index f509242a..4bd7fcd6 100644 --- a/src/dos/dos_ioctl.cpp +++ b/src/dos/dos_ioctl.cpp @@ -16,6 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* $Id: dos_ioctl.cpp,v 1.12 2003-07-27 12:12:05 qbix79 Exp $ */ + #include #include "dosbox.h" #include "callback.h" @@ -43,9 +45,19 @@ bool DOS_IOCTL(void) { case 0x06: /* Get Input Status */ if (Files[handle]->GetInformation() & 0x8000) { //Check for device reg_al=(Files[handle]->GetInformation() & 0x40) ? 0xff : 0; - } else { - LOG(LOG_IOCTL,LOG_NORMAL)("06:Unsupported File handle %d",handle); - reg_al=0xff; + } else { // FILE + Bit32u oldlocation=0; + Files[handle]->Seek(&oldlocation, DOS_SEEK_CUR); + Bit32u endlocation=0; + Files[handle]->Seek(&endlocation, DOS_SEEK_END); + if(oldlocation < endlocation){//Still data available + reg_al=0x0; + } else + { + reg_al=0xff; //EOF or beyond + } + Files[handle]->Seek(&oldlocation, DOS_SEEK_SET); //restore filelocation + LOG(LOG_IOCTL,LOG_NORMAL)("06:Used Get Input Status on regualar file with handle %d",handle); } return true; case 0x07: /* Get Output Status */