Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- Changes: - Simplify tests
dlls/kernel32/tests/console.c | 68 ++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 8b5abfa2da9..a39a637f6ca 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -3554,7 +3554,7 @@ static void test_GetCurrentConsoleFontEx(HANDLE std_output)
static void test_SetCurrentConsoleFontEx(HANDLE std_output) { - CONSOLE_FONT_INFOEX orig_cfix, cfix; + CONSOLE_FONT_INFOEX orig_cfix, cfix, tmp; BOOL ret; HANDLE pipe1, pipe2; HANDLE std_input = GetStdHandle(STD_INPUT_HANDLE); @@ -3661,6 +3661,72 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output) todo_wine ok(ret, "got %d, expected non-zero\n", ret); todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
+ /* Request a TrueType font */ + cfix.cbSize = sizeof(cfix); + cfix.nFont = 0; + cfix.dwFontSize.X = 0; + cfix.FontFamily = TMPF_VECTOR | TMPF_TRUETYPE | FF_MODERN; + cfix.FontWeight = FW_NORMAL; + lstrcpyW(cfix.FaceName, L"Lucida Console"); + + /* Try setting console font information for the current window size */ + /* Test font height 16 */ + cfix.dwFontSize.Y = 16; + SetLastError(0xdeadbeef); + ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix); + todo_wine ok(ret, "got %d, expected non-zero\n", ret); + todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + + tmp.cbSize = sizeof(tmp); + ret = GetCurrentConsoleFontEx(std_output, FALSE, &tmp); + ok(ret, "got %d, expected non-zero\n", ret); + ok(tmp.dwFontSize.Y == cfix.dwFontSize.Y, "got %u, expected %u\n", tmp.dwFontSize.Y, cfix.dwFontSize.Y); + todo_wine ok(tmp.FontFamily == cfix.FontFamily, "got %u, expected %u\n", tmp.FontFamily, cfix.FontFamily); + ok(tmp.FontWeight == cfix.FontWeight, "got %u, expected %u\n", tmp.FontWeight, cfix.FontWeight); + + /* Test font height 20 */ + cfix.dwFontSize.Y = 20; + + SetLastError(0xdeadbeef); + ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix); + todo_wine ok(ret, "got %d, expected non-zero\n", ret); + todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + + ret = GetCurrentConsoleFontEx(std_output, FALSE, &tmp); + ok(ret, "got %d, expected non-zero\n", ret); + todo_wine ok(tmp.dwFontSize.Y == cfix.dwFontSize.Y, "got %u, expected %u\n", tmp.dwFontSize.Y, cfix.dwFontSize.Y); + todo_wine ok(tmp.FontFamily == cfix.FontFamily, "got %u, expected %u\n", tmp.FontFamily, cfix.FontFamily); + ok(tmp.FontWeight == cfix.FontWeight, "got %u, expected %u\n", tmp.FontWeight, cfix.FontWeight); + + /* Test invalid font height */ + cfix.dwFontSize.Y = 0; + + SetLastError(0xdeadbeef); + ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix); + todo_wine ok(ret, "got %d, expected non-zero\n", ret); + todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + + ret = GetCurrentConsoleFontEx(std_output, FALSE, &tmp); + ok(ret, "got %d, expected non-zero\n", ret); + todo_wine ok(tmp.dwFontSize.Y == 12, "got %u, expected 12\n", tmp.dwFontSize.Y); + todo_wine ok(tmp.FontFamily == cfix.FontFamily, "got %u, expected %u\n", tmp.FontFamily, cfix.FontFamily); + ok(tmp.FontWeight == cfix.FontWeight, "got %u, expected %u\n", tmp.FontWeight, cfix.FontWeight); + + /* Test with no font weight */ + cfix.dwFontSize.Y = 16; + cfix.FontWeight = 0; + + SetLastError(0xdeadbeef); + ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix); + todo_wine ok(ret, "got %d, expected non-zero\n", ret); + todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + + ret = GetCurrentConsoleFontEx(std_output, FALSE, &tmp); + ok(ret, "got %d, expected non-zero\n", ret); + ok(tmp.dwFontSize.Y == cfix.dwFontSize.Y, "got %u, expected %u\n", tmp.dwFontSize.Y, cfix.dwFontSize.Y); + todo_wine ok(tmp.FontFamily == cfix.FontFamily, "got %u, expected %u\n", tmp.FontFamily, cfix.FontFamily); + ok(tmp.FontWeight == FW_NORMAL, "got %u, expected %u\n", tmp.FontWeight, FW_NORMAL); + /* Restore original console font parameters */ SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_output, FALSE, &orig_cfix);
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- dlls/kernel32/console.c | 7 ---- dlls/kernel32/kernel32.spec | 2 +- dlls/kernel32/tests/console.c | 60 ++++++++++++++++----------------- dlls/kernelbase/console.c | 36 ++++++++++++++++++++ dlls/kernelbase/kernelbase.spec | 1 + include/wine/condrv.h | 6 ++++ programs/conhost/conhost.c | 10 ++++++ programs/conhost/conhost.h | 15 +++++---- programs/conhost/window.c | 4 +-- 9 files changed, 95 insertions(+), 46 deletions(-)
diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c index 80f3419cd7a..58bd18d2a5f 100644 --- a/dlls/kernel32/console.c +++ b/dlls/kernel32/console.c @@ -480,10 +480,3 @@ BOOL WINAPI GetConsoleFontInfo(HANDLE hConsole, BOOL maximize, DWORD numfonts, C SetLastError(LOWORD(E_NOTIMPL) /* win10 1709+ */); return FALSE; } - -BOOL WINAPI SetCurrentConsoleFontEx(HANDLE hConsole, BOOL maxwindow, CONSOLE_FONT_INFOEX *cfix) -{ - FIXME("(%p %d %p): stub!\n", hConsole, maxwindow, cfix); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 015324f7677..4df6ab9a90f 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -1389,7 +1389,7 @@ @ stdcall -import SetConsoleTitleW(wstr) @ stdcall -import SetConsoleWindowInfo(long long ptr) @ stdcall SetCriticalSectionSpinCount(ptr long) NTDLL.RtlSetCriticalSectionSpinCount -@ stdcall SetCurrentConsoleFontEx(long long ptr) +@ stdcall -import SetCurrentConsoleFontEx(long long ptr) @ stdcall -import SetCurrentDirectoryA(str) @ stdcall -import SetCurrentDirectoryW(wstr) @ stub SetDaylightFlag diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index a39a637f6ca..91bb711648c 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -3570,18 +3570,18 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output) SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(NULL, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(NULL, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
CreatePipe(&pipe1, &pipe2, NULL, 0); SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(pipe1, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); CloseHandle(pipe1); CloseHandle(pipe2);
@@ -3589,36 +3589,36 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output) SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(pipe1, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); CloseHandle(pipe1); CloseHandle(pipe2);
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_input, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_input, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_output, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
cfix = orig_cfix;
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(NULL, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(NULL, TRUE, &cfix); @@ -3629,7 +3629,7 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output) SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(pipe1, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); CloseHandle(pipe1); CloseHandle(pipe2);
@@ -3644,7 +3644,7 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output) SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_input, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_input, TRUE, &cfix); @@ -3653,13 +3653,13 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix); - todo_wine ok(ret, "got %d, expected non-zero\n", ret); - todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(ret, "got %d, expected non-zero\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_output, TRUE, &cfix); todo_wine ok(ret, "got %d, expected non-zero\n", ret); - todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
/* Request a TrueType font */ cfix.cbSize = sizeof(cfix); @@ -3674,14 +3674,14 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output) cfix.dwFontSize.Y = 16; SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix); - todo_wine ok(ret, "got %d, expected non-zero\n", ret); - todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(ret, "got %d, expected non-zero\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
tmp.cbSize = sizeof(tmp); ret = GetCurrentConsoleFontEx(std_output, FALSE, &tmp); ok(ret, "got %d, expected non-zero\n", ret); ok(tmp.dwFontSize.Y == cfix.dwFontSize.Y, "got %u, expected %u\n", tmp.dwFontSize.Y, cfix.dwFontSize.Y); - todo_wine ok(tmp.FontFamily == cfix.FontFamily, "got %u, expected %u\n", tmp.FontFamily, cfix.FontFamily); + ok(tmp.FontFamily == cfix.FontFamily, "got %u, expected %u\n", tmp.FontFamily, cfix.FontFamily); ok(tmp.FontWeight == cfix.FontWeight, "got %u, expected %u\n", tmp.FontWeight, cfix.FontWeight);
/* Test font height 20 */ @@ -3689,13 +3689,13 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix); - todo_wine ok(ret, "got %d, expected non-zero\n", ret); - todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(ret, "got %d, expected non-zero\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
ret = GetCurrentConsoleFontEx(std_output, FALSE, &tmp); ok(ret, "got %d, expected non-zero\n", ret); - todo_wine ok(tmp.dwFontSize.Y == cfix.dwFontSize.Y, "got %u, expected %u\n", tmp.dwFontSize.Y, cfix.dwFontSize.Y); - todo_wine ok(tmp.FontFamily == cfix.FontFamily, "got %u, expected %u\n", tmp.FontFamily, cfix.FontFamily); + ok(tmp.dwFontSize.Y == cfix.dwFontSize.Y, "got %u, expected %u\n", tmp.dwFontSize.Y, cfix.dwFontSize.Y); + ok(tmp.FontFamily == cfix.FontFamily, "got %u, expected %u\n", tmp.FontFamily, cfix.FontFamily); ok(tmp.FontWeight == cfix.FontWeight, "got %u, expected %u\n", tmp.FontWeight, cfix.FontWeight);
/* Test invalid font height */ @@ -3703,13 +3703,13 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix); - todo_wine ok(ret, "got %d, expected non-zero\n", ret); - todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(ret, "got %d, expected non-zero\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
ret = GetCurrentConsoleFontEx(std_output, FALSE, &tmp); ok(ret, "got %d, expected non-zero\n", ret); - todo_wine ok(tmp.dwFontSize.Y == 12, "got %u, expected 12\n", tmp.dwFontSize.Y); - todo_wine ok(tmp.FontFamily == cfix.FontFamily, "got %u, expected %u\n", tmp.FontFamily, cfix.FontFamily); + ok(tmp.dwFontSize.Y == 12, "got %u, expected 12\n", tmp.dwFontSize.Y); + ok(tmp.FontFamily == cfix.FontFamily, "got %u, expected %u\n", tmp.FontFamily, cfix.FontFamily); ok(tmp.FontWeight == cfix.FontWeight, "got %u, expected %u\n", tmp.FontWeight, cfix.FontWeight);
/* Test with no font weight */ @@ -3718,20 +3718,20 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix); - todo_wine ok(ret, "got %d, expected non-zero\n", ret); - todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(ret, "got %d, expected non-zero\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
ret = GetCurrentConsoleFontEx(std_output, FALSE, &tmp); ok(ret, "got %d, expected non-zero\n", ret); ok(tmp.dwFontSize.Y == cfix.dwFontSize.Y, "got %u, expected %u\n", tmp.dwFontSize.Y, cfix.dwFontSize.Y); - todo_wine ok(tmp.FontFamily == cfix.FontFamily, "got %u, expected %u\n", tmp.FontFamily, cfix.FontFamily); + ok(tmp.FontFamily == cfix.FontFamily, "got %u, expected %u\n", tmp.FontFamily, cfix.FontFamily); ok(tmp.FontWeight == FW_NORMAL, "got %u, expected %u\n", tmp.FontWeight, FW_NORMAL);
/* Restore original console font parameters */ SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_output, FALSE, &orig_cfix); - todo_wine ok(ret, "got %d, expected non-zero\n", ret); - todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(ret, "got %d, expected non-zero\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); }
static void test_GetConsoleFontSize(HANDLE std_output) diff --git a/dlls/kernelbase/console.c b/dlls/kernelbase/console.c index a7eeb439232..39451920624 100644 --- a/dlls/kernelbase/console.c +++ b/dlls/kernelbase/console.c @@ -1303,6 +1303,42 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleWindowInfo( HANDLE handle, BOOL absolute }
+/****************************************************************************** + * SetCurrentConsoleFontEx (kernelbase.@) + */ +BOOL WINAPI SetCurrentConsoleFontEx(HANDLE hConsole, BOOL maxwindow, CONSOLE_FONT_INFOEX *cfix) +{ + struct condrv_output_info_params_font data; + + TRACE( "(%p %d %p)\n", hConsole, maxwindow, cfix ); + + if (cfix->cbSize != sizeof(CONSOLE_FONT_INFOEX)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (maxwindow) + { + FIXME( "(%p %d %p): semi-stub\n", hConsole, maxwindow, cfix); + return FALSE; + } + + data.params.mask = SET_CONSOLE_OUTPUT_INFO_FONT; + + data.params.info.font_width = cfix->dwFontSize.X; + data.params.info.font_height = cfix->dwFontSize.Y; + data.params.info.font_pitch_family = cfix->FontFamily; + data.params.info.font_weight = cfix->FontWeight; + + memcpy( data.face_name, cfix->FaceName, sizeof(cfix->FaceName) ); + data.face_name[ LF_FACESIZE - 1 ] = 0; + + return console_ioctl( hConsole, IOCTL_CONDRV_SET_OUTPUT_INFO, + &data, sizeof(data), NULL, 0, NULL ); +} + + /*********************************************************************** * ReadConsoleInputA (kernelbase.@) */ diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index 7bc0c262fdd..1710915f2b7 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -1422,6 +1422,7 @@ @ stdcall SetConsoleTitleW(wstr) @ stdcall SetConsoleWindowInfo(long long ptr) @ stdcall SetCriticalSectionSpinCount(ptr long) ntdll.RtlSetCriticalSectionSpinCount +@ stdcall SetCurrentConsoleFontEx(long long ptr) @ stdcall SetCurrentDirectoryA(str) @ stdcall SetCurrentDirectoryW(wstr) @ stdcall SetDefaultDllDirectories(long) diff --git a/include/wine/condrv.h b/include/wine/condrv.h index 4d2332a1ee9..605e6f2c2fe 100644 --- a/include/wine/condrv.h +++ b/include/wine/condrv.h @@ -148,6 +148,11 @@ struct condrv_output_info_params struct condrv_output_info info; /* output info */ };
+struct condrv_output_info_params_font { + struct condrv_output_info_params params; + WCHAR face_name[LF_FACESIZE]; +}; + #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x0001 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x0002 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x0004 @@ -155,6 +160,7 @@ struct condrv_output_info_params #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x0010 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x0020 #define SET_CONSOLE_OUTPUT_INFO_POPUP_ATTR 0x0040 +#define SET_CONSOLE_OUTPUT_INFO_FONT 0x0080
/* IOCTL_CONDRV_FILL_OUTPUT params */ struct condrv_fill_output_params diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index 05447d52dd5..b5152144a3d 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -1914,6 +1914,16 @@ static NTSTATUS set_output_info( struct screen_buffer *screen_buffer, screen_buffer->max_width = info->max_width; screen_buffer->max_height = info->max_height; } + if (params->mask & SET_CONSOLE_OUTPUT_INFO_FONT) + { + WCHAR *face_name = (WCHAR *)(params + 1); + + screen_buffer->font.pitch_family = info->font_pitch_family; + + update_console_font( screen_buffer->console, face_name, + info->font_height ? info->font_height : 12, + info->font_weight ? info->font_weight : FW_NORMAL ); + }
if (is_active( screen_buffer )) { diff --git a/programs/conhost/conhost.h b/programs/conhost/conhost.h index 5e9b999380c..ce47caaca66 100644 --- a/programs/conhost/conhost.h +++ b/programs/conhost/conhost.h @@ -130,17 +130,20 @@ struct screen_buffer struct wine_rb_entry entry; /* map entry */ };
-BOOL init_window( struct console *console ); -void init_message_window( struct console *console ); -void update_window_region( struct console *console, const RECT *update ); -void update_window_config( struct console *console, BOOL delay ); - +/* conhost.c */ NTSTATUS write_console_input( struct console *console, const INPUT_RECORD *records, unsigned int count, BOOL flush ); - void notify_screen_buffer_size( struct screen_buffer *screen_buffer ); NTSTATUS change_screen_buffer_size( struct screen_buffer *screen_buffer, int new_width, int new_height );
+/* window.c */ +void update_console_font( struct console *console, const WCHAR *font, + unsigned int height, unsigned int weight ); +BOOL init_window( struct console *console ); +void init_message_window( struct console *console ); +void update_window_region( struct console *console, const RECT *update ); +void update_window_config( struct console *console, BOOL delay ); + static inline void empty_update_rect( struct screen_buffer *screen_buffer, RECT *rect ) { SetRect( rect, screen_buffer->width, screen_buffer->height, 0, 0 ); diff --git a/programs/conhost/window.c b/programs/conhost/window.c index 7ad0d48effd..5c02eeb04ed 100644 --- a/programs/conhost/window.c +++ b/programs/conhost/window.c @@ -851,8 +851,8 @@ static int WINAPI get_first_font_enum( const LOGFONTW *lf, const TEXTMETRICW *tm
/* sets logfont as the new font for the console */ -static void update_console_font( struct console *console, const WCHAR *font, - unsigned int height, unsigned int weight ) +void update_console_font( struct console *console, const WCHAR *font, + unsigned int height, unsigned int weight ) { struct font_chooser fc; LOGFONTW lf;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=103164
Your paranoid android.
=== w8 (32 bit report) ===
kernel32: console.c:3782: Test failed: got 8, expected 10 console.c:3783: Test failed: got 12, expected 16
=== w8adm (32 bit report) ===
kernel32: console.c:3782: Test failed: got 8, expected 10 console.c:3783: Test failed: got 12, expected 16
=== debiant2 (32 bit Japanese:Japan report) ===
kernel32: console.c:3683: Test failed: got 17, expected 16 console.c:3711: Test failed: got 11, expected 12 console.c:3726: Test failed: got 17, expected 16
=== debiant2 (32 bit Chinese:China report) ===
kernel32: console.c:3711: Test failed: got 11, expected 12
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=103163
Your paranoid android.
=== w8adm (32 bit report) ===
kernel32: console.c:3782: Test failed: got 8, expected 10 console.c:3783: Test failed: got 12, expected 16
On Thu, 2 Dec 2021 at 23:01, Marvin wrote:
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=103163
Your paranoid android.
=== w8adm (32 bit report) ===
kernel32: console.c:3782: Test failed: got 8, expected 10 console.c:3783: Test failed: got 12, expected 16
These seem to be random errors. See retests [1] and [2].
[1] https://testbot.winehq.org/JobDetails.pl?Key=103167 [2] https://testbot.winehq.org/JobDetails.pl?Key=103168