Author: aandrejevic
Date: Fri Mar 27 01:26:45 2015
New Revision: 66910
URL:
http://svn.reactos.org/svn/reactos?rev=66910&view=rev
Log:
[NTVDM]
Fix the implementation of the "Get Device Information" IOCTL.
Remove the broken implementation of the "Set Device Information" IOCTL.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Fri Mar 27
01:26:45 2015
@@ -1207,37 +1207,46 @@
BOOLEAN DosHandleIoctl(BYTE ControlCode, WORD FileHandle)
{
PDOS_SFT_ENTRY SftEntry = DosGetSftEntry(FileHandle);
- PDOS_DEVICE_NODE Node;
-
- /* Make sure it exists and is a device */
- if (!SftEntry || SftEntry->Type != DOS_SFT_ENTRY_DEVICE)
+ PDOS_DEVICE_NODE Node = NULL;
+
+ /* Make sure it exists */
+ if (!SftEntry)
{
DosLastError = ERROR_FILE_NOT_FOUND;
return FALSE;
}
- Node = SftEntry->DeviceNode;
+ if (SftEntry->Type == DOS_SFT_ENTRY_DEVICE) Node = SftEntry->DeviceNode;
switch (ControlCode)
{
/* Get Device Information */
case 0x00:
{
+ WORD InfoWord = 0;
+
/*
* See Ralf Brown:
http://www.ctyme.com/intr/rb-2820.htm
* for a list of possible flags.
*/
- /* Return the device information word */
- setDX(Node->DeviceAttributes);
+ if (Node)
+ {
+ /* Return the device attributes with bit 7 set */
+ InfoWord = Node->DeviceAttributes | (1 << 7);
+ }
+
+ setDX(InfoWord);
return TRUE;
}
/* Set Device Information */
case 0x01:
{
- Node->DeviceAttributes = getDX();
- return TRUE;
+ // TODO: NOT IMPLEMENTED
+ UNIMPLEMENTED;
+
+ return FALSE;
}
/* Read From Device I/O Control Channel */
@@ -1245,7 +1254,7 @@
{
WORD Length = getCX();
- if (!(Node->DeviceAttributes & DOS_DEVATTR_IOCTL))
+ if (Node == NULL || !(Node->DeviceAttributes & DOS_DEVATTR_IOCTL))
{
DosLastError = ERROR_INVALID_FUNCTION;
return FALSE;
@@ -1269,7 +1278,7 @@
{
WORD Length = getCX();
- if (!(Node->DeviceAttributes & DOS_DEVATTR_IOCTL))
+ if (Node == NULL || !(Node->DeviceAttributes & DOS_DEVATTR_IOCTL))
{
DosLastError = ERROR_INVALID_FUNCTION;
return FALSE;