wineconsole: Use renderer handle instead of hConIn where possible.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2020-07-30 17:15:08 +02:00 committed by Alexandre Julliard
parent b45c04f4c3
commit 78831ae9d0
3 changed files with 15 additions and 15 deletions

View File

@ -339,7 +339,7 @@ static void WCCURSES_SetTitle(const struct inner_data* data)
{
WCHAR wbuf[256];
if (WINECON_GetConsoleTitle(data->hConIn, wbuf, ARRAY_SIZE(wbuf)))
if (WINECON_GetConsoleTitle(data->console, wbuf, ARRAY_SIZE(wbuf)))
{
char buffer[256];
@ -965,7 +965,7 @@ static DWORD CALLBACK input_thread( void *arg )
else
numEvent = WCCURSES_FillSimpleChar(ir, inchar);
if (numEvent) WriteConsoleInputW(data->hConIn, ir, numEvent, &n);
if (numEvent) WriteConsoleInputW(data->console, ir, numEvent, &n);
}
LeaveCriticalSection(&PRIVATE(data)->lock);
}

View File

@ -267,7 +267,7 @@ static void WCUSER_SetTitle(const struct inner_data* data)
{
WCHAR buffer[256];
if (WINECON_GetConsoleTitle(data->hConIn, buffer, sizeof(buffer)))
if (WINECON_GetConsoleTitle(data->console, buffer, sizeof(buffer)))
SetWindowTextW(data->hWnd, buffer);
}
@ -738,7 +738,7 @@ static void WCUSER_PasteFromClipboard(struct inner_data* data)
ir[1] = ir[0];
ir[1].Event.KeyEvent.bKeyDown = FALSE;
WriteConsoleInputW(data->hConIn, ir, 2, &n);
WriteConsoleInputW(data->console, ir, 2, &n);
}
GlobalUnlock(h);
}
@ -1052,7 +1052,7 @@ static void WCUSER_GenerateKeyInputRecord(struct inner_data* data, BOOL down,
ir.Event.KeyEvent.uChar.UnicodeChar = last; /* FIXME: HACKY... and buggy because it should be a stack, not a single value */
if (!down) last = 0;
WriteConsoleInputW(data->hConIn, &ir, 1, &n);
WriteConsoleInputW(data->console, &ir, 1, &n);
}
/******************************************************************
@ -1068,7 +1068,7 @@ static void WCUSER_GenerateMouseInputRecord(struct inner_data* data, COORD c,
DWORD mode, n;
/* MOUSE_EVENTs shouldn't be sent unless ENABLE_MOUSE_INPUT is active */
if (!GetConsoleMode(data->hConIn, &mode) || !(mode & ENABLE_MOUSE_INPUT))
if (!GetConsoleMode(data->console, &mode) || !(mode & ENABLE_MOUSE_INPUT))
return;
ir.EventType = MOUSE_EVENT;
@ -1083,7 +1083,7 @@ static void WCUSER_GenerateMouseInputRecord(struct inner_data* data, COORD c,
ir.Event.MouseEvent.dwControlKeyState = WCUSER_GetCtrlKeyState(keyState);
ir.Event.MouseEvent.dwEventFlags = event;
WriteConsoleInputW(data->hConIn, &ir, 1, &n);
WriteConsoleInputW(data->console, &ir, 1, &n);
}
/******************************************************************

View File

@ -374,17 +374,17 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf
if (data->curcfg.history_size != cfg->history_size)
{
data->curcfg.history_size = cfg->history_size;
WINECON_SetHistorySize(data->hConIn, cfg->history_size);
WINECON_SetHistorySize(data->console, cfg->history_size);
}
if (data->curcfg.history_nodup != cfg->history_nodup)
{
data->curcfg.history_nodup = cfg->history_nodup;
WINECON_SetHistoryMode(data->hConIn, cfg->history_nodup);
WINECON_SetHistoryMode(data->console, cfg->history_nodup);
}
if (data->curcfg.insert_mode != cfg->insert_mode)
{
data->curcfg.insert_mode = cfg->insert_mode;
WINECON_SetInsertMode(data->hConIn, cfg->insert_mode);
WINECON_SetInsertMode(data->console, cfg->insert_mode);
}
data->curcfg.menu_mask = cfg->menu_mask;
data->curcfg.quick_edit = cfg->quick_edit;
@ -511,7 +511,7 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf
if (data->curcfg.edition_mode != cfg->edition_mode)
{
data->curcfg.edition_mode = cfg->edition_mode;
WINECON_SetEditionMode(data->hConIn, cfg->edition_mode);
WINECON_SetEditionMode(data->console, cfg->edition_mode);
}
/* we now need to gather all events we got from the operations above,
* in order to get data correctly updated
@ -553,14 +553,14 @@ static BOOL WINECON_GetServerConfig(struct inner_data* data)
struct condrv_output_info output_info;
DWORD mode;
if (!DeviceIoControl(data->hConIn, IOCTL_CONDRV_GET_INPUT_INFO, NULL, 0,
if (!DeviceIoControl(data->console, IOCTL_CONDRV_GET_INPUT_INFO, NULL, 0,
&input_info, sizeof(input_info), NULL, NULL))
return FALSE;
data->curcfg.history_size = input_info.history_size;
data->curcfg.history_nodup = input_info.history_mode;
data->curcfg.edition_mode = input_info.edition_mode;
GetConsoleMode(data->hConIn, &mode);
GetConsoleMode(data->console, &mode);
data->curcfg.insert_mode = (mode & (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS)) ==
(ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS);
@ -700,11 +700,11 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna
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),
ret = DeviceIoControl(data->console, IOCTL_CONDRV_SET_INPUT_INFO, &input_params, sizeof(input_params),
NULL, 0, NULL, NULL);
if (!ret) goto error;
ret = DeviceIoControl(data->hConIn, IOCTL_CONDRV_SET_TITLE, (void *)appname,
ret = DeviceIoControl(data->console, IOCTL_CONDRV_SET_TITLE, (void *)appname,
lstrlenW(appname) * sizeof(WCHAR), NULL, 0, NULL, NULL);
if (!ret) goto error;