kernel32: Use IOCTL_CONDRV_READ_CONSOLE in ReadConsoleW when possible.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0cdb070b76
commit
666c5b6e20
|
@ -541,6 +541,13 @@ BOOL WINAPI ReadConsoleW(HANDLE hConsoleInput, LPVOID lpBuffer,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (DeviceIoControl(hConsoleInput, IOCTL_CONDRV_READ_CONSOLE, NULL, 0, lpBuffer,
|
||||||
|
nNumberOfCharsToRead * sizeof(WCHAR), lpNumberOfCharsRead, NULL))
|
||||||
|
{
|
||||||
|
*lpNumberOfCharsRead /= sizeof(WCHAR);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (!GetConsoleMode(hConsoleInput, &mode))
|
if (!GetConsoleMode(hConsoleInput, &mode))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if ((fd = get_console_bare_fd(hConsoleInput)) != -1)
|
if ((fd = get_console_bare_fd(hConsoleInput)) != -1)
|
||||||
|
|
|
@ -1693,7 +1693,7 @@ static struct object *create_console_server( void )
|
||||||
|
|
||||||
static int is_blocking_read_ioctl( unsigned int code )
|
static int is_blocking_read_ioctl( unsigned int code )
|
||||||
{
|
{
|
||||||
return code == IOCTL_CONDRV_READ_INPUT;
|
return code == IOCTL_CONDRV_READ_INPUT || code == IOCTL_CONDRV_READ_CONSOLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int console_input_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
|
static int console_input_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
|
||||||
|
@ -1898,8 +1898,12 @@ static int console_input_ioctl( struct fd *fd, ioctl_code_t code, struct async *
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
set_error( STATUS_INVALID_HANDLE );
|
if (!console->server || code >> 16 != FILE_DEVICE_CONSOLE)
|
||||||
return 0;
|
{
|
||||||
|
set_error( STATUS_INVALID_HANDLE );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return queue_host_ioctl( console->server, code, 0, async, &console->ioctl_q );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue