/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup
- * FILE: subsys/system/usetup/console.c
+ * FILE: base/setup/usetup/native/utils/console.c
* PURPOSE: Console support functions
* PROGRAMMER: Eric Kohl
*/
return FALSE;
lpBuffer->EventType = KEY_EVENT;
- Status = IntTranslateKey(&InputData, &lpBuffer->Event.KeyEvent);
+ Status = IntTranslateKey(hConsoleInput, &InputData, &lpBuffer->Event.KeyEvent);
if (!NT_SUCCESS(Status))
return FALSE;
COORD *pCoord;
PCHAR pText;
NTSTATUS Status;
- ULONG i;
+// ULONG i;
+
+ UNICODE_STRING UnicodeString;
+ OEM_STRING OemString;
+ ULONG OemLength;
+
+ UnicodeString.Length = nLength * sizeof(WCHAR);
+ UnicodeString.MaximumLength = nLength * sizeof(WCHAR);
+ UnicodeString.Buffer = (LPWSTR)lpCharacter;
+
+ OemLength = RtlUnicodeStringToOemSize(&UnicodeString);
+
Buffer = (CHAR*)RtlAllocateHeap(ProcessHeap,
0,
- nLength + sizeof(COORD));
+ OemLength + sizeof(COORD));
+// nLength + sizeof(COORD));
+ if (Buffer== NULL)
+ return FALSE;
+
pCoord = (COORD *)Buffer;
pText = (PCHAR)(pCoord + 1);
*pCoord = dwWriteCoord;
+ OemString.Length = 0;
+ OemString.MaximumLength = OemLength;
+ OemString.Buffer = pText;
+
+ Status = RtlUnicodeStringToOemString(&OemString,
+ &UnicodeString,
+ FALSE);
+ if (!NT_SUCCESS(Status))
+ goto done;
+
/* FIXME: use real unicode->oem conversion */
- for (i = 0; i < nLength; i++)
- pText[i] = (CHAR)lpCharacter[i];
+// for (i = 0; i < nLength; i++)
+// pText[i] = (CHAR)lpCharacter[i];
Status = NtDeviceIoControlFile(hConsoleOutput,
NULL,
Buffer,
nLength + sizeof(COORD));
+done:
RtlFreeHeap(ProcessHeap, 0, Buffer);
if (!NT_SUCCESS(Status))
return FALSE;