Author: aandrejevic Date: Sun May 3 02:11:32 2015 New Revision: 67527
URL: http://svn.reactos.org/svn/reactos?rev=67527&view=rev Log: [NTVDM] - Fix a typo. - Use a #define for the device flag. - In r67526, the following change was committed but not described in the commit message: - Enable opening devices in DosCreateFile and DosCreateFileEx.
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.h trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.c trunk/reactos/subsystems/mvdm/ntvdm/emulator.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/d... ============================================================================== --- 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] Sun May 3 02:11:32 2015 @@ -62,7 +62,7 @@ for (i = 0; i < Sft->NumDescriptors; i++) { if ((Sft->FileDescriptors[i].RefCount > 0) - && !(Sft->FileDescriptors[i].DeviceInfo & (1 << 7)) + && !(Sft->FileDescriptors[i].DeviceInfo & FILE_INFO_DEVICE) && (Sft->FileDescriptors[i].Win32Handle == Win32Handle)) { return Count; @@ -92,7 +92,7 @@ for (i = 0; i < Sft->NumDescriptors; i++) { if ((Sft->FileDescriptors[i].RefCount > 0) - && (Sft->FileDescriptors[i].DeviceInfo & (1 << 7)) + && (Sft->FileDescriptors[i].DeviceInfo & FILE_INFO_DEVICE) && (Sft->FileDescriptors[i].DevicePointer == DevicePointer)) { return Count; @@ -369,7 +369,7 @@ if (Node != NULL) { Descriptor->DevicePointer = Node->Driver; - Descriptor->DeviceInfo = Node->DeviceAttributes | (1 << 7); + Descriptor->DeviceInfo = Node->DeviceAttributes | FILE_INFO_DEVICE; } else { @@ -445,7 +445,7 @@ if (Node != NULL) { Descriptor->DevicePointer = Node->Driver; - Descriptor->DeviceInfo = Node->DeviceAttributes | (1 << 7); + Descriptor->DeviceInfo = Node->DeviceAttributes | FILE_INFO_DEVICE; } else { @@ -593,7 +593,7 @@ if (Node != NULL) { Descriptor->DevicePointer = Node->Driver; - Descriptor->DeviceInfo = Node->DeviceAttributes | (1 << 7); + Descriptor->DeviceInfo = Node->DeviceAttributes | FILE_INFO_DEVICE; } else { @@ -634,7 +634,7 @@ return ERROR_INVALID_HANDLE; }
- if (Descriptor->DeviceInfo & (1 << 7)) + if (Descriptor->DeviceInfo & FILE_INFO_DEVICE) { PDOS_DEVICE_NODE Node = DosGetDriverNode(Descriptor->DevicePointer); if (!Node->ReadRoutine) return ERROR_INVALID_FUNCTION; @@ -689,7 +689,7 @@ return ERROR_INVALID_HANDLE; }
- if (Descriptor->DeviceInfo & (1 << 7)) + if (Descriptor->DeviceInfo & FILE_INFO_DEVICE) { PDOS_DEVICE_NODE Node = DosGetDriverNode(Descriptor->DevicePointer); if (!Node->WriteRoutine) return ERROR_INVALID_FUNCTION; @@ -749,7 +749,7 @@ return ERROR_INVALID_HANDLE; }
- if (Descriptor->DeviceInfo & (1 << 7)) + if (Descriptor->DeviceInfo & FILE_INFO_DEVICE) { /* For character devices, always return success */ return ERROR_SUCCESS; @@ -797,7 +797,7 @@ return FALSE; }
- if (Descriptor->DeviceInfo & (1 << 7)) + if (Descriptor->DeviceInfo & FILE_INFO_DEVICE) { PDOS_DEVICE_NODE Node = DosGetDriverNode(Descriptor->DevicePointer);
@@ -824,7 +824,7 @@ }
/* Always succeed for character devices */ - if (Descriptor->DeviceInfo & (1 << 7)) return TRUE; + if (Descriptor->DeviceInfo & FILE_INFO_DEVICE) return TRUE;
if (!LockFile(Descriptor->Win32Handle, Offset, 0, Size, 0)) { @@ -847,7 +847,7 @@ }
/* Always succeed for character devices */ - if (Descriptor->DeviceInfo & (1 << 7)) return TRUE; + if (Descriptor->DeviceInfo & FILE_INFO_DEVICE) return TRUE;
if (!UnlockFile(Descriptor->Win32Handle, Offset, 0, Size, 0)) { @@ -869,7 +869,7 @@ return FALSE; }
- if (Descriptor->DeviceInfo & (1 << 7)) + if (Descriptor->DeviceInfo & FILE_INFO_DEVICE) { Node = DosGetDriverNode(Descriptor->DevicePointer); }
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/d... ============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.h [iso-8859-1] Sun May 3 02:11:32 2015 @@ -7,6 +7,8 @@ */
/* DEFINES ********************************************************************/ + +#define FILE_INFO_DEVICE (1 << 7)
#pragma pack(push, 1)
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/d... ============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.c [iso-8859-1] Sun May 3 02:11:32 2015 @@ -103,7 +103,7 @@ { PDOS_DEVICE_NODE Node = DosGetDriverNode(SysVars->ActiveCon);
- Descriptor->DeviceInfo = Node->DeviceAttributes | (1 << 7); + Descriptor->DeviceInfo = Node->DeviceAttributes | FILE_INFO_DEVICE; Descriptor->DevicePointer = SysVars->ActiveCon;
/* Call the open routine */
Modified: trunk/reactos/subsystems/mvdm/ntvdm/emulator.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/emula... ============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/emulator.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/emulator.c [iso-8859-1] Sun May 3 02:11:32 2015 @@ -121,7 +121,7 @@ Opcode = (PBYTE)SEG_OFF_TO_PTR(CodeSegment, InstructionPointer);
/* Display a message to the user */ - DisplayMessage(L"Exception: %s occured at %04X:%04X\n" + DisplayMessage(L"Exception: %s occurred at %04X:%04X\n" L"Opcode: %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X", ExceptionName[ExceptionNumber], CodeSegment,