Author: hbelusca
Date: Sun Aug 31 11:24:23 2014
New Revision: 64005
URL:
http://svn.reactos.org/svn/reactos?rev=64005&view=rev
Log:
[CONSRV]: Code cleaning.
Modified:
branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/coninput.c
branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/text.c
branches/condrv_restructure/win32ss/user/winsrv/consrv/coninput.c
branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h
branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/coninput.c
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/coninput.c [iso-8859-1]
(original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/coninput.c [iso-8859-1]
Sun Aug 31 11:24:23 2014
@@ -25,12 +25,13 @@
/* PRIVATE FUNCTIONS **********************************************************/
+// ConDrvAddInputEvents
static NTSTATUS
-ConDrvAddInputEvents(PCONSOLE Console,
- PINPUT_RECORD InputRecords, // InputEvent
- ULONG NumEventsToWrite,
- PULONG NumEventsWritten,
- BOOLEAN AppendToEnd)
+AddInputEvents(PCONSOLE Console,
+ PINPUT_RECORD InputRecords, // InputEvent
+ ULONG NumEventsToWrite,
+ PULONG NumEventsWritten,
+ BOOLEAN AppendToEnd)
{
NTSTATUS Status = STATUS_SUCCESS;
ULONG i = 0;
@@ -288,6 +289,8 @@
ResetEvent(InputBuffer->ActiveEvent);
}
+ // FIXME: If we add back UNICODE support, it's here that we need to do the
translation.
+
/* We read all the inputs available, we return success */
return STATUS_SUCCESS;
}
@@ -310,11 +313,13 @@
/* Now, add the events */
if (NumEventsWritten) *NumEventsWritten = 0;
- return ConDrvAddInputEvents(Console,
- InputRecord,
- NumEventsToWrite,
- NumEventsWritten,
- AppendToEnd);
+ // FIXME: If we add back UNICODE support, it's here that we need to do the
translation.
+
+ return AddInputEvents(Console,
+ InputRecord,
+ NumEventsToWrite,
+ NumEventsWritten,
+ AppendToEnd);
}
NTSTATUS NTAPI
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/text.c
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/text.c [iso-8859-1]
(original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/text.c [iso-8859-1] Sun
Aug 31 11:24:23 2014
@@ -15,6 +15,20 @@
#include <debug.h>
/* GLOBALS ********************************************************************/
+
+/*
+ * From MSDN:
+ * "The lpMultiByteStr and lpWideCharStr pointers must not be the same.
+ * If they are the same, the function fails, and GetLastError returns
+ * ERROR_INVALID_PARAMETER."
+ */
+#define ConsoleOutputUnicodeToAnsiChar(Console, dChar, sWChar) \
+ ASSERT((ULONG_PTR)dChar != (ULONG_PTR)sWChar); \
+ WideCharToMultiByte((Console)->OutputCodePage, 0, (sWChar), 1, (dChar), 1, NULL,
NULL)
+
+#define ConsoleOutputAnsiToUnicodeChar(Console, dWChar, sChar) \
+ ASSERT((ULONG_PTR)dWChar != (ULONG_PTR)sChar); \
+ MultiByteToWideChar((Console)->OutputCodePage, 0, (sChar), 1, (dWChar), 1)
/* PRIVATE FUNCTIONS **********************************************************/
@@ -500,7 +514,7 @@
}
else
{
- // ConsoleUnicodeCharToAnsiChar(Console,
&CurCharInfo->Char.AsciiChar, &Ptr->Char.UnicodeChar);
+ // ConsoleOutputUnicodeToAnsiChar(Console,
&CurCharInfo->Char.AsciiChar, &Ptr->Char.UnicodeChar);
WideCharToMultiByte(Console->OutputCodePage, 0,
&Ptr->Char.UnicodeChar, 1,
&CurCharInfo->Char.AsciiChar, 1, NULL, NULL);
}
@@ -563,7 +577,7 @@
}
else
{
- ConsoleAnsiCharToUnicodeChar(Console, &Ptr->Char.UnicodeChar,
&CurCharInfo->Char.AsciiChar);
+ ConsoleOutputAnsiToUnicodeChar(Console, &Ptr->Char.UnicodeChar,
&CurCharInfo->Char.AsciiChar);
}
Ptr->Attributes = CurCharInfo->Attributes;
++Ptr;
@@ -626,7 +640,7 @@
Ptr = ConioCoordToPointer(Buffer, CapturedWriteRegion.Left, Y);
for (X = CapturedWriteRegion.Left; X <= CapturedWriteRegion.Right; ++X)
{
- ConsoleAnsiCharToUnicodeChar(Console, &Ptr->Char.UnicodeChar,
&CurCharInfo->Char);
+ ConsoleOutputAnsiToUnicodeChar(Console, &Ptr->Char.UnicodeChar,
&CurCharInfo->Char);
Ptr->Attributes = CurCharInfo->Attributes;
++Ptr;
++CurCharInfo;
@@ -787,7 +801,7 @@
switch (CodeType)
{
case CODE_ASCII:
- ConsoleUnicodeCharToAnsiChar(Console, (PCHAR)ReadBuffer,
&Ptr->Char.UnicodeChar);
+ ConsoleOutputUnicodeToAnsiChar(Console, (PCHAR)ReadBuffer,
&Ptr->Char.UnicodeChar);
break;
case CODE_UNICODE:
@@ -993,7 +1007,7 @@
{
/* Conversion from the ASCII char to the UNICODE char */
CODE_ELEMENT tmp;
- ConsoleAnsiCharToUnicodeChar(Console, &tmp.UnicodeChar,
&Code.AsciiChar);
+ ConsoleOutputAnsiToUnicodeChar(Console, &tmp.UnicodeChar,
&Code.AsciiChar);
Code = tmp;
}
@@ -1178,7 +1192,7 @@
if (!Unicode)
{
WCHAR tmp;
- ConsoleAnsiCharToUnicodeChar(Console, &tmp, &FillChar.Char.AsciiChar);
+ ConsoleOutputAnsiToUnicodeChar(Console, &tmp, &FillChar.Char.AsciiChar);
FillChar.Char.UnicodeChar = tmp;
}
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/coninput.c
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/coninput.c [iso-8859-1]
(original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/coninput.c [iso-8859-1] Sun Aug
31 11:24:23 2014
@@ -26,23 +26,19 @@
ConSrvReleaseObject(&(Buff)->Header, (IsConsoleLocked))
-
-
/*
* From MSDN:
* "The lpMultiByteStr and lpWideCharStr pointers must not be the same.
* If they are the same, the function fails, and GetLastError returns
* ERROR_INVALID_PARAMETER."
*/
-#define ConsoleInputUnicodeCharToAnsiChar(Console, dChar, sWChar) \
+#define ConsoleInputUnicodeToAnsiChar(Console, dChar, sWChar) \
ASSERT((ULONG_PTR)dChar != (ULONG_PTR)sWChar); \
WideCharToMultiByte((Console)->InputCodePage, 0, (sWChar), 1, (dChar), 1, NULL,
NULL)
-#define ConsoleInputAnsiCharToUnicodeChar(Console, dWChar, sChar) \
+#define ConsoleInputAnsiToUnicodeChar(Console, dWChar, sChar) \
ASSERT((ULONG_PTR)dWChar != (ULONG_PTR)sChar); \
MultiByteToWideChar((Console)->InputCodePage, 0, (sChar), 1, (dWChar), 1)
-
-
typedef struct _GET_INPUT_INFO
@@ -62,9 +58,9 @@
{
WCHAR UnicodeChar = InputEvent->Event.KeyEvent.uChar.UnicodeChar;
InputEvent->Event.KeyEvent.uChar.UnicodeChar = 0;
- ConsoleInputUnicodeCharToAnsiChar(Console,
-
&InputEvent->Event.KeyEvent.uChar.AsciiChar,
- &UnicodeChar);
+ ConsoleInputUnicodeToAnsiChar(Console,
+
&InputEvent->Event.KeyEvent.uChar.AsciiChar,
+ &UnicodeChar);
}
}
@@ -75,9 +71,9 @@
{
CHAR AsciiChar = InputEvent->Event.KeyEvent.uChar.AsciiChar;
InputEvent->Event.KeyEvent.uChar.AsciiChar = 0;
- ConsoleInputAnsiCharToUnicodeChar(Console,
-
&InputEvent->Event.KeyEvent.uChar.UnicodeChar,
- &AsciiChar);
+ ConsoleInputAnsiToUnicodeChar(Console,
+
&InputEvent->Event.KeyEvent.uChar.UnicodeChar,
+ &AsciiChar);
}
}
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1]
(original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1]
Sun Aug 31 11:24:23 2014
@@ -327,21 +327,6 @@
IN PCONSOLE_PROCESS_DATA ProcessData);
/* conoutput.c */
-
-/*
- * From MSDN:
- * "The lpMultiByteStr and lpWideCharStr pointers must not be the same.
- * If they are the same, the function fails, and GetLastError returns
- * ERROR_INVALID_PARAMETER."
- */
-#define ConsoleUnicodeCharToAnsiChar(Console, dChar, sWChar) \
- ASSERT((ULONG_PTR)dChar != (ULONG_PTR)sWChar); \
- WideCharToMultiByte((Console)->OutputCodePage, 0, (sWChar), 1, (dChar), 1, NULL,
NULL)
-
-#define ConsoleAnsiCharToUnicodeChar(Console, dWChar, sChar) \
- ASSERT((ULONG_PTR)dWChar != (ULONG_PTR)sChar); \
- MultiByteToWideChar((Console)->OutputCodePage, 0, (sChar), 1, (dWChar), 1)
-
PCHAR_INFO ConioCoordToPointer(PTEXTMODE_SCREEN_BUFFER Buff, ULONG X, ULONG Y);
VOID ConioDrawConsole(PCONSOLE Console);
NTSTATUS ConioResizeBuffer(PCONSOLE Console,
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
---
branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h [iso-8859-1]
(original)
+++
branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h [iso-8859-1]
Sun Aug 31 11:24:23 2014
@@ -197,21 +197,6 @@
PINPUT_RECORD InputEvent);
/* conoutput.c */
-
-/*
- * From MSDN:
- * "The lpMultiByteStr and lpWideCharStr pointers must not be the same.
- * If they are the same, the function fails, and GetLastError returns
- * ERROR_INVALID_PARAMETER."
- */
-#define ConsoleUnicodeCharToAnsiChar(Console, dChar, sWChar) \
- ASSERT((ULONG_PTR)dChar != (ULONG_PTR)sWChar); \
- WideCharToMultiByte((Console)->OutputCodePage, 0, (sWChar), 1, (dChar), 1, NULL,
NULL)
-
-#define ConsoleAnsiCharToUnicodeChar(Console, dWChar, sChar) \
- ASSERT((ULONG_PTR)dWChar != (ULONG_PTR)sChar); \
- MultiByteToWideChar((Console)->OutputCodePage, 0, (sChar), 1, (dWChar), 1)
-
PCHAR_INFO ConioCoordToPointer(PTEXTMODE_SCREEN_BUFFER Buff, ULONG X, ULONG Y);
VOID ConioDrawConsole(PCONSRV_CONSOLE Console);
NTSTATUS ConioResizeBuffer(PCONSRV_CONSOLE Console,