Module: wine Branch: master Commit: 2fc11e8952bff715115425346d0ccbaed146bcd5 URL: https://source.winehq.org/git/wine.git/?a=commit;h=2fc11e8952bff715115425346...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Jul 20 15:38:50 2020 +0200
wineconsole: Use IOCTL_CONDRV_SET_INPUT_INFO to set console window handle.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
programs/wineconsole/wineconsole.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c index 1fad63d72c..eaf67f8875 100644 --- a/programs/wineconsole/wineconsole.c +++ b/programs/wineconsole/wineconsole.c @@ -613,6 +613,7 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna enum init_return (*backend)(struct inner_data*), INT nCmdShow) { + struct condrv_input_info_params input_params; OBJECT_ATTRIBUTES attr = {sizeof(attr)}; struct inner_data* data = NULL; DWORD ret; @@ -719,12 +720,18 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna WINECON_SetConfig(data, &cfg); data->curcfg.registry = cfg.registry; WINECON_DumpConfig("fint", &data->curcfg); + + memset(&input_params, 0, sizeof(input_params)); + input_params.mask = SET_CONSOLE_INPUT_INFO_WIN; + input_params.info.win = condrv_handle(data->hWnd); + ret = DeviceIoControl(data->hConIn, IOCTL_CONDRV_SET_INPUT_INFO, &input_params, sizeof(input_params), + NULL, 0, NULL, NULL); + if (!ret) goto error; + SERVER_START_REQ( set_console_input_info ) { req->handle = wine_server_obj_handle( data->hConIn ); - req->win = wine_server_user_handle( data->hWnd ); - req->mask = SET_CONSOLE_INPUT_INFO_TITLE | - SET_CONSOLE_INPUT_INFO_WIN; + req->mask = SET_CONSOLE_INPUT_INFO_TITLE; wine_server_add_data( req, appname, lstrlenW(appname) * sizeof(WCHAR) ); ret = !wine_server_call_err( req ); }