From 37d5eaa1f58c31ecfc12e3fe1709d43ebf5ac247 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 14 Oct 2013 21:29:17 +0000 Subject: [PATCH] [NTOS:HEADLESS] - Fix the name of a function. - Fix HdlspSendStringAtBaud (we started displaying string at its second character) and fix HdlspPutData (data was sent erroneous, shifted by 1). Fix SAC display. svn path=/trunk/; revision=60675 --- reactos/ntoskrnl/ex/hdlsterm.c | 172 ++++++++++++++++----------------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/reactos/ntoskrnl/ex/hdlsterm.c b/reactos/ntoskrnl/ex/hdlsterm.c index d43a8515615..b1c0ff02a39 100644 --- a/reactos/ntoskrnl/ex/hdlsterm.c +++ b/reactos/ntoskrnl/ex/hdlsterm.c @@ -38,7 +38,7 @@ HdlspAcquireGlobalLock(VOID) FORCEINLINE VOID -HdlspReleaselobalLock(IN KIRQL OldIrql) +HdlspReleaseGlobalLock(IN KIRQL OldIrql) { /* Only release the lock if we aren't bugchecking */ if (OldIrql != 0xFF) @@ -56,12 +56,93 @@ NTAPI HdlspSendStringAtBaud(IN PUCHAR String) { /* Send every byte */ - while (*String++ != ANSI_NULL) + while (*String != ANSI_NULL) { - InbvPortPutByte(HeadlessGlobals->TerminalPort, *String); + InbvPortPutByte(HeadlessGlobals->TerminalPort, *String++); } } +VOID +NTAPI +HdlspPutData(IN PUCHAR Data, + IN ULONG DataSize) +{ + ULONG i; + for (i = 0; i < DataSize; i++) + { + InbvPortPutByte(HeadlessGlobals->TerminalPort, Data[i]); + } +} + +VOID +NTAPI +HdlspPutString(IN PUCHAR String) +{ + PUCHAR Dest = HeadlessGlobals->TmpBuffer; + UCHAR Char = 0; + + /* Scan each character */ + while (*String != ANSI_NULL) + { + /* Check for rotate, send existing buffer and restart from where we are */ + if (Dest >= &HeadlessGlobals->TmpBuffer[79]) + { + HeadlessGlobals->TmpBuffer[79] = ANSI_NULL; + HdlspSendStringAtBaud(HeadlessGlobals->TmpBuffer); + Dest = HeadlessGlobals->TmpBuffer; + } + else + { + /* Get the current character and check for special graphical chars */ + Char = *String; + if (Char & 0x80) + { + switch (Char) + { + case 0xB0: case 0xB3: case 0xBA: + Char = '|'; + break; + case 0xB1: case 0xDC: case 0xDD: case 0xDE: case 0xDF: + Char = '%'; + break; + case 0xB2: case 0xDB: + Char = '#'; + break; + case 0xA9: case 0xAA: case 0xBB: case 0xBC: case 0xBF: + case 0xC0: case 0xC8: case 0xC9: case 0xD9: case 0xDA: + Char = '+'; + break; + case 0xC4: + Char = '-'; + break; + case 0xCD: + Char = '='; + break; + } + } + + /* Anything else must be Unicode */ + if (Char & 0x80) + { + /* Can't do Unicode yet */ + UNIMPLEMENTED; + } + else + { + /* Add the modified char to the temporary buffer */ + *Dest++ = Char; + } + + /* Check the next char */ + String++; + } + } + + /* Finish and send */ + *Dest = ANSI_NULL; + HdlspSendStringAtBaud(HeadlessGlobals->TmpBuffer); +} + NTSTATUS NTAPI HdlspEnableTerminal(IN BOOLEAN Enable) @@ -169,87 +250,6 @@ HeadlessInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock) HdlspEnableTerminal(TRUE); } -VOID -NTAPI -HdlspPutData(IN PUCHAR Data, - IN ULONG DataSize) -{ - ULONG i; - for (i = 0; i < DataSize; i++) - { - InbvPortPutByte(HeadlessGlobals->TerminalPort, Data[i]++); - } -} - -VOID -NTAPI -HdlspPutString(IN PUCHAR String) -{ - PUCHAR Dest = HeadlessGlobals->TmpBuffer; - UCHAR Char = 0; - - /* Scan each character */ - while (*String != ANSI_NULL) - { - /* Check for rotate, send existing buffer and restart from where we are */ - if (Dest >= &HeadlessGlobals->TmpBuffer[79]) - { - HeadlessGlobals->TmpBuffer[79] = ANSI_NULL; - HdlspSendStringAtBaud(HeadlessGlobals->TmpBuffer); - Dest = HeadlessGlobals->TmpBuffer; - } - else - { - /* Get the current character and check for special graphical chars */ - Char = *String; - if (Char & 0x80) - { - switch (Char) - { - case 0xB0: case 0xB3: case 0xBA: - Char = '|'; - break; - case 0xB1: case 0xDC: case 0xDD: case 0xDE: case 0xDF: - Char = '%'; - break; - case 0xB2: case 0xDB: - Char = '#'; - break; - case 0xA9: case 0xAA: case 0xBB: case 0xBC: case 0xBF: - case 0xC0: case 0xC8: case 0xC9: case 0xD9: case 0xDA: - Char = '+'; - break; - case 0xC4: - Char = '-'; - break; - case 0xCD: - Char = '='; - break; - } - } - - /* Anything else must be Unicode */ - if (Char & 0x80) - { - /* Can't do Unicode yet */ - UNIMPLEMENTED; - } - else - { - /* Add the modified char to the temporary buffer */ - *Dest++ = Char; - } - - /* Check the next char */ - String++; - } - } - - /* Finish and send */ - *Dest = ANSI_NULL; - HdlspSendStringAtBaud(HeadlessGlobals->TmpBuffer); -} - NTSTATUS NTAPI HdlspDispatch(IN HEADLESS_CMD Command, @@ -277,13 +277,13 @@ HdlspDispatch(IN HEADLESS_CMD Command, if (HeadlessGlobals->ProcessingCmd) { - HdlspReleaselobalLock(OldIrql); + HdlspReleaseGlobalLock(OldIrql); return STATUS_UNSUCCESSFUL; } /* Don't allow these commands next time */ HeadlessGlobals->ProcessingCmd = TRUE; - HdlspReleaselobalLock(OldIrql); + HdlspReleaseGlobalLock(OldIrql); } /* Handle each command */ -- 2.17.1