Signed-off-by: Gijs Vermeulen gijsvrm@codeweavers.com --- programs/wineconsole/wineconsole.c | 3 +++ server/console.c | 34 +++++++++++++++++++++++++----- server/protocol.def | 33 ++++++++++++++++------------- 3 files changed, 50 insertions(+), 20 deletions(-)
diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c index 439099c37a..ebcfce1011 100644 --- a/programs/wineconsole/wineconsole.c +++ b/programs/wineconsole/wineconsole.c @@ -458,6 +458,9 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf req->max_height = (r.bottom - r.top - GetSystemMetrics(SM_CYCAPTION)) / cfg->cell_height; req->font_width = cfg->cell_width; req->font_height = cfg->cell_height; + req->font_weight = cfg->font_weight; + req->font_pitch_family = FIXED_PITCH | FF_DONTCARE; + wine_server_add_data( req, cfg->face_name, lstrlenW(cfg->face_name) * sizeof(WCHAR) ); wine_server_call( req ); } SERVER_END_REQ; diff --git a/server/console.c b/server/console.c index 7d1fc5d268..d40da275e9 100644 --- a/server/console.c +++ b/server/console.c @@ -131,6 +131,9 @@ struct font_info { short int width; short int height; + short int weight; + short int pitch_family; + struct unicode_str face_name; };
struct screen_buffer @@ -433,6 +436,10 @@ static struct screen_buffer *create_console_output( struct console_input *consol screen_buffer->data = NULL; screen_buffer->font.width = 0; screen_buffer->font.height = 0; + screen_buffer->font.weight = FW_NORMAL; + screen_buffer->font.pitch_family = FIXED_PITCH | FF_DONTCARE; + screen_buffer->font.face_name.str = NULL; + screen_buffer->font.face_name.len = 0; memset( screen_buffer->color_map, 0, sizeof(screen_buffer->color_map) ); list_add_head( &screen_buffer_list, &screen_buffer->entry );
@@ -896,6 +903,8 @@ static int set_console_output_info( struct screen_buffer *screen_buffer, const struct set_console_output_info_request *req ) { struct console_renderer_event evt; + data_size_t font_name_len, offset; + WCHAR *font_name;
memset(&evt.u, 0, sizeof(evt.u)); if (req->mask & SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM) @@ -1039,15 +1048,29 @@ static int set_console_output_info( struct screen_buffer *screen_buffer, screen_buffer->max_width = req->max_width; screen_buffer->max_height = req->max_height; } + if (req->mask & SET_CONSOLE_OUTPUT_INFO_COLORTABLE) + { + memcpy( screen_buffer->color_map, get_req_data(), min( get_req_data_size(), sizeof(screen_buffer->color_map) )); + } if (req->mask & SET_CONSOLE_OUTPUT_INFO_FONT) { screen_buffer->font.width = req->font_width; screen_buffer->font.height = req->font_height; - } - if (req->mask & SET_CONSOLE_OUTPUT_INFO_COLORTABLE) - { - memcpy( screen_buffer->color_map, get_req_data(), - min( sizeof(screen_buffer->color_map), get_req_data_size() )); + screen_buffer->font.weight = req->font_weight; + screen_buffer->font.pitch_family = req->font_pitch_family; + offset = req->mask & SET_CONSOLE_OUTPUT_INFO_COLORTABLE ? sizeof(screen_buffer->color_map) : 0; + if (get_req_data_size() > offset) + { + font_name_len = (get_req_data_size() - offset) / sizeof(WCHAR) * sizeof(WCHAR); + font_name = mem_alloc( font_name_len ); + if (font_name) + { + memcpy( font_name, (char*)get_req_data() + offset, font_name_len ); + free( (WCHAR *)screen_buffer->font.face_name.str ); + screen_buffer->font.face_name.str = font_name; + screen_buffer->font.face_name.len = font_name_len; + } + } }
return 1; @@ -1183,6 +1206,7 @@ static void screen_buffer_destroy( struct object *obj ) } if (screen_buffer->fd) release_object( screen_buffer->fd ); free( screen_buffer->data ); + free( (WCHAR *)screen_buffer->font.face_name.str ); }
static struct fd *screen_buffer_get_fd( struct object *obj ) diff --git a/server/protocol.def b/server/protocol.def index 3a0df20bdb..4dc9a278ad 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1615,25 +1615,28 @@ struct console_renderer_event
/* Set info about a console (output only) */ @REQ(set_console_output_info) - obj_handle_t handle; /* handle to the console */ - int mask; /* setting mask (see below) */ - short int cursor_size; /* size of cursor (percentage filled) */ - short int cursor_visible;/* cursor visibility flag */ - short int cursor_x; /* position of cursor (x, y) */ + obj_handle_t handle; /* handle to the console */ + int mask; /* setting mask (see below) */ + short int cursor_size; /* size of cursor (percentage filled) */ + short int cursor_visible; /* cursor visibility flag */ + short int cursor_x; /* position of cursor (x, y) */ short int cursor_y; - short int width; /* width of the screen buffer */ - short int height; /* height of the screen buffer */ - short int attr; /* default fill attributes (screen colors) */ - short int popup_attr; /* pop-up color attributes */ - short int win_left; /* window actually displayed by renderer */ - short int win_top; /* the rect area is expressed within the */ - short int win_right; /* boundaries of the screen buffer */ + short int width; /* width of the screen buffer */ + short int height; /* height of the screen buffer */ + short int attr; /* default fill attributes (screen colors) */ + short int popup_attr; /* pop-up color attributes */ + short int win_left; /* window actually displayed by renderer */ + short int win_top; /* the rect area is expressed within the */ + short int win_right; /* boundaries of the screen buffer */ short int win_bottom; - short int max_width; /* maximum size (width x height) for the window */ + short int max_width; /* maximum size (width x height) for the window */ short int max_height; - short int font_width; /* font size (width x height) */ + short int font_width; /* font size (width x height) */ short int font_height; - VARARG(colors,uints); /* color table */ + short int font_weight; /* font weight */ + short int font_pitch_family; /* font pitch & family */ + VARARG(colors,uints); /* color table */ + VARARG(face_name,unicode_str); /* font face name */ @END #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x0001 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x0002
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47620 Signed-off-by: Gijs Vermeulen gijsvrm@codeweavers.com --- dlls/kernel32/console.c | 50 +++++++++++++++++++++++++++++++++++-- dlls/kernel32/kernel32.spec | 2 +- server/console.c | 17 +++++++++++-- server/protocol.def | 31 ++++++++++++----------- 4 files changed, 81 insertions(+), 19 deletions(-)
diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c index a698e53efe..7f7c843d66 100644 --- a/dlls/kernel32/console.c +++ b/dlls/kernel32/console.c @@ -1639,17 +1639,33 @@ BOOL WINAPI SetConsoleKeyShortcuts(BOOL set, BYTE keys, VOID *a, DWORD b) }
-BOOL WINAPI GetCurrentConsoleFont(HANDLE hConsole, BOOL maxwindow, LPCONSOLE_FONT_INFO fontinfo) +BOOL WINAPI GetCurrentConsoleFontEx(HANDLE hConsole, BOOL maxwindow, CONSOLE_FONT_INFOEX *fontinfo) { BOOL ret; + void *data; + size_t color_map_size = 16 * sizeof(unsigned int); + size_t face_name_len = sizeof(fontinfo->FaceName) - sizeof(WCHAR);
- memset(fontinfo, 0, sizeof(CONSOLE_FONT_INFO)); + if (fontinfo->cbSize != sizeof(CONSOLE_FONT_INFOEX)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + data = HeapAlloc(GetProcessHeap(), 0, face_name_len + color_map_size); + if (!data) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + }
SERVER_START_REQ(get_console_output_info) { req->handle = console_handle_unmap(hConsole); + wine_server_set_reply(req, data, face_name_len + color_map_size); if ((ret = !wine_server_call_err(req))) { + fontinfo->nFont = 0; if (maxwindow) { fontinfo->dwFontSize.X = min(reply->width, reply->max_width); @@ -1660,9 +1676,39 @@ BOOL WINAPI GetCurrentConsoleFont(HANDLE hConsole, BOOL maxwindow, LPCONSOLE_FON fontinfo->dwFontSize.X = reply->win_right - reply->win_left + 1; fontinfo->dwFontSize.Y = reply->win_bottom - reply->win_top + 1; } + if (wine_server_reply_size(reply) > color_map_size) + { + face_name_len = min(face_name_len, wine_server_reply_size(reply) - color_map_size); + memcpy(fontinfo->FaceName, (char *)data + color_map_size, face_name_len); + fontinfo->FaceName[face_name_len / sizeof(WCHAR)] = 0; + } + else + fontinfo->FaceName[0] = 0; + fontinfo->FontFamily = reply->font_pitch_family; + fontinfo->FontWeight = reply->font_weight; } } SERVER_END_REQ; + + HeapFree(GetProcessHeap(), 0, data); + + return ret; +} + +BOOL WINAPI GetCurrentConsoleFont(HANDLE hConsole, BOOL maxwindow, CONSOLE_FONT_INFO *fontinfo) +{ + BOOL ret; + CONSOLE_FONT_INFOEX res; + + res.cbSize = sizeof(CONSOLE_FONT_INFOEX); + + ret = GetCurrentConsoleFontEx(hConsole, maxwindow, &res); + if(ret) + { + fontinfo->nFont = res.nFont; + fontinfo->dwFontSize.X = res.dwFontSize.X; + fontinfo->dwFontSize.Y = res.dwFontSize.Y; + } return ret; }
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 5d543f1eb5..28c3b83a06 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -623,7 +623,7 @@ @ stdcall GetCurrencyFormatW(long long wstr ptr ptr long) @ stdcall -import GetCurrentActCtx(ptr) @ stdcall GetCurrentConsoleFont(long long ptr) -# @ stub GetCurrentConsoleFontEx +@ stdcall GetCurrentConsoleFontEx(long long ptr) @ stdcall -import GetCurrentDirectoryA(long ptr) @ stdcall -import GetCurrentDirectoryW(long ptr) @ stdcall GetCurrentPackageFamilyName(ptr ptr) diff --git a/server/console.c b/server/console.c index d40da275e9..f746cdf3b3 100644 --- a/server/console.c +++ b/server/console.c @@ -1755,6 +1755,8 @@ DECL_HANDLER(set_console_output_info) DECL_HANDLER(get_console_output_info) { struct screen_buffer *screen_buffer; + void *data; + data_size_t total;
if ((screen_buffer = (struct screen_buffer *)get_handle_obj( current->process, req->handle, FILE_READ_PROPERTIES, &screen_buffer_ops))) @@ -1775,8 +1777,19 @@ DECL_HANDLER(get_console_output_info) reply->max_height = screen_buffer->max_height; reply->font_width = screen_buffer->font.width; reply->font_height = screen_buffer->font.height; - set_reply_data( screen_buffer->color_map, - min( sizeof(screen_buffer->color_map), get_reply_max_size() )); + reply->font_weight = screen_buffer->font.weight; + reply->font_pitch_family = screen_buffer->font.pitch_family; + total = min( sizeof(screen_buffer->color_map) + screen_buffer->font.face_name.len, get_reply_max_size() ); + if (total) + { + data = set_reply_data_size( total ); + memcpy( data, screen_buffer->color_map, min( total, sizeof(screen_buffer->color_map) )); + if (screen_buffer->font.face_name.len && total > sizeof(screen_buffer->color_map)) + { + memcpy( (char *)data + sizeof(screen_buffer->color_map), screen_buffer->font.face_name.str, + min( total - sizeof(screen_buffer->color_map), screen_buffer->font.face_name.len )); + } + } release_object( screen_buffer ); } } diff --git a/server/protocol.def b/server/protocol.def index 4dc9a278ad..950c6d0525 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1651,25 +1651,28 @@ struct console_renderer_event
/* Get info about a console (output only) */ @REQ(get_console_output_info) - obj_handle_t handle; /* handle to the console */ + obj_handle_t handle; /* handle to the console */ @REPLY - short int cursor_size; /* size of cursor (percentage filled) */ - short int cursor_visible;/* cursor visibility flag */ - short int cursor_x; /* position of cursor (x, y) */ + short int cursor_size; /* size of cursor (percentage filled) */ + short int cursor_visible; /* cursor visibility flag */ + short int cursor_x; /* position of cursor (x, y) */ short int cursor_y; - short int width; /* width of the screen buffer */ - short int height; /* height of the screen buffer */ - short int attr; /* default fill attributes (screen colors) */ - short int popup_attr; /* pop-up color attributes */ - short int win_left; /* window actually displayed by renderer */ - short int win_top; /* the rect area is expressed within the */ - short int win_right; /* boundaries of the screen buffer */ + short int width; /* width of the screen buffer */ + short int height; /* height of the screen buffer */ + short int attr; /* default fill attributes (screen colors) */ + short int popup_attr; /* pop-up color attributes */ + short int win_left; /* window actually displayed by renderer */ + short int win_top; /* the rect area is expressed within the */ + short int win_right; /* boundaries of the screen buffer */ short int win_bottom; - short int max_width; /* maximum size (width x height) for the window */ + short int max_width; /* maximum size (width x height) for the window */ short int max_height; - short int font_width; /* font size (width x height) */ + short int font_width; /* font size (width x height) */ short int font_height; - VARARG(colors,uints); /* color table */ + short int font_weight; /* font weight */ + short int font_pitch_family; /* font pitch & family */ + VARARG(colors,uints); /* color table */ + VARARG(face_name,unicode_str); /* font face name */ @END
/* Add input records to a console input queue */
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=60517
Your paranoid android.
=== debian10 (32 bit report) ===
kernel32: debugger: Timeout
=== debian10 (64 bit WoW report) ===
kernel32: debugger: Timeout
Signed-off-by: Gijs Vermeulen gijsvrm@codeweavers.com --- dlls/kernel32/tests/console.c | 99 +++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 1ecb350673..5f8003760d 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -2694,6 +2694,104 @@ static void test_GetCurrentConsoleFont(HANDLE std_output) "got %d, expected %d\n", cfi.dwFontSize.Y, csbi.dwMaximumWindowSize.Y); }
+static void test_GetCurrentConsoleFontEx(HANDLE std_output) +{ + HANDLE hmod; + BOOL (WINAPI *pGetCurrentConsoleFontEx)(HANDLE, BOOL, CONSOLE_FONT_INFOEX *); + CONSOLE_FONT_INFO cfi; + CONSOLE_FONT_INFOEX cfix; + BOOL ret; + HANDLE std_input = GetStdHandle(STD_INPUT_HANDLE); + + hmod = GetModuleHandleA("kernel32.dll"); + pGetCurrentConsoleFontEx = (void *)GetProcAddress(hmod, "GetCurrentConsoleFontEx"); + if (!pGetCurrentConsoleFontEx) + { + win_skip("GetCurrentConsoleFontEx is not available\n"); + return; + } + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(NULL, FALSE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(NULL, TRUE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(std_input, FALSE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(std_input, TRUE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(std_output, FALSE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(std_output, TRUE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + + cfix.cbSize = sizeof(CONSOLE_FONT_INFOEX); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(NULL, FALSE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(NULL, TRUE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(std_input, FALSE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(std_input, TRUE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(std_output, FALSE, &cfix); + ok(ret, "got %d, expected non-zero\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + + memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO)); + SetLastError(0xdeadbeef); + ret = GetCurrentConsoleFont(std_output, FALSE, &cfi); + ok(ret, "got %d, expected non-zero\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + + ok(cfix.dwFontSize.X == cfi.dwFontSize.X, "expected values to match\n"); + ok(cfix.dwFontSize.Y == cfi.dwFontSize.Y, "expected values to match\n"); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(std_output, TRUE, &cfix); + ok(ret, "got %d, expected non-zero\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + + memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO)); + SetLastError(0xdeadbeef); + ret = GetCurrentConsoleFont(std_output, TRUE, &cfi); + ok(ret, "got %d, expected non-zero\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + + ok(cfix.dwFontSize.X == cfi.dwFontSize.X, "expected values to match\n"); + ok(cfix.dwFontSize.Y == cfi.dwFontSize.Y, "expected values to match\n"); +} + static void test_GetConsoleFontSize(HANDLE std_output) { COORD c; @@ -3294,6 +3392,7 @@ START_TEST(console) test_ReadConsoleOutputCharacterW(hConOut); test_ReadConsoleOutputAttribute(hConOut); test_GetCurrentConsoleFont(hConOut); + test_GetCurrentConsoleFontEx(hConOut); test_GetConsoleFontSize(hConOut); test_GetLargestConsoleWindowSize(hConOut); test_GetConsoleFontInfo(hConOut);
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=60518
Your paranoid android.
=== debian10 (32 bit report) ===
kernel32: debugger.c:320: Test failed: GetThreadContext failed: 5
=== debian10 (32 bit Chinese:China report) ===
kernel32: debugger: Timeout
=== debian10 (32 bit WoW report) ===
kernel32: debugger: Timeout
Signed-off-by: Gijs Vermeulen gijsvrm@codeweavers.com --- programs/wineconsole/registry.c | 13 +++++++++++-- programs/wineconsole/winecon_private.h | 1 + programs/wineconsole/wineconsole.c | 5 +++-- 3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/programs/wineconsole/registry.c b/programs/wineconsole/registry.c index 359034f838..6bcc096d93 100644 --- a/programs/wineconsole/registry.c +++ b/programs/wineconsole/registry.c @@ -38,6 +38,7 @@ static const WCHAR wszCursorVisible[] = {'C','u','r','s','o','r','V','i','s' static const WCHAR wszEditionMode[] = {'E','d','i','t','i','o','n','M','o','d','e',0}; static const WCHAR wszExitOnDie[] = {'E','x','i','t','O','n','D','i','e',0}; static const WCHAR wszFaceName[] = {'F','a','c','e','N','a','m','e',0}; +static const WCHAR wszFontPitchFamily[] = {'F','o','n','t','P','i','t','c','h','F','a','m','i','l','y',0}; static const WCHAR wszFontSize[] = {'F','o','n','t','S','i','z','e',0}; static const WCHAR wszFontWeight[] = {'F','o','n','t','W','e','i','g','h','t',0}; static const WCHAR wszHistoryBufferSize[] = {'H','i','s','t','o','r','y','B','u','f','f','e','r','S','i','z','e',0}; @@ -56,10 +57,10 @@ static const WCHAR color_name_fmt[] = {'%','s','%','0','2','d',0};
void WINECON_DumpConfig(const char* pfx, const struct config_data* cfg) { - WINE_TRACE("%s cell=(%u,%u) cursor=(%d,%d) attr=%02x pop-up=%02x font=%s/%u hist=%u/%d flags=%c%c%c " + WINE_TRACE("%s cell=(%u,%u) cursor=(%d,%d) attr=%02x pop-up=%02x font=%s/%u/%u hist=%u/%d flags=%c%c%c " "msk=%08x sb=(%u,%u) win=(%u,%u)x(%u,%u) edit=%u registry=%s\n", pfx, cfg->cell_width, cfg->cell_height, cfg->cursor_size, cfg->cursor_visible, cfg->def_attr, - cfg->popup_attr, wine_dbgstr_w(cfg->face_name), cfg->font_weight, cfg->history_size, + cfg->popup_attr, wine_dbgstr_w(cfg->face_name), cfg->font_pitch_family, cfg->font_weight, cfg->history_size, cfg->history_nodup ? 1 : 2, cfg->insert_mode ? 'I' : 'i', cfg->quick_edit ? 'Q' : 'q', cfg->exit_on_die ? 'X' : 'x', cfg->menu_mask, cfg->sb_width, cfg->sb_height, cfg->win_pos.X, cfg->win_pos.Y, cfg->win_width, cfg->win_height, cfg->edition_mode, @@ -123,6 +124,10 @@ static void WINECON_RegLoadHelper(HKEY hConKey, struct config_data* cfg) count = sizeof(cfg->face_name); RegQueryValueExW(hConKey, wszFaceName, 0, &type, (LPBYTE)&cfg->face_name, &count);
+ count = sizeof(val); + if (!RegQueryValueExW(hConKey, wszFontPitchFamily, 0, &type, (LPBYTE)&val, &count)) + cfg->font_pitch_family = val; + count = sizeof(val); if (!RegQueryValueExW(hConKey, wszFontSize, 0, &type, (LPBYTE)&val, &count)) { @@ -211,6 +216,7 @@ void WINECON_RegLoad(const WCHAR* appname, struct config_data* cfg) cfg->cursor_visible = 1; cfg->exit_on_die = 1; memset(cfg->face_name, 0, sizeof(cfg->face_name)); + cfg->font_pitch_family = FIXED_PITCH | FF_DONTCARE; cfg->cell_height = MulDiv( 16, GetDpiForSystem(), USER_DEFAULT_SCREEN_DPI ); cfg->cell_width = MulDiv( 8, GetDpiForSystem(), USER_DEFAULT_SCREEN_DPI ); cfg->font_weight = FW_NORMAL; @@ -285,6 +291,9 @@ static void WINECON_RegSaveHelper(HKEY hConKey, const struct config_data* cfg)
RegSetValueExW(hConKey, wszFaceName, 0, REG_SZ, (LPBYTE)&cfg->face_name, sizeof(cfg->face_name));
+ val = cfg->font_pitch_family; + RegSetValueExW(hConKey, wszFontPitchFamily, 0, REG_DWORD, (LPBYTE)&val, sizeof(val)); + width = MulDiv( cfg->cell_width, USER_DEFAULT_SCREEN_DPI, GetDpiForSystem() ); height = MulDiv( cfg->cell_height, USER_DEFAULT_SCREEN_DPI, GetDpiForSystem() ); val = MAKELONG(width, height); diff --git a/programs/wineconsole/winecon_private.h b/programs/wineconsole/winecon_private.h index d556299d62..54d8782a2a 100644 --- a/programs/wineconsole/winecon_private.h +++ b/programs/wineconsole/winecon_private.h @@ -35,6 +35,7 @@ struct config_data { DWORD def_attr; /* default fill attributes (screen colors) */ DWORD popup_attr; /* pop-up color attributes */ WCHAR face_name[32]; /* name of font (size is LF_FACESIZE) */ + DWORD font_pitch_family; DWORD font_weight; DWORD history_size; /* number of commands in history buffer */ DWORD history_nodup; /* TRUE if commands are not stored twice in buffer */ diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c index ebcfce1011..4b65e68939 100644 --- a/programs/wineconsole/wineconsole.c +++ b/programs/wineconsole/wineconsole.c @@ -445,7 +445,8 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf data->curcfg.menu_mask = cfg->menu_mask; data->curcfg.quick_edit = cfg->quick_edit; if (strcmpiW(data->curcfg.face_name, cfg->face_name) || data->curcfg.cell_width != cfg->cell_width || - data->curcfg.cell_height != cfg->cell_height || data->curcfg.font_weight != cfg->font_weight) + data->curcfg.cell_height != cfg->cell_height || data->curcfg.font_pitch_family != cfg->font_pitch_family || + data->curcfg.font_weight != cfg->font_weight) { RECT r; data->fnSetFont(data, cfg->face_name, cfg->cell_height, cfg->font_weight); @@ -459,7 +460,7 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf req->font_width = cfg->cell_width; req->font_height = cfg->cell_height; req->font_weight = cfg->font_weight; - req->font_pitch_family = FIXED_PITCH | FF_DONTCARE; + req->font_pitch_family = cfg->font_pitch_family; wine_server_add_data( req, cfg->face_name, lstrlenW(cfg->face_name) * sizeof(WCHAR) ); wine_server_call( req ); }
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=60519
Your paranoid android.
=== debian10 (32 bit report) ===
kernel32: debugger.c:320: Test failed: GetThreadContext failed: 5