4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-18 23:12:15 +08:00

Cygwin: console: use UNICODE API throughout

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2018-09-05 13:08:33 +02:00
parent 9bbda85e27
commit 213d8cac24

View File

@ -759,7 +759,7 @@ dev_console::scroll_buffer (HANDLE h, int x1, int y1, int x2, int y2, int xn, in
SMALL_RECT sr1, sr2; SMALL_RECT sr1, sr2;
CHAR_INFO fill; CHAR_INFO fill;
COORD dest; COORD dest;
fill.Char.AsciiChar = ' '; fill.Char.UnicodeChar = L' ';
fill.Attributes = current_win32_attr; fill.Attributes = current_win32_attr;
fillin (h); fillin (h);
@ -775,7 +775,7 @@ dev_console::scroll_buffer (HANDLE h, int x1, int y1, int x2, int y2, int xn, in
sr1.Bottom = sr2.Bottom; sr1.Bottom = sr2.Bottom;
dest.X = xn >= 0 ? xn : dwWinSize.X - 1; dest.X = xn >= 0 ? xn : dwWinSize.X - 1;
dest.Y = yn >= 0 ? yn : b.srWindow.Bottom; dest.Y = yn >= 0 ? yn : b.srWindow.Bottom;
ScrollConsoleScreenBuffer (h, &sr1, &sr2, dest, &fill); ScrollConsoleScreenBufferW (h, &sr1, &sr2, dest, &fill);
} }
inline void inline void
@ -822,7 +822,7 @@ fhandler_console::open (int flags, mode_t)
set_output_handle (NULL); set_output_handle (NULL);
/* Open the input handle as handle_ */ /* Open the input handle as handle_ */
h = CreateFile ("CONIN$", GENERIC_READ | GENERIC_WRITE, h = CreateFileW (L"CONIN$", GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, &sec_none, FILE_SHARE_READ | FILE_SHARE_WRITE, &sec_none,
OPEN_EXISTING, 0, 0); OPEN_EXISTING, 0, 0);
@ -833,7 +833,7 @@ fhandler_console::open (int flags, mode_t)
} }
set_io_handle (h); set_io_handle (h);
h = CreateFile ("CONOUT$", GENERIC_READ | GENERIC_WRITE, h = CreateFileW (L"CONOUT$", GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, &sec_none, FILE_SHARE_READ | FILE_SHARE_WRITE, &sec_none,
OPEN_EXISTING, 0, 0); OPEN_EXISTING, 0, 0);
@ -1226,9 +1226,9 @@ dev_console::scroll_window (HANDLE h, int x1, int y1, int x2, int y2)
br.Right = b.dwSize.X - 1; br.Right = b.dwSize.X - 1;
br.Bottom = b.dwSize.Y - 1; br.Bottom = b.dwSize.Y - 1;
dest.X = dest.Y = 0; dest.X = dest.Y = 0;
fill.Char.AsciiChar = ' '; fill.Char.UnicodeChar = L' ';
fill.Attributes = current_win32_attr; fill.Attributes = current_win32_attr;
ScrollConsoleScreenBuffer (h, &br, NULL, dest, &fill); ScrollConsoleScreenBufferW (h, &br, NULL, dest, &fill);
/* Since we're moving the console buffer under the console window /* Since we're moving the console buffer under the console window
we only have to move the console window if the user scrolled the we only have to move the console window if the user scrolled the
window upwards. The number of lines is the distance to the window upwards. The number of lines is the distance to the