kernelbase: Use IOCTL_CONDRV_CTRL_EVENT in GenerateConsoleCtrlEvent.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2020-09-01 15:36:05 +02:00 committed by Alexandre Julliard
parent f9c8993259
commit 82e8fd97f6
7 changed files with 10 additions and 61 deletions

View File

@ -3670,6 +3670,10 @@ static void test_FreeConsole(void)
ok(!hwnd, "hwnd = %p\n", hwnd); ok(!hwnd, "hwnd = %p\n", hwnd);
ok(GetLastError() == ERROR_INVALID_HANDLE, "last error %u\n", GetLastError()); ok(GetLastError() == ERROR_INVALID_HANDLE, "last error %u\n", GetLastError());
ret = GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0);
ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "GenerateConsoleCtrlEvent returned %x(%u)\n",
ret, GetLastError());
SetStdHandle( STD_INPUT_HANDLE, (HANDLE)0xdeadbeef ); SetStdHandle( STD_INPUT_HANDLE, (HANDLE)0xdeadbeef );
handle = GetConsoleInputWaitHandle(); handle = GetConsoleInputWaitHandle();
ok(handle == (HANDLE)0xdeadbeef, "GetConsoleInputWaitHandle returned %p\n", handle); ok(handle == (HANDLE)0xdeadbeef, "GetConsoleInputWaitHandle returned %p\n", handle);

View File

@ -593,7 +593,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH FreeConsole(void)
*/ */
BOOL WINAPI DECLSPEC_HOTPATCH GenerateConsoleCtrlEvent( DWORD event, DWORD group ) BOOL WINAPI DECLSPEC_HOTPATCH GenerateConsoleCtrlEvent( DWORD event, DWORD group )
{ {
BOOL ret; struct condrv_ctrl_event ctrl_event;
TRACE( "(%d, %x)\n", event, group ); TRACE( "(%d, %x)\n", event, group );
@ -603,14 +603,10 @@ BOOL WINAPI DECLSPEC_HOTPATCH GenerateConsoleCtrlEvent( DWORD event, DWORD group
return FALSE; return FALSE;
} }
SERVER_START_REQ( send_console_signal ) ctrl_event.event = event;
{ ctrl_event.group_id = group;
req->signal = event; return console_ioctl( RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle,
req->group_id = group; IOCTL_CONDRV_CTRL_EVENT, &ctrl_event, sizeof(ctrl_event), NULL, 0, NULL );
ret = !wine_server_call_err( req );
}
SERVER_END_REQ;
return ret;
} }

View File

