Eric Pouech wrote:
to exchange information between wineconsole and kernel is not the right thing to do the correct way is to:
- enhance the wine server protocol to grab max win size in kernel32
from wine server
I've been able to achieve this.
/*********************************************************************** * GetLargestConsoleWindowSize_helper */ COORD GetLargestConsoleWindowSize_helper(HANDLE hConsoleOutput) { int screen_width = 0, screen_height = 0; COORD fontsize, max_console;
SERVER_START_REQ( get_desktop_workarea ) { if(!wine_server_call_err( req )) { screen_width = reply->screen_x; screen_height = reply->screen_y; } } SERVER_END_REQ;
fontsize = GetConsoleFontSize(hConsoleOutput, 0);
max_console.X = (screen_width / fontsize.X) - 6; max_console.Y = (screen_height / fontsize.Y) - 5;
if (max_console.X < 0 || max_console.Y < 0) { max_console.X = 80; max_console.Y = 25; } return max_console; }
- enhance wineconsole to set the max wine size into wine server
I'm not really sure how to do this. I thought this code might work in programs/wineconsole/wineconsole.c:
RECT workarea; /* Send desktop workarea to server */ SystemParametersInfoA(SPI_GETWORKAREA, 0, &workarea, 0);
SERVER_START_REQ( get_desktop_workarea ) { if(!wine_server_call_err( req )) { req->spi_workarea = workarea; } } SERVER_END_REQ;
Unfortunately, while Wine compiles perfectly with the other changes to the server (see attached files), no proper values are returned (only zero). By setting hardcoded constants in server/window.c, I have tested GetLargestConsoleWindowSize, where all functions work as expected.
Any advice on sending data to the server would be appreciated.