wineconsole: Use IOCTL_CONDRV_GET_INPUT_INFO in WINECON_GetServerConfig.

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-07 16:07:02 +02:00 committed by Alexandre Julliard
parent 33190b694f
commit eff42369e9
3 changed files with 15 additions and 11 deletions

View File

@ -31,6 +31,9 @@
/* IOCTL_CONDRV_GET_INPUT_INFO result */
struct condrv_input_info
{
unsigned int history_mode; /* whether we duplicate lines in history */
unsigned int history_size; /* number of lines in history */
unsigned int edition_mode; /* index to the edition mode flavors */
unsigned int input_count; /* number of available input records */
};

View File

@ -27,6 +27,7 @@
#include "winecon_private.h"
#include "winnls.h"
#include "winuser.h"
#include "wine/condrv.h"
#include "wine/unicode.h"
#include "wine/debug.h"
@ -603,19 +604,16 @@ static void WINECON_Delete(struct inner_data* data)
*/
static BOOL WINECON_GetServerConfig(struct inner_data* data)
{
struct condrv_input_info input_info;
BOOL ret;
DWORD mode;
SERVER_START_REQ(get_console_input_info)
{
req->handle = wine_server_obj_handle( data->hConIn );
ret = !wine_server_call_err( req );
data->curcfg.history_size = reply->history_size;
data->curcfg.history_nodup = reply->history_mode;
data->curcfg.edition_mode = reply->edition_mode;
}
SERVER_END_REQ;
if (!ret) return FALSE;
if (!DeviceIoControl(data->hConIn, 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);
data->curcfg.insert_mode = (mode & (ENABLE_INSERT_MODE|ENABLE_EXTENDED_FLAGS)) ==

View File

@ -1554,7 +1554,10 @@ static int console_ioctl( struct fd *fd, ioctl_code_t code, struct async *async
set_error( STATUS_INVALID_PARAMETER );
return 0;
}
info.input_count = console->recnum;
info.history_mode = console->history_mode;
info.history_size = console->history_size;
info.edition_mode = console->edition_mode;
info.input_count = console->recnum;
return set_reply_data( &info, sizeof(info) ) != NULL;
}