Commit 78831ae9 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wineconsole: Use renderer handle instead of hConIn where possible.

parent b45c04f4
...@@ -339,7 +339,7 @@ static void WCCURSES_SetTitle(const struct inner_data* data) ...@@ -339,7 +339,7 @@ static void WCCURSES_SetTitle(const struct inner_data* data)
{ {
WCHAR wbuf[256]; WCHAR wbuf[256];
if (WINECON_GetConsoleTitle(data->hConIn, wbuf, ARRAY_SIZE(wbuf))) if (WINECON_GetConsoleTitle(data->console, wbuf, ARRAY_SIZE(wbuf)))
{ {
char buffer[256]; char buffer[256];
...@@ -965,7 +965,7 @@ static DWORD CALLBACK input_thread( void *arg ) ...@@ -965,7 +965,7 @@ static DWORD CALLBACK input_thread( void *arg )
else else
numEvent = WCCURSES_FillSimpleChar(ir, inchar); 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); LeaveCriticalSection(&PRIVATE(data)->lock);
} }
......
...@@ -267,7 +267,7 @@ static void WCUSER_SetTitle(const struct inner_data* data) ...@@ -267,7 +267,7 @@ static void WCUSER_SetTitle(const struct inner_data* data)
{ {
WCHAR buffer[256]; WCHAR buffer[256];
if (WINECON_GetConsoleTitle(data->hConIn, buffer, sizeof(buffer))) if (WINECON_GetConsoleTitle(data->console, buffer, sizeof(buffer)))
SetWindowTextW(data->hWnd, buffer); SetWindowTextW(data->hWnd, buffer);
} }
...@@ -738,7 +738,7 @@ static void WCUSER_PasteFromClipboard(struct inner_data* data) ...@@ -738,7 +738,7 @@ static void WCUSER_PasteFromClipboard(struct inner_data* data)
ir[1] = ir[0]; ir[1] = ir[0];
ir[1].Event.KeyEvent.bKeyDown = FALSE; ir[1].Event.KeyEvent.bKeyDown = FALSE;
WriteConsoleInputW(data->hConIn, ir, 2, &n); WriteConsoleInputW(data->console, ir, 2, &n);
} }
GlobalUnlock(h); GlobalUnlock(h);
} }
...@@ -1052,7 +1052,7 @@ static void WCUSER_GenerateKeyInputRecord(struct inner_data* data, BOOL down, ...@@ -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 */ ir.Event.KeyEvent.uChar.UnicodeChar = last; /* FIXME: HACKY... and buggy because it should be a stack, not a single value */
if (!down) last = 0; 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, ...@@ -1068,7 +1068,7 @@ static void WCUSER_GenerateMouseInputRecord(struct inner_data* data, COORD c,
DWORD mode, n; DWORD mode, n;
/* MOUSE_EVENTs shouldn't be sent unless ENABLE_MOUSE_INPUT is active */ /* 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; return;
ir.EventType = MOUSE_EVENT; ir.EventType = MOUSE_EVENT;
...@@ -1083,7 +1083,7 @@ static void WCUSER_GenerateMouseInputRecord(struct inner_data* data, COORD c, ...@@ -1083,7 +1083,7 @@ static void WCUSER_GenerateMouseInputRecord(struct inner_data* data, COORD c,
ir.Event.MouseEvent.dwControlKeyState = WCUSER_GetCtrlKeyState(keyState); ir.Event.MouseEvent.dwControlKeyState = WCUSER_GetCtrlKeyState(keyState);
ir.Event.MouseEvent.dwEventFlags = event; ir.Event.MouseEvent.dwEventFlags = event;
WriteConsoleInputW(data->hConIn, &ir, 1, &n); WriteConsoleInputW(data->console, &ir, 1, &n);
} }
/****************************************************************** /******************************************************************
......
...@@ -374,17 +374,17 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf ...@@ -374,17 +374,17 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf
if (data->curcfg.history_size != cfg->history_size) if (data->curcfg.history_size != cfg->history_size)
{ {
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) if (data->curcfg.history_nodup != cfg->history_nodup)
{ {
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) if (data->curcfg.insert_mode != cfg->insert_mode)
{ {
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.menu_mask = cfg->menu_mask;
data->curcfg.quick_edit = cfg->quick_edit; data->curcfg.quick_edit = cfg->quick_edit;
...@@ -511,7 +511,7 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf ...@@ -511,7 +511,7 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf
if (data->curcfg.edition_mode != cfg->edition_mode) if (data->curcfg.edition_mode != cfg->edition_mode)
{ {
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, /* we now need to gather all events we got from the operations above,
* in order to get data correctly updated * in order to get data correctly updated
...@@ -553,14 +553,14 @@ static BOOL WINECON_GetServerConfig(struct inner_data* data) ...@@ -553,14 +553,14 @@ static BOOL WINECON_GetServerConfig(struct inner_data* data)
struct condrv_output_info output_info; struct condrv_output_info output_info;
DWORD mode; 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)) &input_info, sizeof(input_info), NULL, NULL))
return FALSE; return FALSE;
data->curcfg.history_size = input_info.history_size; data->curcfg.history_size = input_info.history_size;
data->curcfg.history_nodup = input_info.history_mode; data->curcfg.history_nodup = input_info.history_mode;
data->curcfg.edition_mode = input_info.edition_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)) == data->curcfg.insert_mode = (mode & (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS)) ==
(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 ...@@ -700,11 +700,11 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna
memset(&input_params, 0, sizeof(input_params)); memset(&input_params, 0, sizeof(input_params));
input_params.mask = SET_CONSOLE_INPUT_INFO_WIN; input_params.mask = SET_CONSOLE_INPUT_INFO_WIN;
input_params.info.win = condrv_handle(data->hWnd); 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); NULL, 0, NULL, NULL);
if (!ret) goto error; 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); lstrlenW(appname) * sizeof(WCHAR), NULL, 0, NULL, NULL);
if (!ret) goto error; if (!ret) goto error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment