Kenichi Aramaki (karamaki-at-gmail-dot-com):

- Fix Japanese keyboard layout (bug #4145).
- Fix buffer overflow in CMD.EXE when dealing with double-byte code page (bug #4146).

svn path=/trunk/; revision=39493
This commit is contained in:
Dmitry Gorbachev 2009-02-08 17:41:21 +00:00
parent a44e51e9d6
commit 468038e6d4
2 changed files with 18 additions and 18 deletions

View file

@ -163,8 +163,8 @@ VOID ConPuts(LPTSTR szText, DWORD nStdHandle)
len = _tcslen(szText);
#ifdef _UNICODE
pBuf = cmd_alloc(len + 1);
len = WideCharToMultiByte( OutputCodePage, 0, szText, len + 1, pBuf, len + 1, NULL, NULL) - 1;
pBuf = cmd_alloc(len * 2 + 1);
len = WideCharToMultiByte(OutputCodePage, 0, szText, len + 1, pBuf, len * 2 + 1, NULL, NULL) - 1;
#else
pBuf = szText;
#endif
@ -215,8 +215,8 @@ VOID ConPrintf(LPTSTR szFormat, va_list arg_ptr, DWORD nStdHandle)
len = _vstprintf(szOut, szFormat, arg_ptr);
#ifdef _UNICODE
pBuf = cmd_alloc(len + 1);
len = WideCharToMultiByte( OutputCodePage, 0, szOut, len + 1, pBuf, len + 1, NULL, NULL) - 1;
pBuf = cmd_alloc(len * 2 + 1);
len = WideCharToMultiByte(OutputCodePage, 0, szOut, len + 1, pBuf, len * 2 + 1, NULL, NULL) - 1;
#else
pBuf = szOut;
#endif
@ -227,7 +227,6 @@ VOID ConPrintf(LPTSTR szFormat, va_list arg_ptr, DWORD nStdHandle)
&dwWritten,
NULL);
#ifdef _UNICODE
cmd_free(pBuf);
#endif

View file

@ -63,7 +63,7 @@ ROSDATA USHORT scancode_to_vk[] = {
/* Third letters row */
'Z', 'X', 'C', 'V',
'B', 'N', 'M', VK_OEM_COMMA,
VK_OEM_PERIOD,VK_OEM_2,/*VK_OEM_5,*/ VK_RSHIFT,
VK_OEM_PERIOD,VK_OEM_2, VK_RSHIFT,
/* - 37 - */
/* Bottom Row */
VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL,
@ -100,13 +100,13 @@ ROSDATA USHORT scancode_to_vk[] = {
/* Not sure who uses these codes */
VK_EMPTY, VK_EMPTY, VK_EMPTY,
/* - 72 - */
VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY,
VK_EMPTY, VK_OEM_102, VK_EMPTY, VK_EMPTY,
/* - 76 - */
/* One more f-key */
VK_F24,
/* - 77 - */
VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY,
VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* PA1 */
VK_EMPTY, VK_EMPTY, VK_OEM_5, VK_EMPTY, /* PA1 */
VK_EMPTY,
/* - 80 - */
0
@ -181,10 +181,11 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = {
ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = {
/* Normal, Shifted, Ctrl */
/* Legacy (telnet-style) ascii escapes */
{ VK_OEM_4, 0, {'[', '{', 0x1b /* ESC */} },
{ VK_OEM_6, 0, {']', '}', 0x1d /* GS */} },
{ VK_OEM_5, 0, {'\\','|', 0x1c /* FS */} },
{ VK_RETURN,0, {'\r', '\r', '\n'} },
{ VK_OEM_4, NOCAPS, {'[' , '{' , 0x1b /* ESC */} },
{ VK_OEM_6, NOCAPS, {']' , '}' , 0x1d /* GS */} },
{ VK_OEM_5, NOCAPS, {'\\', '|' , 0x1c /* FS */} }, /* Yen */
{ VK_OEM_102, NOCAPS, {'\\', '_' , 0x1c /* FS */} }, /* 'ro' */
{ VK_RETURN, NOCAPS, {'\r', '\r', '\n' } },
{ 0, 0 }
};