From 2cef04bd3012433738fe603f328b4f564c94aa4e Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Tue, 31 Mar 2015 21:45:12 +0000 Subject: [PATCH 1/1] [NTVDM] INT 21h, AH = OAh - Special characters should be echoed onto the screen (like ^A, etc...) and appended to the buffer. svn path=/trunk/; revision=67003 --- .../subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c b/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c index d0c03fdca07..a058c5861b9 100644 --- a/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c +++ b/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c @@ -1539,6 +1539,9 @@ VOID WINAPI DosInt21h(LPWORD Stack) /* Ctrl-C */ case 0x03: { + DosPrintCharacter(DOS_OUTPUT_HANDLE, '^'); + DosPrintCharacter(DOS_OUTPUT_HANDLE, 'C'); + if (DosControlBreak()) return; break; } @@ -1561,15 +1564,19 @@ VOID WINAPI DosInt21h(LPWORD Stack) default: { - if (Character == 0x0A || Character == 0x0D - || (Character >= 0x20 && Character <= 0x7F)) - { - /* Echo the character and append it to the buffer */ - DosPrintCharacter(DOS_OUTPUT_HANDLE, Character); - InputBuffer->Buffer[Count] = Character; + /* Append it to the buffer */ + InputBuffer->Buffer[Count] = Character; + Count++; /* Carriage returns are also counted */ - Count++; /* Carriage returns are also counted */ + /* Check if this is a special character */ + if (Character < 0x20 && Character != 0x0A && Character != 0x0D) + { + DosPrintCharacter(DOS_OUTPUT_HANDLE, '^'); + Character += 'A' - 1; } + + /* Echo the character */ + DosPrintCharacter(DOS_OUTPUT_HANDLE, Character); } } -- 2.17.1