@ -1924,20 +1924,6 @@ struct create_console_output_reply
struct send_console_signal_request
{
struct request_header __header;
int signal;
process_id_t group_id;
char __pad_20[4];
};
struct send_console_signal_reply
{
struct reply_header __header;
};
struct get_next_console_request_request struct get_next_console_request_request
{ {
struct request_header __header; struct request_header __header;
@ -5541,7 +5527,6 @@ enum request
REQ_append_console_input_history, REQ_append_console_input_history,
REQ_get_console_input_history, REQ_get_console_input_history,
REQ_create_console_output, REQ_create_console_output,
REQ_send_console_signal,
REQ_get_next_console_request, REQ_get_next_console_request,
REQ_read_directory_changes, REQ_read_directory_changes,
REQ_read_change, REQ_read_change,
@ -5831,7 +5816,6 @@ union generic_request
struct append_console_input_history_request append_console_input_history_request; struct append_console_input_history_request append_console_input_history_request;
struct get_console_input_history_request get_console_input_history_request; struct get_console_input_history_request get_console_input_history_request;
struct create_console_output_request create_console_output_request; struct create_console_output_request create_console_output_request;
struct send_console_signal_request send_console_signal_request;
struct get_next_console_request_request get_next_console_request_request; struct get_next_console_request_request get_next_console_request_request;
struct read_directory_changes_request read_directory_changes_request; struct read_directory_changes_request read_directory_changes_request;
struct read_change_request read_change_request; struct read_change_request read_change_request;
@ -6119,7 +6103,6 @@ union generic_reply
struct append_console_input_history_reply append_console_input_history_reply; struct append_console_input_history_reply append_console_input_history_reply;
struct get_console_input_history_reply get_console_input_history_reply; struct get_console_input_history_reply get_console_input_history_reply;
struct create_console_output_reply create_console_output_reply; struct create_console_output_reply create_console_output_reply;
struct send_console_signal_reply send_console_signal_reply;
struct get_next_console_request_reply get_next_console_request_reply; struct get_next_console_request_reply get_next_console_request_reply;
struct read_directory_changes_reply read_directory_changes_reply; struct read_directory_changes_reply read_directory_changes_reply;
struct read_change_reply read_change_reply; struct read_change_reply read_change_reply;
@ -6337,7 +6320,7 @@ union generic_reply
/* ### protocol_version begin ### */ /* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 640 #define SERVER_PROTOCOL_VERSION 641
/* ### protocol_version end ### */ /* ### protocol_version end ### */

View File

@ -2394,19 +2394,6 @@ DECL_HANDLER(create_console_output)
release_object( console ); release_object( console );
} }
/* sends a signal to a console (process, group...) */
DECL_HANDLER(send_console_signal)
{
process_id_t group;
group = req->group_id ? req->group_id : current->process->group_id;
if (!group)
set_error( STATUS_INVALID_PARAMETER );
else
propagate_console_signal( current->process->console, req->signal, group );
}
/* get console which renderer is 'current' */ /* get console which renderer is 'current' */
static int cgwe_enum( struct process* process, void* user) static int cgwe_enum( struct process* process, void* user)
{ {

View File

@ -1515,13 +1515,6 @@ enum server_fd_type
@END @END
/* Sends a signal to a process group */
@REQ(send_console_signal)
int signal; /* the signal to send */
process_id_t group_id; /* the group to send the signal to */
@END
/* Retrieve the next pending console ioctl request */ /* Retrieve the next pending console ioctl request */
@REQ(get_next_console_request) @REQ(get_next_console_request)
obj_handle_t handle; /* console server handle */ obj_handle_t handle; /* console server handle */

View File

@ -188,7 +188,6 @@ DECL_HANDLER(get_console_wait_event);
DECL_HANDLER(append_console_input_history); DECL_HANDLER(append_console_input_history);
DECL_HANDLER(get_console_input_history); DECL_HANDLER(get_console_input_history);
DECL_HANDLER(create_console_output); DECL_HANDLER(create_console_output);
DECL_HANDLER(send_console_signal);
DECL_HANDLER(get_next_console_request); DECL_HANDLER(get_next_console_request);
DECL_HANDLER(read_directory_changes); DECL_HANDLER(read_directory_changes);
DECL_HANDLER(read_change); DECL_HANDLER(read_change);
@ -477,7 +476,6 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
(req_handler)req_append_console_input_history, (req_handler)req_append_console_input_history,
(req_handler)req_get_console_input_history, (req_handler)req_get_console_input_history,
(req_handler)req_create_console_output, (req_handler)req_create_console_output,
(req_handler)req_send_console_signal,
(req_handler)req_get_next_console_request, (req_handler)req_get_next_console_request,
(req_handler)req_read_directory_changes, (req_handler)req_read_directory_changes,
(req_handler)req_read_change, (req_handler)req_read_change,
@ -1131,9 +1129,6 @@ C_ASSERT( FIELD_OFFSET(struct create_console_output_request, fd) == 28 );
C_ASSERT( sizeof(struct create_console_output_request) == 32 ); C_ASSERT( sizeof(struct create_console_output_request) == 32 );
C_ASSERT( FIELD_OFFSET(struct create_console_output_reply, handle_out) == 8 ); C_ASSERT( FIELD_OFFSET(struct create_console_output_reply, handle_out) == 8 );
C_ASSERT( sizeof(struct create_console_output_reply) == 16 ); C_ASSERT( sizeof(struct create_console_output_reply) == 16 );
C_ASSERT( FIELD_OFFSET(struct send_console_signal_request, signal) == 12 );
C_ASSERT( FIELD_OFFSET(struct send_console_signal_request, group_id) == 16 );
C_ASSERT( sizeof(struct send_console_signal_request) == 24 );
C_ASSERT( FIELD_OFFSET(struct get_next_console_request_request, handle) == 12 ); C_ASSERT( FIELD_OFFSET(struct get_next_console_request_request, handle) == 12 );
C_ASSERT( FIELD_OFFSET(struct get_next_console_request_request, signal) == 16 ); C_ASSERT( FIELD_OFFSET(struct get_next_console_request_request, signal) == 16 );
C_ASSERT( FIELD_OFFSET(struct get_next_console_request_request, read) == 20 ); C_ASSERT( FIELD_OFFSET(struct get_next_console_request_request, read) == 20 );

View File

@ -2089,12 +2089,6 @@ static void dump_create_console_output_reply( const struct create_console_output
fprintf( stderr, " handle_out=%04x", req->handle_out ); fprintf( stderr, " handle_out=%04x", req->handle_out );
} }
static void dump_send_console_signal_request( const struct send_console_signal_request *req )
{
fprintf( stderr, " signal=%d", req->signal );
fprintf( stderr, ", group_id=%04x", req->group_id );
}
static void dump_get_next_console_request_request( const struct get_next_console_request_request *req ) static void dump_get_next_console_request_request( const struct get_next_console_request_request *req )
{ {
fprintf( stderr, " handle=%04x", req->handle ); fprintf( stderr, " handle=%04x", req->handle );
@ -4502,7 +4496,6 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(dump_func)dump_append_console_input_history_request, (dump_func)dump_append_console_input_history_request,
(dump_func)dump_get_console_input_history_request, (dump_func)dump_get_console_input_history_request,
(dump_func)dump_create_console_output_request, (dump_func)dump_create_console_output_request,
(dump_func)dump_send_console_signal_request,
(dump_func)dump_get_next_console_request_request, (dump_func)dump_get_next_console_request_request,
(dump_func)dump_read_directory_changes_request, (dump_func)dump_read_directory_changes_request,
(dump_func)dump_read_change_request, (dump_func)dump_read_change_request,
@ -4788,7 +4781,6 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
NULL, NULL,
(dump_func)dump_get_console_input_history_reply, (dump_func)dump_get_console_input_history_reply,
(dump_func)dump_create_console_output_reply, (dump_func)dump_create_console_output_reply,
NULL,
(dump_func)dump_get_next_console_request_reply, (dump_func)dump_get_next_console_request_reply,
NULL, NULL,
(dump_func)dump_read_change_reply, (dump_func)dump_read_change_reply,
@ -5074,7 +5066,6 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
"append_console_input_history", "append_console_input_history",
"get_console_input_history", "get_console_input_history",
"create_console_output", "create_console_output",
"send_console_signal",
"get_next_console_request", "get_next_console_request",
"read_directory_changes", "read_directory_changes",
"read_change", "read_change",