Commit 300a01f4 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

kernelbase: Use IOCTL_CONDRV_READ_OUTPUT in ReadConsoleOutputCharacterW.

parent 44052219
...@@ -99,6 +99,7 @@ static BOOL console_ioctl( HANDLE handle, DWORD code, void *in_buff, DWORD in_co ...@@ -99,6 +99,7 @@ static BOOL console_ioctl( HANDLE handle, DWORD code, void *in_buff, DWORD in_co
status = STATUS_INVALID_HANDLE; status = STATUS_INVALID_HANDLE;
break; break;
} }
if (read) *read = 0;
return set_ntstatus( status ); return set_ntstatus( status );
} }
...@@ -849,6 +850,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputCharacterA( HANDLE handle, LPSTR ...@@ -849,6 +850,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputCharacterA( HANDLE handle, LPSTR
BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputCharacterW( HANDLE handle, LPWSTR buffer, DWORD length, BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputCharacterW( HANDLE handle, LPWSTR buffer, DWORD length,
COORD coord, DWORD *count ) COORD coord, DWORD *count )
{ {
struct condrv_output_params params;
BOOL ret; BOOL ret;
TRACE( "(%p,%p,%d,%dx%d,%p)\n", handle, buffer, length, coord.X, coord.Y, count ); TRACE( "(%p,%p,%d,%dx%d,%p)\n", handle, buffer, length, coord.X, coord.Y, count );
...@@ -859,18 +861,13 @@ BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputCharacterW( HANDLE handle, LPWSTR ...@@ -859,18 +861,13 @@ BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputCharacterW( HANDLE handle, LPWSTR
return FALSE; return FALSE;
} }
*count = 0; params.mode = CHAR_INFO_MODE_TEXT;
SERVER_START_REQ( read_console_output ) params.x = coord.X;
{ params.y = coord.Y;
req->handle = console_handle_unmap( handle ); params.width = 0;
req->x = coord.X; ret = console_ioctl( handle, IOCTL_CONDRV_READ_OUTPUT, &params, sizeof(params), buffer,
req->y = coord.Y; length * sizeof(*buffer), count );
req->mode = CHAR_INFO_MODE_TEXT; *count /= sizeof(*buffer);
req->wrap = TRUE;
wine_server_set_reply( req, buffer, length * sizeof(WCHAR) );
if ((ret = !wine_server_call_err( req ))) *count = wine_server_reply_size(reply) / sizeof(WCHAR);
}
SERVER_END_REQ;
return ret; return ret;
} }
......
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