Author: aandrejevic
Date: Fri Sep 25 22:09:37 2015
New Revision: 69357
URL:
http://svn.reactos.org/svn/reactos?rev=69357&view=rev
Log:
[NTVDM]
Don't echo when STDIN isn't the CON device.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/bios.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/bios.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/bios.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/bios.c [iso-8859-1] Fri Sep 25
22:09:37 2015
@@ -43,6 +43,51 @@
/* PUBLIC FUNCTIONS ***********************************************************/
+VOID DosEchoCharacter(CHAR Character)
+{
+ switch (Character)
+ {
+ case '\0':
+ {
+ /* Nothing */
+ break;
+ }
+
+ case '\r':
+ case '\n':
+ {
+ /* Print both a carriage return and a newline */
+ DosPrintCharacter(DOS_OUTPUT_HANDLE, '\r');
+ DosPrintCharacter(DOS_OUTPUT_HANDLE, '\n');
+ break;
+ }
+
+ case '\b':
+ {
+ /* Erase the character */
+ DosPrintCharacter(DOS_OUTPUT_HANDLE, '\b');
+ DosPrintCharacter(DOS_OUTPUT_HANDLE, ' ');
+ DosPrintCharacter(DOS_OUTPUT_HANDLE, '\b');
+ break;
+ }
+
+ default:
+ {
+ /* Check if this is a special character */
+ if (Character < 0x20)
+ {
+ DosPrintCharacter(DOS_OUTPUT_HANDLE, '^');
+ Character += 'A' - 1;
+ }
+ else
+ {
+ /* Echo the character */
+ DosPrintCharacter(DOS_OUTPUT_HANDLE, Character);
+ }
+ }
+ }
+}
+
CHAR DosReadCharacter(WORD FileHandle)
{
WORD BytesRead;
@@ -65,6 +110,13 @@
MAKELONG(DOS_DATA_OFFSET(Sda.ByteBuffer), DOS_DATA_SEGMENT),
1,
&BytesRead);
+
+ /* Check if the file is actually the CON device */
+ if (Descriptor && Descriptor->DeviceInfo & FILE_INFO_DEVICE)
+ {
+ /* Echo the character */
+ DosEchoCharacter(Sda->ByteBuffer);
+ }
/* Restore the old mode and return the character */
if (Descriptor) Descriptor->DeviceInfo = OldDeviceInfo;
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 Sep 25
22:09:37 2015
@@ -161,51 +161,6 @@
/* PUBLIC FUNCTIONS ***********************************************************/
-VOID DosEchoCharacter(CHAR Character)
-{
- switch (Character)
- {
- case '\0':
- {
- /* Nothing */
- break;
- }
-
- case '\r':
- case '\n':
- {
- /* Print both a carriage return and a newline */
- DosPrintCharacter(DOS_OUTPUT_HANDLE, '\r');
- DosPrintCharacter(DOS_OUTPUT_HANDLE, '\n');
- break;
- }
-
- case '\b':
- {
- /* Erase the character */
- DosPrintCharacter(DOS_OUTPUT_HANDLE, '\b');
- DosPrintCharacter(DOS_OUTPUT_HANDLE, ' ');
- DosPrintCharacter(DOS_OUTPUT_HANDLE, '\b');
- break;
- }
-
- default:
- {
- /* Check if this is a special character */
- if (Character < 0x20)
- {
- DosPrintCharacter(DOS_OUTPUT_HANDLE, '^');
- Character += 'A' - 1;
- }
- else
- {
- /* Echo the character */
- DosPrintCharacter(DOS_OUTPUT_HANDLE, Character);
- }
- }
- }
-}
-
BOOLEAN DosControlBreak(VOID)
{
setCF(0);
@@ -260,7 +215,6 @@
DPRINT("INT 21h, AH = 01h\n");
Character = DosReadCharacter(DOS_INPUT_HANDLE);
- DosEchoCharacter(Character);
if (Character == 0x03 && DosControlBreak()) break;
setAL(Character);
@@ -337,11 +291,8 @@
/* Input */
if (DosCheckInput())
{
- CHAR Character = DosReadCharacter(DOS_INPUT_HANDLE);
- DosEchoCharacter(Character);
-
Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_ZF;
- setAL(Character);
+ setAL(DosReadCharacter(DOS_INPUT_HANDLE));
}
else
{