server: Use an explicit union instead of a typedef for debug event data.

This commit is contained in:
Alexandre Julliard 2024-11-18 21:33:42 +01:00
parent 180ba49cee
commit 6f5e34ad14
7 changed files with 12 additions and 12 deletions

View file

@ -993,7 +993,7 @@ NTSTATUS WINAPI NtSetInformationDebugObject( HANDLE handle, DEBUGOBJECTINFOCLASS
/* convert the server event data to an NT state change; helper for NtWaitForDebugEvent */ /* convert the server event data to an NT state change; helper for NtWaitForDebugEvent */
static NTSTATUS event_data_to_state_change( const debug_event_t *data, DBGUI_WAIT_STATE_CHANGE *state ) static NTSTATUS event_data_to_state_change( const union debug_event_data *data, DBGUI_WAIT_STATE_CHANGE *state )
{ {
int i; int i;
@ -1098,7 +1098,7 @@ static NTSTATUS get_image_machine( HANDLE handle, USHORT *machine )
NTSTATUS WINAPI NtWaitForDebugEvent( HANDLE handle, BOOLEAN alertable, LARGE_INTEGER *timeout, NTSTATUS WINAPI NtWaitForDebugEvent( HANDLE handle, BOOLEAN alertable, LARGE_INTEGER *timeout,
DBGUI_WAIT_STATE_CHANGE *state ) DBGUI_WAIT_STATE_CHANGE *state )
{ {
debug_event_t data; union debug_event_data data;
unsigned int ret; unsigned int ret;
BOOL wait = TRUE; BOOL wait = TRUE;

View file

@ -57,7 +57,7 @@ struct request_max_size
typedef union union debug_event_data
{ {
int code; int code;
struct struct
@ -109,7 +109,7 @@ typedef union
int __pad; int __pad;
mod_handle_t base; mod_handle_t base;
} unload_dll; } unload_dll;
} debug_event_t; };
enum context_exec_space enum context_exec_space

View file

@ -48,7 +48,7 @@ struct debug_event
struct file *file; /* file object for events that need one */ struct file *file; /* file object for events that need one */
enum debug_event_state state; /* event state */ enum debug_event_state state; /* event state */
int status; /* continuation status */ int status; /* continuation status */
debug_event_t data; /* event data */ union debug_event_data data; /* event data */
}; };
static const WCHAR debug_obj_name[] = {'D','e','b','u','g','O','b','j','e','c','t'}; static const WCHAR debug_obj_name[] = {'D','e','b','u','g','O','b','j','e','c','t'};
@ -142,7 +142,7 @@ static client_ptr_t get_teb_user_ptr( struct thread *thread )
static void fill_exception_event( struct debug_event *event, const void *arg ) static void fill_exception_event( struct debug_event *event, const void *arg )
{ {
const debug_event_t *data = arg; const union debug_event_data *data = arg;
event->data.exception = data->exception; event->data.exception = data->exception;
event->data.exception.nb_params = min( event->data.exception.nb_params, EXCEPTION_MAXIMUM_PARAMETERS ); event->data.exception.nb_params = min( event->data.exception.nb_params, EXCEPTION_MAXIMUM_PARAMETERS );
} }
@ -641,7 +641,7 @@ DECL_HANDLER(queue_exception_event)
reply->handle = 0; reply->handle = 0;
if (debug_obj) if (debug_obj)
{ {
debug_event_t data; union debug_event_data data;
struct debug_event *event; struct debug_event *event;
struct thread *thread = current; struct thread *thread = current;

View file

@ -73,7 +73,7 @@ struct request_max_size
/* debug event data */ /* debug event data */
typedef union union debug_event_data
{ {
int code; /* event code */ int code; /* event code */
struct struct
@ -125,7 +125,7 @@ typedef union
int __pad; int __pad;
mod_handle_t base; /* base address of the dll */ mod_handle_t base; /* base address of the dll */
} unload_dll; } unload_dll;
} debug_event_t; };
enum context_exec_space enum context_exec_space

View file

@ -604,7 +604,6 @@ C_ASSERT( sizeof(client_ptr_t) == 8 );
C_ASSERT( sizeof(context_t) == 1728 ); C_ASSERT( sizeof(context_t) == 1728 );
C_ASSERT( sizeof(cursor_pos_t) == 24 ); C_ASSERT( sizeof(cursor_pos_t) == 24 );
C_ASSERT( sizeof(data_size_t) == 4 ); C_ASSERT( sizeof(data_size_t) == 4 );
C_ASSERT( sizeof(debug_event_t) == 160 );
C_ASSERT( sizeof(file_pos_t) == 8 ); C_ASSERT( sizeof(file_pos_t) == 8 );
C_ASSERT( sizeof(generic_map_t) == 16 ); C_ASSERT( sizeof(generic_map_t) == 16 );
C_ASSERT( sizeof(int) == 4 ); C_ASSERT( sizeof(int) == 4 );
@ -640,6 +639,7 @@ C_ASSERT( sizeof(timeout_t) == 8 );
C_ASSERT( sizeof(udp_endpoint) == 32 ); C_ASSERT( sizeof(udp_endpoint) == 32 );
C_ASSERT( sizeof(union apc_call) == 64 ); C_ASSERT( sizeof(union apc_call) == 64 );
C_ASSERT( sizeof(union apc_result) == 40 ); C_ASSERT( sizeof(union apc_result) == 40 );
C_ASSERT( sizeof(union debug_event_data) == 160 );
C_ASSERT( sizeof(union hw_input) == 40 ); C_ASSERT( sizeof(union hw_input) == 40 );
C_ASSERT( sizeof(union message_data) == 48 ); C_ASSERT( sizeof(union message_data) == 48 );
C_ASSERT( sizeof(unsigned __int64) == 8 ); C_ASSERT( sizeof(unsigned __int64) == 8 );

View file

@ -887,7 +887,7 @@ static void dump_varargs_contexts( const char *prefix, data_size_t size )
static void dump_varargs_debug_event( const char *prefix, data_size_t size ) static void dump_varargs_debug_event( const char *prefix, data_size_t size )
{ {
debug_event_t event; union debug_event_data event;
if (!size) if (!size)
{ {

View file

@ -45,7 +45,6 @@ my %formats =
# varargs-only structures # varargs-only structures
"context_t" => [ 1728, 8 ], "context_t" => [ 1728, 8 ],
"cursor_pos_t" => [ 24, 8 ], "cursor_pos_t" => [ 24, 8 ],
"debug_event_t" => [ 160, 8 ],
"pe_image_info_t" => [ 88, 8 ], "pe_image_info_t" => [ 88, 8 ],
"property_data_t" => [ 16, 8 ], "property_data_t" => [ 16, 8 ],
"select_op_t" => [ 264, 8 ], "select_op_t" => [ 264, 8 ],
@ -55,6 +54,7 @@ my %formats =
"union apc_call" => [ 64, 8 ], "union apc_call" => [ 64, 8 ],
"union apc_result" => [ 40, 8 ], "union apc_result" => [ 40, 8 ],
"struct async_data" => [ 40, 8 ], "struct async_data" => [ 40, 8 ],
"union debug_event_data" => [ 160, 8 ],
"struct filesystem_event" => [ 12, 4 ], "struct filesystem_event" => [ 12, 4 ],
"struct handle_info" => [ 20, 4 ], "struct handle_info" => [ 20, 4 ],
"union hw_input" => [ 40, 8 ], "union hw_input" => [ 40, 8 ],