Implement those IOCTLs (0x06 and 0x07) for files too, not just devices.


svn path=/trunk/; revision=67749
This commit is contained in:
Aleksandar Andrejevic 2015-05-15 22:29:07 +00:00
parent 2e894b43c1
commit 6020ed7ad1

View file

@ -939,11 +939,10 @@ BOOLEAN DosDeviceIoControl(WORD FileHandle, BYTE ControlCode, DWORD Buffer, PWOR
/* Get Input Status */ /* Get Input Status */
case 0x06: case 0x06:
{ {
if (Node == NULL) /* Check if this is a file or a device */
if (Node)
{ {
Sda->LastErrorCode = ERROR_INVALID_FUNCTION; /* Device*/
return FALSE;
}
if (Node->InputStatusRoutine && Node->InputStatusRoutine(Node)) if (Node->InputStatusRoutine && Node->InputStatusRoutine(Node))
{ {
@ -955,6 +954,22 @@ BOOLEAN DosDeviceIoControl(WORD FileHandle, BYTE ControlCode, DWORD Buffer, PWOR
/* Not ready */ /* Not ready */
*Length = 0; *Length = 0;
} }
}
else
{
/* File */
if (Descriptor->Position < Descriptor->Size)
{
/* Set the length to 0xFF to mark that it's ready */
*Length = 0xFF;
}
else
{
/* Not ready */
*Length = 0;
}
}
return TRUE; return TRUE;
} }
@ -962,11 +977,10 @@ BOOLEAN DosDeviceIoControl(WORD FileHandle, BYTE ControlCode, DWORD Buffer, PWOR
/* Get Output Status */ /* Get Output Status */
case 0x07: case 0x07:
{ {
if (Node == NULL) /* Check if this is a file or a device */
if (Node)
{ {
Sda->LastErrorCode = ERROR_INVALID_FUNCTION; /* Device*/
return FALSE;
}
if (Node->OutputStatusRoutine && Node->OutputStatusRoutine(Node)) if (Node->OutputStatusRoutine && Node->OutputStatusRoutine(Node))
{ {
@ -978,6 +992,12 @@ BOOLEAN DosDeviceIoControl(WORD FileHandle, BYTE ControlCode, DWORD Buffer, PWOR
/* Not ready */ /* Not ready */
*Length = 0; *Length = 0;
} }
}
else
{
/* Files are always ready for output */
*Length = 0xFF;
}
return TRUE; return TRUE;
} }