Commit ab6056d6 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

kernel32: Use IOCTL_CONDRV_WRITE_CONSOLE in WriteConsoleW when possible.

parent 5ced4a70
......@@ -794,6 +794,13 @@ BOOL WINAPI WriteConsoleW(HANDLE hConsoleOutput, LPCVOID lpBuffer, DWORD nNumber
if (lpNumberOfCharsWritten) *lpNumberOfCharsWritten = 0;
if (DeviceIoControl(hConsoleOutput, IOCTL_CONDRV_WRITE_CONSOLE, (void *)lpBuffer,
nNumberOfCharsToWrite * sizeof(WCHAR), NULL, 0, NULL, NULL))
{
if (lpNumberOfCharsWritten) *lpNumberOfCharsWritten = nNumberOfCharsToWrite;
return TRUE;
}
if ((fd = get_console_bare_fd(hConsoleOutput)) != -1)
{
char* ptr;
......
......@@ -2106,8 +2106,13 @@ static int screen_buffer_ioctl( struct fd *fd, ioctl_code_t code, struct async *
}
default:
set_error( STATUS_INVALID_HANDLE );
return 0;
if (!screen_buffer->input || !screen_buffer->input->server || code >> 16 != FILE_DEVICE_CONSOLE)
{
set_error( STATUS_INVALID_HANDLE );
return 0;
}
return queue_host_ioctl( screen_buffer->input->server, code, screen_buffer->id,
async, &screen_buffer->ioctl_q );
}
}
......
......@@ -128,6 +128,7 @@ static void dump_ioctl_code( const char *prefix, const ioctl_code_t *code )
CASE(IOCTL_CONDRV_READ_OUTPUT);
CASE(IOCTL_CONDRV_SET_MODE);
CASE(IOCTL_CONDRV_SET_OUTPUT_INFO);
CASE(IOCTL_CONDRV_WRITE_CONSOLE);
CASE(IOCTL_CONDRV_WRITE_INPUT);
CASE(IOCTL_CONDRV_WRITE_OUTPUT);
CASE(FSCTL_DISMOUNT_VOLUME);
......
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