mirror of
https://gitlab.winehq.org/wine/wine.git
synced 2024-11-19 17:06:04 -07:00
server: Use an explicit union instead of a typedef for APC results.
This commit is contained in:
parent
1137a10ef7
commit
4c0103e58c
11 changed files with 31 additions and 31 deletions
|
@ -364,7 +364,7 @@ static NTSTATUS invoke_user_apc( CONTEXT *context, const user_apc_t *apc, NTSTAT
|
|||
/***********************************************************************
|
||||
* invoke_system_apc
|
||||
*/
|
||||
static void invoke_system_apc( const union apc_call *call, apc_result_t *result, BOOL self )
|
||||
static void invoke_system_apc( const union apc_call *call, union apc_result *result, BOOL self )
|
||||
{
|
||||
SIZE_T size, bits;
|
||||
void *addr;
|
||||
|
@ -694,7 +694,7 @@ unsigned int server_select( const select_op_t *select_op, data_size_t size, UINT
|
|||
int cookie;
|
||||
obj_handle_t apc_handle = 0;
|
||||
BOOL suspend_context = !!context;
|
||||
apc_result_t result;
|
||||
union apc_result result;
|
||||
sigset_t old_set;
|
||||
int signaled;
|
||||
data_size_t reply_size;
|
||||
|
@ -823,7 +823,7 @@ NTSTATUS WINAPI NtTestAlert(void)
|
|||
/***********************************************************************
|
||||
* server_queue_process_apc
|
||||
*/
|
||||
unsigned int server_queue_process_apc( HANDLE process, const union apc_call *call, apc_result_t *result )
|
||||
unsigned int server_queue_process_apc( HANDLE process, const union apc_call *call, union apc_result *result )
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
|
@ -1760,7 +1760,7 @@ NTSTATUS WINAPI NtDuplicateObject( HANDLE source_process, HANDLE source, HANDLE
|
|||
if ((options & DUPLICATE_CLOSE_SOURCE) && source_process != NtCurrentProcess())
|
||||
{
|
||||
union apc_call call;
|
||||
apc_result_t result;
|
||||
union apc_result result;
|
||||
|
||||
memset( &call, 0, sizeof(call) );
|
||||
|
||||
|
|
|
@ -1324,7 +1324,7 @@ NTSTATUS WINAPI NtCreateThreadEx( HANDLE *handle, ACCESS_MASK access, OBJECT_ATT
|
|||
if (process != NtCurrentProcess())
|
||||
{
|
||||
union apc_call call;
|
||||
apc_result_t result;
|
||||
union apc_result result;
|
||||
|
||||
memset( &call, 0, sizeof(call) );
|
||||
|
||||
|
|
|
@ -213,7 +213,7 @@ extern unsigned int server_select( const select_op_t *select_op, data_size_t siz
|
|||
extern unsigned int server_wait( const select_op_t *select_op, data_size_t size, UINT flags,
|
||||
const LARGE_INTEGER *timeout );
|
||||
extern unsigned int server_queue_process_apc( HANDLE process, const union apc_call *call,
|
||||
apc_result_t *result );
|
||||
union apc_result *result );
|
||||
extern int server_get_unix_fd( HANDLE handle, unsigned int wanted_access, int *unix_fd,
|
||||
int *needs_close, enum server_fd_type *type, unsigned int *options );
|
||||
extern void wine_server_send_fd( int fd );
|
||||
|
|
|
@ -4672,7 +4672,7 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG_PTR z
|
|||
if (process != NtCurrentProcess())
|
||||
{
|
||||
union apc_call call;
|
||||
apc_result_t result;
|
||||
union apc_result result;
|
||||
unsigned int status;
|
||||
|
||||
memset( &call, 0, sizeof(call) );
|
||||
|
@ -4818,7 +4818,7 @@ NTSTATUS WINAPI NtAllocateVirtualMemoryEx( HANDLE process, PVOID *ret, SIZE_T *s
|
|||
if (process != NtCurrentProcess())
|
||||
{
|
||||
union apc_call call;
|
||||
apc_result_t result;
|
||||
union apc_result result;
|
||||
|
||||
memset( &call, 0, sizeof(call) );
|
||||
|
||||
|
@ -4865,7 +4865,7 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si
|
|||
if (process != NtCurrentProcess())
|
||||
{
|
||||
union apc_call call;
|
||||
apc_result_t result;
|
||||
union apc_result result;
|
||||
|
||||
memset( &call, 0, sizeof(call) );
|
||||
|
||||
|
@ -4963,7 +4963,7 @@ NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T
|
|||
if (process != NtCurrentProcess())
|
||||
{
|
||||
union apc_call call;
|
||||
apc_result_t result;
|
||||
union apc_result result;
|
||||
|
||||
memset( &call, 0, sizeof(call) );
|
||||
|
||||
|
@ -5147,7 +5147,7 @@ static unsigned int get_basic_memory_info( HANDLE process, LPCVOID addr,
|
|||
if (process != NtCurrentProcess())
|
||||
{
|
||||
union apc_call call;
|
||||
apc_result_t result;
|
||||
union apc_result result;
|
||||
|
||||
memset( &call, 0, sizeof(call) );
|
||||
|
||||
|
@ -5560,7 +5560,7 @@ NTSTATUS WINAPI NtLockVirtualMemory( HANDLE process, PVOID *addr, SIZE_T *size,
|
|||
if (process != NtCurrentProcess())
|
||||
{
|
||||
union apc_call call;
|
||||
apc_result_t result;
|
||||
union apc_result result;
|
||||
|
||||
memset( &call, 0, sizeof(call) );
|
||||
|
||||
|
@ -5597,7 +5597,7 @@ NTSTATUS WINAPI NtUnlockVirtualMemory( HANDLE process, PVOID *addr, SIZE_T *size
|
|||
if (process != NtCurrentProcess())
|
||||
{
|
||||
union apc_call call;
|
||||
apc_result_t result;
|
||||
union apc_result result;
|
||||
|
||||
memset( &call, 0, sizeof(call) );
|
||||
|
||||
|
@ -5673,7 +5673,7 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
|
|||
if (process != NtCurrentProcess())
|
||||
{
|
||||
union apc_call call;
|
||||
apc_result_t result;
|
||||
union apc_result result;
|
||||
|
||||
memset( &call, 0, sizeof(call) );
|
||||
|
||||
|
@ -5745,7 +5745,7 @@ NTSTATUS WINAPI NtMapViewOfSectionEx( HANDLE handle, HANDLE process, PVOID *addr
|
|||
if (process != NtCurrentProcess())
|
||||
{
|
||||
union apc_call call;
|
||||
apc_result_t result;
|
||||
union apc_result result;
|
||||
|
||||
memset( &call, 0, sizeof(call) );
|
||||
|
||||
|
@ -5789,7 +5789,7 @@ static NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr, ULONG flags )
|
|||
if (process != NtCurrentProcess())
|
||||
{
|
||||
union apc_call call;
|
||||
apc_result_t result;
|
||||
union apc_result result;
|
||||
|
||||
memset( &call, 0, sizeof(call) );
|
||||
|
||||
|
@ -5974,7 +5974,7 @@ NTSTATUS WINAPI NtFlushVirtualMemory( HANDLE process, LPCVOID *addr_ptr,
|
|||
if (process != NtCurrentProcess())
|
||||
{
|
||||
union apc_call call;
|
||||
apc_result_t result;
|
||||
union apc_result result;
|
||||
|
||||
memset( &call, 0, sizeof(call) );
|
||||
|
||||
|
@ -6360,7 +6360,7 @@ NTSTATUS WINAPI NtWow64AllocateVirtualMemory64( HANDLE process, ULONG64 *ret, UL
|
|||
if (process != NtCurrentProcess())
|
||||
{
|
||||
union apc_call call;
|
||||
apc_result_t result;
|
||||
union apc_result result;
|
||||
|
||||
memset( &call, 0, sizeof(call) );
|
||||
|
||||
|
|
|
@ -622,7 +622,7 @@ union apc_call
|
|||
} dup_handle;
|
||||
};
|
||||
|
||||
typedef union
|
||||
union apc_result
|
||||
{
|
||||
enum apc_type type;
|
||||
struct
|
||||
|
@ -732,7 +732,7 @@ typedef union
|
|||
enum apc_type type;
|
||||
unsigned int status;
|
||||
} break_process;
|
||||
} apc_result_t;
|
||||
};
|
||||
|
||||
enum irp_type
|
||||
{
|
||||
|
@ -1343,7 +1343,7 @@ struct get_apc_result_request
|
|||
struct get_apc_result_reply
|
||||
{
|
||||
struct reply_header __header;
|
||||
apc_result_t result;
|
||||
union apc_result result;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -638,7 +638,7 @@ union apc_call
|
|||
} dup_handle;
|
||||
};
|
||||
|
||||
typedef union
|
||||
union apc_result
|
||||
{
|
||||
enum apc_type type;
|
||||
struct
|
||||
|
@ -748,7 +748,7 @@ typedef union
|
|||
enum apc_type type; /* APC_BREAK_PROCESS */
|
||||
unsigned int status; /* status returned by call */
|
||||
} break_process;
|
||||
} apc_result_t;
|
||||
};
|
||||
|
||||
enum irp_type
|
||||
{
|
||||
|
@ -1232,7 +1232,7 @@ typedef struct
|
|||
@REQ(get_apc_result)
|
||||
obj_handle_t handle; /* handle to the APC */
|
||||
@REPLY
|
||||
apc_result_t result; /* result of the APC */
|
||||
union apc_result result; /* result of the APC */
|
||||
@END
|
||||
|
||||
|
||||
|
|
|
@ -598,7 +598,6 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
|
|||
C_ASSERT( sizeof(abstime_t) == 8 );
|
||||
C_ASSERT( sizeof(affinity_t) == 8 );
|
||||
C_ASSERT( sizeof(apc_param_t) == 8 );
|
||||
C_ASSERT( sizeof(apc_result_t) == 40 );
|
||||
C_ASSERT( sizeof(async_data_t) == 40 );
|
||||
C_ASSERT( sizeof(atom_t) == 4 );
|
||||
C_ASSERT( sizeof(char) == 1 );
|
||||
|
@ -641,6 +640,7 @@ C_ASSERT( sizeof(thread_id_t) == 4 );
|
|||
C_ASSERT( sizeof(timeout_t) == 8 );
|
||||
C_ASSERT( sizeof(udp_endpoint) == 32 );
|
||||
C_ASSERT( sizeof(union apc_call) == 64 );
|
||||
C_ASSERT( sizeof(union apc_result) == 40 );
|
||||
C_ASSERT( sizeof(unsigned __int64) == 8 );
|
||||
C_ASSERT( sizeof(unsigned char) == 1 );
|
||||
C_ASSERT( sizeof(unsigned int) == 4 );
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
static void dump_abstime( const char *prefix, const abstime_t *val );
|
||||
static void dump_apc_result( const char *prefix, const apc_result_t *val );
|
||||
static void dump_apc_result( const char *prefix, const union apc_result *val );
|
||||
static void dump_async_data( const char *prefix, const async_data_t *val );
|
||||
static void dump_generic_map( const char *prefix, const generic_map_t *val );
|
||||
static void dump_hw_input( const char *prefix, const hw_input_t *val );
|
||||
|
|
|
@ -80,7 +80,7 @@ struct thread_apc
|
|||
struct object *owner; /* object that queued this apc */
|
||||
int executed; /* has it been executed by the client? */
|
||||
union apc_call call; /* call arguments */
|
||||
apc_result_t result; /* call results once executed */
|
||||
union apc_result result; /* call results once executed */
|
||||
};
|
||||
|
||||
static void dump_thread_apc( struct object *obj, int verbose );
|
||||
|
@ -1584,7 +1584,7 @@ DECL_HANDLER(select)
|
|||
data_size_t op_size, ctx_size;
|
||||
struct context *ctx;
|
||||
struct thread_apc *apc;
|
||||
const apc_result_t *result = get_req_data();
|
||||
const union apc_result *result = get_req_data();
|
||||
unsigned int ctx_count;
|
||||
|
||||
if (get_req_data_size() < sizeof(*result)) goto invalid_param;
|
||||
|
|
|
@ -293,7 +293,7 @@ static void dump_apc_call( const char *prefix, const union apc_call *call )
|
|||
fputc( '}', stderr );
|
||||
}
|
||||
|
||||
static void dump_apc_result( const char *prefix, const apc_result_t *result )
|
||||
static void dump_apc_result( const char *prefix, const union apc_result *result )
|
||||
{
|
||||
fprintf( stderr, "%s{", prefix );
|
||||
switch(result->type)
|
||||
|
@ -570,7 +570,7 @@ static void dump_varargs_apc_call( const char *prefix, data_size_t size )
|
|||
|
||||
static void dump_varargs_apc_result( const char *prefix, data_size_t size )
|
||||
{
|
||||
const apc_result_t *result = cur_data;
|
||||
const union apc_result *result = cur_data;
|
||||
|
||||
if (size >= sizeof(*result))
|
||||
{
|
||||
|
|
|
@ -38,7 +38,6 @@ my %formats =
|
|||
"timeout_t" => [ 8, 8 ],
|
||||
"abstime_t" => [ 8, 8 ],
|
||||
"rectangle_t" => [ 16, 4 ],
|
||||
"apc_result_t" => [ 40, 8 ],
|
||||
"async_data_t" => [ 40, 8 ],
|
||||
"irp_params_t" => [ 32, 8 ],
|
||||
"generic_map_t" => [ 16, 4 ],
|
||||
|
@ -58,6 +57,7 @@ my %formats =
|
|||
"udp_endpoint" => [ 32, 4 ],
|
||||
"user_apc_t" => [ 40, 8 ],
|
||||
"union apc_call" => [ 64, 8 ],
|
||||
"union apc_result" => [ 40, 8 ],
|
||||
"struct filesystem_event" => [ 12, 4 ],
|
||||
"struct handle_info" => [ 20, 4 ],
|
||||
"struct luid" => [ 8, 4 ],
|
||||
|
|
Loading…
Reference in a new issue