kernelbase: Use IOCTL_CONDRV_GET_OUTPUT_INFO in GetConsoleCursorInfo.

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-09 19:28:48 +02:00 committed by Alexandre Julliard
parent d25a267978
commit 547855e623
1 changed files with 7 additions and 11 deletions

View File

@ -541,26 +541,22 @@ UINT WINAPI DECLSPEC_HOTPATCH GetConsoleCP(void)
*/ */
BOOL WINAPI DECLSPEC_HOTPATCH GetConsoleCursorInfo( HANDLE handle, CONSOLE_CURSOR_INFO *info ) BOOL WINAPI DECLSPEC_HOTPATCH GetConsoleCursorInfo( HANDLE handle, CONSOLE_CURSOR_INFO *info )
{ {
BOOL ret; struct condrv_output_info condrv_info;
SERVER_START_REQ( get_console_output_info ) if (!DeviceIoControl( handle, IOCTL_CONDRV_GET_OUTPUT_INFO, NULL, 0, &condrv_info, sizeof(condrv_info), NULL, NULL ))
{ {
req->handle = console_handle_unmap( handle ); SetLastError( ERROR_INVALID_HANDLE );
ret = !wine_server_call_err( req ); return FALSE;
if (ret && info)
{
info->dwSize = reply->cursor_size;
info->bVisible = reply->cursor_visible;
} }
}
SERVER_END_REQ;
if (!ret) return FALSE;
if (!info) if (!info)
{ {
SetLastError( ERROR_INVALID_ACCESS ); SetLastError( ERROR_INVALID_ACCESS );
return FALSE; return FALSE;
} }
info->dwSize = condrv_info.cursor_size;
info->bVisible = condrv_info.cursor_visible;
TRACE("(%p) returning (%d,%d)\n", handle, info->dwSize, info->bVisible); TRACE("(%p) returning (%d,%d)\n", handle, info->dwSize, info->bVisible);
return TRUE; return TRUE;
} }