Author: aandrejevic
Date: Thu Mar 26 23:31:01 2015
New Revision: 66907
URL:
http://svn.reactos.org/svn/reactos?rev=66907&view=rev
Log:
[NTVDM]
On DOS, CONIN$ and CONOUT$ are actually the same thing - a device called CON.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/condrv.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.h
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/condrv.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/condrv.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/condrv.c [iso-8859-1] Thu Mar 26
23:31:01 2015
@@ -20,7 +20,7 @@
/* PRIVATE VARIABLES **********************************************************/
-PDOS_DEVICE_NODE ConIn = NULL, ConOut = NULL;
+PDOS_DEVICE_NODE Con = NULL;
BYTE ExtendedCode = 0;
/* PRIVATE FUNCTIONS **********************************************************/
@@ -141,30 +141,22 @@
/* PUBLIC FUNCTIONS ***********************************************************/
-VOID ConDrvInitialize(PDOS_DEVICE_NODE *InputDevice, PDOS_DEVICE_NODE *OutputDevice)
+VOID ConDrvInitialize(VOID)
{
- ConIn = DosCreateDevice(DOS_DEVATTR_STDIN
- | DOS_DEVATTR_CON
- | DOS_DEVATTR_CHARACTER,
- "CONIN$");
- ConOut = DosCreateDevice(DOS_DEVATTR_STDOUT
- | DOS_DEVATTR_CON
- | DOS_DEVATTR_CHARACTER,
- "CONOUT$");
- ASSERT(ConIn != NULL && ConOut != NULL);
+ Con = DosCreateDevice(DOS_DEVATTR_STDIN
+ | DOS_DEVATTR_STDOUT
+ | DOS_DEVATTR_CON
+ | DOS_DEVATTR_CHARACTER,
+ "CON");
- ConIn->ReadRoutine = ConDrvReadInput;
- ConIn->InputStatusRoutine = ConDrvInputStatus;
- ConOut->WriteRoutine = ConDrvWriteOutput;
- ConIn->OpenRoutine = ConOut->OpenRoutine = ConDrvOpen;
- ConIn->CloseRoutine = ConOut->CloseRoutine = ConDrvClose;
-
- if (InputDevice) *InputDevice = ConIn;
- if (OutputDevice) *OutputDevice = ConOut;
+ Con->ReadRoutine = ConDrvReadInput;
+ Con->InputStatusRoutine = ConDrvInputStatus;
+ Con->WriteRoutine = ConDrvWriteOutput;
+ Con->OpenRoutine = ConDrvOpen;
+ Con->CloseRoutine = ConDrvClose;
}
VOID ConDrvCleanup(VOID)
{
- if (ConIn) DosDeleteDevice(ConIn);
- if (ConOut) DosDeleteDevice(ConOut);
+ if (Con) DosDeleteDevice(Con);
}
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] Thu Mar 26
23:31:01 2015
@@ -311,9 +311,8 @@
{
PDOS_SFT_ENTRY SftEntry;
HANDLE StandardHandles[3];
- PDOS_DEVICE_NODE ConIn = DosGetDevice("CONIN$");
- PDOS_DEVICE_NODE ConOut = DosGetDevice("CONOUT$");
- ASSERT(ConIn != NULL && ConOut != NULL);
+ PDOS_DEVICE_NODE Con = DosGetDevice("CON");
+ ASSERT(Con != NULL);
/* Get the native standard handles */
StandardHandles[0] = GetStdHandle(STD_INPUT_HANDLE);
@@ -322,12 +321,10 @@
for (i = 0; i < 3; i++)
{
- PDOS_DEVICE_NODE Device = (i == 0) ? ConIn : ConOut;
-
/* Find the corresponding SFT entry */
if (IsConsoleHandle(StandardHandles[i]))
{
- SftEntry = DosFindDeviceSftEntry(Device);
+ SftEntry = DosFindDeviceSftEntry(Con);
}
else
{
@@ -349,10 +346,10 @@
if (IsConsoleHandle(StandardHandles[i]))
{
SftEntry->Type = DOS_SFT_ENTRY_DEVICE;
- SftEntry->DeviceNode = Device;
+ SftEntry->DeviceNode = Con;
/* Call the open routine */
- if (Device->OpenRoutine) Device->OpenRoutine(Device);
+ if (Con->OpenRoutine) Con->OpenRoutine(Con);
}
else
{
@@ -2854,7 +2851,6 @@
CHAR CurrentDirectory[MAX_PATH];
CHAR DosDirectory[DOS_DIR_LENGTH];
LPSTR Path;
- PDOS_DEVICE_NODE ConInDevice, ConOutDevice;
FILE *Stream;
WCHAR Buffer[256];
@@ -2915,7 +2911,7 @@
EmsDrvInitialize();
/* Load the CON driver */
- ConDrvInitialize(&ConInDevice, &ConOutDevice);
+ ConDrvInitialize();
#endif
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.h [iso-8859-1] Thu Mar 26
23:31:01 2015
@@ -201,7 +201,7 @@
BOOLEAN DosBIOSInitialize(VOID);
VOID EmsDrvInitialize(VOID);
VOID EmsDrvCleanup(VOID);
-VOID ConDrvInitialize(PDOS_DEVICE_NODE *InputDevice, PDOS_DEVICE_NODE *OutputDevice);
+VOID ConDrvInitialize(VOID);
VOID ConDrvCleanup(VOID);
/*