[CONSRV]: Minor fixes:

- Use GetSystemWindowsDirectoryW instead of GetWindowsDirectoryW inside "TranslateConsoleName";
- Don't add scrollbars by default to the console window when it's being created;
- Fix the 2nd parameter of MapVirtualKeyW call;
- Two code style changes in text.c and tuiterm.c.

svn path=/trunk/; revision=72983
This commit is contained in:
Hermès Bélusca-Maïto
2016-10-18 17:12:57 +00:00
parent 916943b1c4
commit 0d6632cdfb
4 changed files with 5 additions and 5 deletions
@@ -100,7 +100,7 @@ TranslateConsoleName(OUT LPWSTR DestString,
return;
}
wLength = GetWindowsDirectoryW(DestString, MaxStrLen);
wLength = GetSystemWindowsDirectoryW(DestString, MaxStrLen);
if ((wLength > 0) && (_wcsnicmp(ConsoleName, DestString, wLength) == 0))
{
StringCchCopyW(DestString, MaxStrLen, L"%SystemRoot%");
@@ -194,7 +194,7 @@ GuiConsoleInputThread(PVOID Param)
NewWindow = CreateWindowExW(WS_EX_CLIENTEDGE,
GUI_CONWND_CLASS,
Console->Title.Buffer,
WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
@@ -80,7 +80,7 @@ CopyBlock(PTEXTMODE_SCREEN_BUFFER Buffer,
DPRINT1("This case must never happen, because selHeight is at least == 1\n");
}
size += 1; /* Null-termination */
size++; /* Null-termination */
size *= sizeof(WCHAR);
/* Allocate some memory area to be given to the clipboard, so it will not be freed here */
@@ -319,7 +319,7 @@ GuiPasteToTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer,
/* Pressing the character key, with the control keys maintained pressed */
er.Event.KeyEvent.bKeyDown = TRUE;
er.Event.KeyEvent.wVirtualKeyCode = LOBYTE(VkKey);
er.Event.KeyEvent.wVirtualScanCode = MapVirtualKeyW(LOBYTE(VkKey), MAPVK_VK_TO_CHAR);
er.Event.KeyEvent.wVirtualScanCode = MapVirtualKeyW(LOBYTE(VkKey), MAPVK_VK_TO_VSC);
er.Event.KeyEvent.uChar.UnicodeChar = CurChar;
er.Event.KeyEvent.dwControlKeyState = 0;
if (HIBYTE(VkKey) & 1)
@@ -452,7 +452,7 @@ TuiInit(DWORD OemCP)
}
Quit:
if (Ret == FALSE)
if (!Ret)
{
DeleteCriticalSection(&ActiveVirtConsLock);
CloseHandle(ConsoleDeviceHandle);