Author: aandrejevic
Date: Fri May 15 22:29:07 2015
New Revision: 67749
URL:
http://svn.reactos.org/svn/reactos?rev=67749&view=rev
Log:
[NTVDM]
Implement those IOCTLs (0x06 and 0x07) for files too, not just devices.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c [iso-8859-1] Fri May 15
22:29:07 2015
@@ -939,21 +939,36 @@
/* Get Input Status */
case 0x06:
{
- if (Node == NULL)
- {
- Sda->LastErrorCode = ERROR_INVALID_FUNCTION;
- return FALSE;
- }
-
- if (Node->InputStatusRoutine &&
Node->InputStatusRoutine(Node))
- {
- /* Set the length to 0xFF to mark that it's ready */
- *Length = 0xFF;
+ /* Check if this is a file or a device */
+ if (Node)
+ {
+ /* Device*/
+
+ if (Node->InputStatusRoutine &&
Node->InputStatusRoutine(Node))
+ {
+ /* Set the length to 0xFF to mark that it's ready */
+ *Length = 0xFF;
+ }
+ else
+ {
+ /* Not ready */
+ *Length = 0;
+ }
}
else
{
- /* Not ready */
- *Length = 0;
+ /* 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;
@@ -962,21 +977,26 @@
/* Get Output Status */
case 0x07:
{
- if (Node == NULL)
- {
- Sda->LastErrorCode = ERROR_INVALID_FUNCTION;
- return FALSE;
- }
-
- if (Node->OutputStatusRoutine &&
Node->OutputStatusRoutine(Node))
- {
- /* Set the length to 0xFF to mark that it's ready */
+ /* Check if this is a file or a device */
+ if (Node)
+ {
+ /* Device*/
+
+ if (Node->OutputStatusRoutine &&
Node->OutputStatusRoutine(Node))
+ {
+ /* Set the length to 0xFF to mark that it's ready */
+ *Length = 0xFF;
+ }
+ else
+ {
+ /* Not ready */
+ *Length = 0;
+ }
+ }
+ else
+ {
+ /* Files are always ready for output */
*Length = 0xFF;
- }
- else
- {
- /* Not ready */
- *Length = 0;
}
return TRUE;