Signed-off-by: Gijs Vermeulen gijsvrm@codeweavers.com --- programs/wineconsole/wineconsole.c | 4 ++++ server/console.c | 14 ++++++++++++++ server/protocol.def | 4 ++++ 3 files changed, 22 insertions(+)
diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c index 439099c37a..98bd32fda8 100644 --- a/programs/wineconsole/wineconsole.c +++ b/programs/wineconsole/wineconsole.c @@ -458,6 +458,10 @@ 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; + req->face_namelen = lstrlenW(cfg->face_name) * sizeof(WCHAR); + wine_server_add_data( req, cfg->face_name, req->face_namelen ); wine_server_call( req ); } SERVER_END_REQ; diff --git a/server/console.c b/server/console.c index 7d1fc5d268..e93dec2501 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; + WCHAR *face_name; };
struct screen_buffer @@ -433,6 +436,9 @@ 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 = 400; + screen_buffer->font.pitch_family = 1; + screen_buffer->font.face_name = NULL; memset( screen_buffer->color_map, 0, sizeof(screen_buffer->color_map) ); list_add_head( &screen_buffer_list, &screen_buffer->entry );
@@ -1041,8 +1047,16 @@ static int set_console_output_info( struct screen_buffer *screen_buffer, } if (req->mask & SET_CONSOLE_OUTPUT_INFO_FONT) { + data_size_t total; screen_buffer->font.width = req->font_width; screen_buffer->font.height = req->font_height; + screen_buffer->font.weight = req->font_weight; + screen_buffer->font.pitch_family = req->font_pitch_family; + if (screen_buffer->font.face_name) free(screen_buffer->font.face_name); + total = min( req->face_namelen, get_req_data_size() ); + screen_buffer->font.face_name = mem_alloc( total + sizeof(WCHAR) ); + memcpy( screen_buffer->font.face_name, get_req_data(), total ); + screen_buffer->font.face_name[total/sizeof(WCHAR)] = 0; } if (req->mask & SET_CONSOLE_OUTPUT_INFO_COLORTABLE) { diff --git a/server/protocol.def b/server/protocol.def index 6af0ae0cff..6030a0152c 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1634,6 +1634,10 @@ struct console_renderer_event short int max_height; short int font_width; /* font size (width x height) */ short int font_height; + short int font_weight; /* font weight */ + short int font_pitch_family; /* font pitch & family */ + data_size_t face_namelen; /* length of face name in bytes */ + VARARG(face_name,unicode_str,face_namelen); /* font face name */ VARARG(colors,uints); /* color table */ @END #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x0001
Signed-off-by: Gijs Vermeulen gijsvrm@codeweavers.com --- server/console.c | 14 ++++++++++++-- server/protocol.def | 4 ++++ 2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/server/console.c b/server/console.c index e93dec2501..4500e23e13 100644 --- a/server/console.c +++ b/server/console.c @@ -1745,6 +1745,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))) @@ -1765,8 +1767,16 @@ 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; + reply->face_namelen = screen_buffer->font.face_name ? strlenW( screen_buffer->font.face_name ) * sizeof(WCHAR) : 0; + total = min( reply->face_namelen + sizeof(screen_buffer->color_map), get_reply_max_size() ); + if (total) + { + data = set_reply_data_size( total ); + if (screen_buffer->font.face_name) memcpy( data, screen_buffer->font.face_name, reply->face_namelen ); + memcpy( (char *)data + reply->face_namelen, screen_buffer->color_map, total - reply->face_namelen ); + } release_object( screen_buffer ); } } diff --git a/server/protocol.def b/server/protocol.def index 6030a0152c..1f64395284 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1671,6 +1671,10 @@ struct console_renderer_event short int max_height; short int font_width; /* font size (width x height) */ short int font_height; + short int font_weight; /* font weight */ + short int font_pitch_family; /* font pitch & family */ + data_size_t face_namelen; /* length of face name in bytes */ + VARARG(face_name,unicode_str,face_namelen); /* font face name */ VARARG(colors,uints); /* color table */ @END
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=56227
Your paranoid android.
=== debian10 (build log) ===
Task errors: Unable to set the VM system time: Timed out in tunnel_connect while connecting to testnet.winehq.org:22004:10.42.42.146:4243. Maybe the TestAgentd process is missing the required privileges.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47620 Signed-off-by: Gijs Vermeulen gijsvrm@codeweavers.com --- dlls/kernel32/console.c | 31 +++++++++++++++++++++++++++++-- dlls/kernel32/kernel32.spec | 2 +- 2 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c index f99b1dba49..0566430aa7 100644 --- a/dlls/kernel32/console.c +++ b/dlls/kernel32/console.c @@ -3290,17 +3290,23 @@ 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;
- memset(fontinfo, 0, sizeof(CONSOLE_FONT_INFO)); + if (fontinfo->cbSize != sizeof(CONSOLE_FONT_INFOEX)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + }
SERVER_START_REQ(get_console_output_info) { req->handle = console_handle_unmap(hConsole); + wine_server_set_reply(req, fontinfo->FaceName, sizeof(fontinfo->FaceName) - sizeof(WCHAR)); if ((ret = !wine_server_call_err(req))) { + fontinfo->nFont = 0; if (maxwindow) { fontinfo->dwFontSize.X = min(reply->width, reply->max_width); @@ -3311,12 +3317,33 @@ 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; } + + fontinfo->FontFamily = reply->font_pitch_family; + fontinfo->FontWeight = reply->font_weight; + fontinfo->FaceName[ARRAY_SIZE(fontinfo->FaceName) - 1] = 0; } } SERVER_END_REQ; 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; +} + static COORD get_console_font_size(HANDLE hConsole, DWORD index) { COORD c = {0,0}; diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index b562c748c7..5f26806c62 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 GetCurrentDirectoryA(long ptr) @ stdcall GetCurrentDirectoryW(long ptr) @ stdcall GetCurrentPackageFamilyName(ptr ptr)
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=56228
Your paranoid android.
=== debian10 (32 bit report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00439c82).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (32 bit Chinese:China report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00439c82).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (build log) ===
Task errors: DBI connect('winetestbot','winetestbot',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /home/testbot/lib/ObjectModel/DBIBackEnd.pm line 54.
DBI connect('winetestbot','winetestbot',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /home/testbot/lib/ObjectModel/DBIBackEnd.pm line 54.
=== debian10 (32 bit WoW report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00439c82).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (64 bit WoW report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00439c82).
Report errors: kernel32:virtual prints too much data (91050 bytes)
I can reproduce this locally and debian10 has no issues on a manual run: https://testbot.winehq.org/JobDetails.pl?Key=56235
Op wo 4 sep. 2019 om 16:11 schreef Marvin testbot@winehq.org:
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=56228
Your paranoid android.
=== debian10 (32 bit report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00439c82).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (32 bit Chinese:China report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00439c82).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (build log) ===
Task errors: DBI connect('winetestbot','winetestbot',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /home/testbot/lib/ObjectModel/DBIBackEnd.pm line 54.
DBI connect('winetestbot','winetestbot',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /home/testbot/lib/ObjectModel/DBIBackEnd.pm line 54.
=== debian10 (32 bit WoW report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00439c82).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (64 bit WoW report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00439c82).
Report errors: kernel32:virtual prints too much data (91050 bytes)
Op wo 4 sep. 2019 om 18:24 schreef Gijs Vermeulen gijsvrm@gmail.com:
I can reproduce this locally and debian10 has no issues on a manual run: https://testbot.winehq.org/JobDetails.pl?Key=56235
I meant can't, of course.
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 acd61d078b..85dc9e42c2 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -2695,6 +2695,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; @@ -3279,6 +3377,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=56229
Your paranoid android.
=== debian10 (32 bit report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x0043a592).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (32 bit Chinese:China report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x0043a592).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (32 bit WoW report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x0043a592).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (64 bit WoW report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x0043a592).
Report errors: kernel32:virtual prints too much data (91050 bytes)
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 98bd32fda8..07df0618f0 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; req->face_namelen = lstrlenW(cfg->face_name) * sizeof(WCHAR); wine_server_add_data( req, cfg->face_name, req->face_namelen ); 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=56230
Your paranoid android.
=== debian10 (32 bit report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x0043a592).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (32 bit Chinese:China report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x0043a592).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (32 bit WoW report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x0043a592).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (64 bit WoW report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x0043a592).
Report errors: kernel32:virtual prints too much data (91050 bytes)
Gijs Vermeulen gijsvrm@codeweavers.com writes:
@@ -1041,8 +1047,16 @@ static int set_console_output_info( struct screen_buffer *screen_buffer, } if (req->mask & SET_CONSOLE_OUTPUT_INFO_FONT) {
data_size_t total; screen_buffer->font.width = req->font_width; screen_buffer->font.height = req->font_height;
screen_buffer->font.weight = req->font_weight;
screen_buffer->font.pitch_family = req->font_pitch_family;
if (screen_buffer->font.face_name) free(screen_buffer->font.face_name);
total = min( req->face_namelen, get_req_data_size() );
screen_buffer->font.face_name = mem_alloc( total + sizeof(WCHAR) );
memcpy( screen_buffer->font.face_name, get_req_data(), total );
screen_buffer->font.face_name[total/sizeof(WCHAR)] = 0;
You should probably store it as a unicode_str. I suspect you also want to put it after the color table in the request data. Either way you need to handle the case when both are present.