Commit 365e99c0 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

conhost: Use dedicated ioctl for GetConsoleWindow.

parent 3057388f
......@@ -54,12 +54,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(console);
*/
HWND WINAPI GetConsoleWindow(void)
{
struct condrv_input_info info;
condrv_handle_t win;
BOOL ret;
ret = DeviceIoControl( RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle,
IOCTL_CONDRV_GET_INPUT_INFO, NULL, 0, &info, sizeof(info), NULL, NULL );
return ret ? LongToHandle( info.win ) : NULL;
IOCTL_CONDRV_GET_WINDOW, NULL, 0, &win, sizeof(win), NULL, NULL );
return ret ? LongToHandle( win ) : NULL;
}
......
......@@ -42,6 +42,7 @@
#define IOCTL_CONDRV_CTRL_EVENT CTL_CODE(FILE_DEVICE_CONSOLE, 19, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_CONDRV_BEEP CTL_CODE(FILE_DEVICE_CONSOLE, 20, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_CONDRV_FLUSH CTL_CODE(FILE_DEVICE_CONSOLE, 21, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_CONDRV_GET_WINDOW CTL_CODE(FILE_DEVICE_CONSOLE, 22, METHOD_BUFFERED, FILE_ANY_ACCESS)
/* console output ioctls */
#define IOCTL_CONDRV_WRITE_CONSOLE CTL_CODE(FILE_DEVICE_CONSOLE, 30, METHOD_BUFFERED, FILE_WRITE_ACCESS)
......@@ -87,7 +88,6 @@ struct condrv_input_info
unsigned int input_cp; /* console input codepage */
unsigned int output_cp; /* console output codepage */
unsigned int input_count; /* number of available input records */
condrv_handle_t win; /* renderer window handle */
};
/* IOCTL_CONDRV_SET_INPUT_INFO params */
......
......@@ -2519,11 +2519,20 @@ static NTSTATUS console_input_ioctl( struct console *console, unsigned int code,
if (!(info = alloc_ioctl_buffer( sizeof(*info )))) return STATUS_NO_MEMORY;
info->input_cp = console->input_cp;
info->output_cp = console->output_cp;
info->win = condrv_handle( console->win );
info->input_count = console->record_count;
return STATUS_SUCCESS;
}
case IOCTL_CONDRV_GET_WINDOW:
{
condrv_handle_t *result;
TRACE( "get window\n" );
if (in_size || *out_size != sizeof(*result)) return STATUS_INVALID_PARAMETER;
if (!(result = alloc_ioctl_buffer( sizeof(*result )))) return STATUS_NO_MEMORY;
*result = condrv_handle( console->win );
return STATUS_SUCCESS;
}
case IOCTL_CONDRV_SET_INPUT_INFO:
{
const struct condrv_input_info_params *params = in_data;
......
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