Jacek Caban : wineconsole: Use renderer handle instead of hConIn where possible.
Alexandre Julliard
julliard at winehq.org
Thu Jul 30 15:31:25 CDT 2020
Module: wine
Branch: master
Commit: 78831ae9d044ffb824e72cb8952f3eb25140c7c9
URL: https://source.winehq.org/git/wine.git/?a=commit;h=78831ae9d044ffb824e72cb8952f3eb25140c7c9
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Jul 30 17:15:08 2020 +0200
wineconsole: Use renderer handle instead of hConIn where possible.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
programs/wineconsole/curses.c | 4 ++--
programs/wineconsole/user.c | 10 +++++-----
programs/wineconsole/wineconsole.c | 16 ++++++++--------
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/programs/wineconsole/curses.c b/programs/wineconsole/curses.c
index 3f56bdb0ca..3ddd22387f 100644
--- a/programs/wineconsole/curses.c
+++ b/programs/wineconsole/curses.c
@@ -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);
}
diff --git a/programs/wineconsole/user.c b/programs/wineconsole/user.c
index 4476845154..bbaffd3c2a 100644
--- a/programs/wineconsole/user.c
+++ b/programs/wineconsole/user.c
@@ -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);
}
/******************************************************************
diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c
index a61aad5293..8752ec6b13 100644
--- a/programs/wineconsole/wineconsole.c
+++ b/programs/wineconsole/wineconsole.c
@@ -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;
More information about the wine-cvs
mailing list