server: Make the address parameters in inter-process virtual memory calls client_ptr_t.

Add explicit padding fields in the corresponding structures.
This commit is contained in:
Alexandre Julliard 2008-12-30 15:05:38 +01:00
parent d066a9a01a
commit 838803ce24
6 changed files with 186 additions and 134 deletions

View File

@ -844,6 +844,7 @@ static BOOL invoke_apc( const apc_call_t *call, apc_result_t *result )
{
BOOL user_apc = FALSE;
SIZE_T size;
void *addr;
memset( result, 0, sizeof(*result) );
@ -872,29 +873,28 @@ static BOOL invoke_apc( const apc_call_t *call, apc_result_t *result )
break;
case APC_VIRTUAL_ALLOC:
result->type = call->type;
result->virtual_alloc.addr = call->virtual_alloc.addr;
addr = wine_server_get_ptr( call->virtual_alloc.addr );
size = call->virtual_alloc.size;
if (size == call->virtual_alloc.size) /* not truncated */
if ((ULONG_PTR)addr == call->virtual_alloc.addr && size == call->virtual_alloc.size)
{
result->virtual_alloc.status = NtAllocateVirtualMemory( NtCurrentProcess(),
&result->virtual_alloc.addr,
call->virtual_alloc.zero_bits,
&size,
result->virtual_alloc.status = NtAllocateVirtualMemory( NtCurrentProcess(), &addr,
call->virtual_alloc.zero_bits, &size,
call->virtual_alloc.op_type,
call->virtual_alloc.prot );
result->virtual_alloc.addr = wine_server_client_ptr( addr );
result->virtual_alloc.size = size;
}
else result->virtual_alloc.status = STATUS_WORKING_SET_LIMIT_RANGE;
break;
case APC_VIRTUAL_FREE:
result->type = call->type;
result->virtual_free.addr = call->virtual_free.addr;
addr = wine_server_get_ptr( call->virtual_free.addr );
size = call->virtual_free.size;
if (size == call->virtual_free.size) /* not truncated */
if ((ULONG_PTR)addr == call->virtual_free.addr && size == call->virtual_free.size)
{
result->virtual_free.status = NtFreeVirtualMemory( NtCurrentProcess(),
&result->virtual_free.addr, &size,
result->virtual_free.status = NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size,
call->virtual_free.op_type );
result->virtual_free.addr = wine_server_client_ptr( addr );
result->virtual_free.size = size;
}
else result->virtual_free.status = STATUS_INVALID_PARAMETER;
@ -903,14 +903,18 @@ static BOOL invoke_apc( const apc_call_t *call, apc_result_t *result )
{
MEMORY_BASIC_INFORMATION info;
result->type = call->type;
result->virtual_query.status = NtQueryVirtualMemory( NtCurrentProcess(),
call->virtual_query.addr,
MemoryBasicInformation, &info,
sizeof(info), NULL );
addr = wine_server_get_ptr( call->virtual_query.addr );
if ((ULONG_PTR)addr == call->virtual_query.addr)
result->virtual_query.status = NtQueryVirtualMemory( NtCurrentProcess(),
addr, MemoryBasicInformation, &info,
sizeof(info), NULL );
else
result->virtual_query.status = STATUS_WORKING_SET_LIMIT_RANGE;
if (result->virtual_query.status == STATUS_SUCCESS)
{
result->virtual_query.base = info.BaseAddress;
result->virtual_query.alloc_base = info.AllocationBase;
result->virtual_query.base = wine_server_client_ptr( info.BaseAddress );
result->virtual_query.alloc_base = wine_server_client_ptr( info.AllocationBase );
result->virtual_query.size = info.RegionSize;
result->virtual_query.state = info.State;
result->virtual_query.prot = info.Protect;
@ -921,78 +925,81 @@ static BOOL invoke_apc( const apc_call_t *call, apc_result_t *result )
}
case APC_VIRTUAL_PROTECT:
result->type = call->type;
result->virtual_protect.addr = call->virtual_protect.addr;
addr = wine_server_get_ptr( call->virtual_protect.addr );
size = call->virtual_protect.size;
if (size == call->virtual_protect.size) /* not truncated */
if ((ULONG_PTR)addr == call->virtual_protect.addr && size == call->virtual_protect.size)
{
result->virtual_protect.status = NtProtectVirtualMemory( NtCurrentProcess(),
&result->virtual_protect.addr,
&size,
result->virtual_protect.status = NtProtectVirtualMemory( NtCurrentProcess(), &addr, &size,
call->virtual_protect.prot,
&result->virtual_protect.prot );
result->virtual_protect.addr = wine_server_client_ptr( addr );
result->virtual_protect.size = size;
}
else result->virtual_protect.status = STATUS_INVALID_PARAMETER;
break;
case APC_VIRTUAL_FLUSH:
result->type = call->type;
result->virtual_flush.addr = call->virtual_flush.addr;
addr = wine_server_get_ptr( call->virtual_flush.addr );
size = call->virtual_flush.size;
if (size == call->virtual_flush.size) /* not truncated */
if ((ULONG_PTR)addr == call->virtual_flush.addr && size == call->virtual_flush.size)
{
result->virtual_flush.status = NtFlushVirtualMemory( NtCurrentProcess(),
&result->virtual_flush.addr, &size, 0 );
(const void **)&addr, &size, 0 );
result->virtual_flush.addr = wine_server_client_ptr( addr );
result->virtual_flush.size = size;
}
else result->virtual_flush.status = STATUS_INVALID_PARAMETER;
break;
case APC_VIRTUAL_LOCK:
result->type = call->type;
result->virtual_lock.addr = call->virtual_lock.addr;
addr = wine_server_get_ptr( call->virtual_lock.addr );
size = call->virtual_lock.size;
if (size == call->virtual_lock.size) /* not truncated */
if ((ULONG_PTR)addr == call->virtual_lock.addr && size == call->virtual_lock.size)
{
result->virtual_lock.status = NtLockVirtualMemory( NtCurrentProcess(),
&result->virtual_lock.addr, &size, 0 );
result->virtual_lock.status = NtLockVirtualMemory( NtCurrentProcess(), &addr, &size, 0 );
result->virtual_lock.addr = wine_server_client_ptr( addr );
result->virtual_lock.size = size;
}
else result->virtual_lock.status = STATUS_INVALID_PARAMETER;
break;
case APC_VIRTUAL_UNLOCK:
result->type = call->type;
result->virtual_unlock.addr = call->virtual_unlock.addr;
addr = wine_server_get_ptr( call->virtual_unlock.addr );
size = call->virtual_unlock.size;
if (size == call->virtual_unlock.size) /* not truncated */
if ((ULONG_PTR)addr == call->virtual_unlock.addr && size == call->virtual_unlock.size)
{
result->virtual_unlock.status = NtUnlockVirtualMemory( NtCurrentProcess(),
&result->virtual_unlock.addr, &size, 0 );
result->virtual_unlock.status = NtUnlockVirtualMemory( NtCurrentProcess(), &addr, &size, 0 );
result->virtual_unlock.addr = wine_server_client_ptr( addr );
result->virtual_unlock.size = size;
}
else result->virtual_unlock.status = STATUS_INVALID_PARAMETER;
break;
case APC_MAP_VIEW:
{
LARGE_INTEGER offset;
result->type = call->type;
result->map_view.addr = call->map_view.addr;
offset.QuadPart = call->map_view.offset;
addr = wine_server_get_ptr( call->map_view.addr );
size = call->map_view.size;
if (size == call->map_view.size) /* not truncated */
if ((ULONG_PTR)addr == call->map_view.addr && size == call->map_view.size)
{
LARGE_INTEGER offset;
offset.QuadPart = call->map_view.offset;
result->map_view.status = NtMapViewOfSection( wine_server_ptr_handle(call->map_view.handle),
NtCurrentProcess(), &result->map_view.addr,
NtCurrentProcess(), &addr,
call->map_view.zero_bits, 0,
&offset, &size, ViewShare,
call->map_view.alloc_type, call->map_view.prot );
result->map_view.size = size;
result->map_view.addr = wine_server_client_ptr( addr );
result->map_view.size = size;
}
else result->map_view.status = STATUS_INVALID_PARAMETER;
NtClose( wine_server_ptr_handle(call->map_view.handle) );
break;
}
case APC_UNMAP_VIEW:
result->type = call->type;
result->unmap_view.status = NtUnmapViewOfSection( NtCurrentProcess(), call->unmap_view.addr );
addr = wine_server_get_ptr( call->unmap_view.addr );
if ((ULONG_PTR)addr == call->unmap_view.addr)
result->unmap_view.status = NtUnmapViewOfSection( NtCurrentProcess(), addr );
else
result->unmap_view.status = STATUS_INVALID_PARAMETER;
break;
case APC_CREATE_THREAD:
{

View File

@ -1611,7 +1611,7 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_
memset( &call, 0, sizeof(call) );
call.virtual_alloc.type = APC_VIRTUAL_ALLOC;
call.virtual_alloc.addr = *ret;
call.virtual_alloc.addr = wine_server_client_ptr( *ret );
call.virtual_alloc.size = *size_ptr;
call.virtual_alloc.zero_bits = zero_bits;
call.virtual_alloc.op_type = type;
@ -1621,7 +1621,7 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_
if (result.virtual_alloc.status == STATUS_SUCCESS)
{
*ret = result.virtual_alloc.addr;
*ret = wine_server_get_ptr( result.virtual_alloc.addr );
*size_ptr = result.virtual_alloc.size;
}
return result.virtual_alloc.status;
@ -1739,7 +1739,7 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si
memset( &call, 0, sizeof(call) );
call.virtual_free.type = APC_VIRTUAL_FREE;
call.virtual_free.addr = addr;
call.virtual_free.addr = wine_server_client_ptr( addr );
call.virtual_free.size = size;
call.virtual_free.op_type = type;
status = NTDLL_queue_process_apc( process, &call, &result );
@ -1747,7 +1747,7 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si
if (result.virtual_free.status == STATUS_SUCCESS)
{
*addr_ptr = result.virtual_free.addr;
*addr_ptr = wine_server_get_ptr( result.virtual_free.addr );
*size_ptr = result.virtual_free.size;
}
return result.virtual_free.status;
@ -1825,7 +1825,7 @@ NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T
memset( &call, 0, sizeof(call) );
call.virtual_protect.type = APC_VIRTUAL_PROTECT;
call.virtual_protect.addr = addr;
call.virtual_protect.addr = wine_server_client_ptr( addr );
call.virtual_protect.size = size;
call.virtual_protect.prot = new_prot;
status = NTDLL_queue_process_apc( process, &call, &result );
@ -1833,7 +1833,7 @@ NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T
if (result.virtual_protect.status == STATUS_SUCCESS)
{
*addr_ptr = result.virtual_protect.addr;
*addr_ptr = wine_server_get_ptr( result.virtual_protect.addr );
*size_ptr = result.virtual_protect.size;
if (old_prot) *old_prot = result.virtual_protect.prot;
}
@ -1954,14 +1954,14 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
memset( &call, 0, sizeof(call) );
call.virtual_query.type = APC_VIRTUAL_QUERY;
call.virtual_query.addr = addr;
call.virtual_query.addr = wine_server_client_ptr( addr );
status = NTDLL_queue_process_apc( process, &call, &result );
if (status != STATUS_SUCCESS) return status;
if (result.virtual_query.status == STATUS_SUCCESS)
{
info->BaseAddress = result.virtual_query.base;
info->AllocationBase = result.virtual_query.alloc_base;
info->BaseAddress = wine_server_get_ptr( result.virtual_query.base );
info->AllocationBase = wine_server_get_ptr( result.virtual_query.alloc_base );
info->RegionSize = result.virtual_query.size;
info->State = result.virtual_query.state;
info->Protect = result.virtual_query.prot;
@ -2063,14 +2063,14 @@ NTSTATUS WINAPI NtLockVirtualMemory( HANDLE process, PVOID *addr, SIZE_T *size,
memset( &call, 0, sizeof(call) );
call.virtual_lock.type = APC_VIRTUAL_LOCK;
call.virtual_lock.addr = *addr;
call.virtual_lock.addr = wine_server_client_ptr( *addr );
call.virtual_lock.size = *size;
status = NTDLL_queue_process_apc( process, &call, &result );
if (status != STATUS_SUCCESS) return status;
if (result.virtual_lock.status == STATUS_SUCCESS)
{
*addr = result.virtual_lock.addr;
*addr = wine_server_get_ptr( result.virtual_lock.addr );
*size = result.virtual_lock.size;
}
return result.virtual_lock.status;
@ -2100,14 +2100,14 @@ NTSTATUS WINAPI NtUnlockVirtualMemory( HANDLE process, PVOID *addr, SIZE_T *size
memset( &call, 0, sizeof(call) );
call.virtual_unlock.type = APC_VIRTUAL_UNLOCK;
call.virtual_unlock.addr = *addr;
call.virtual_unlock.addr = wine_server_client_ptr( *addr );
call.virtual_unlock.size = *size;
status = NTDLL_queue_process_apc( process, &call, &result );
if (status != STATUS_SUCCESS) return status;
if (result.virtual_unlock.status == STATUS_SUCCESS)
{
*addr = result.virtual_unlock.addr;
*addr = wine_server_get_ptr( result.virtual_unlock.addr );
*size = result.virtual_unlock.size;
}
return result.virtual_unlock.status;
@ -2242,7 +2242,7 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
call.map_view.type = APC_MAP_VIEW;
call.map_view.handle = wine_server_obj_handle( handle );
call.map_view.addr = *addr_ptr;
call.map_view.addr = wine_server_client_ptr( *addr_ptr );
call.map_view.size = *size_ptr;
call.map_view.offset = offset.QuadPart;
call.map_view.zero_bits = zero_bits;
@ -2253,7 +2253,7 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
if (result.map_view.status == STATUS_SUCCESS)
{
*addr_ptr = result.map_view.addr;
*addr_ptr = wine_server_get_ptr( result.map_view.addr );
*size_ptr = result.map_view.size;
}
return result.map_view.status;
@ -2398,7 +2398,7 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
memset( &call, 0, sizeof(call) );
call.unmap_view.type = APC_UNMAP_VIEW;
call.unmap_view.addr = addr;
call.unmap_view.addr = wine_server_client_ptr( addr );
status = NTDLL_queue_process_apc( process, &call, &result );
if (status == STATUS_SUCCESS) status = result.unmap_view.status;
return status;
@ -2435,14 +2435,14 @@ NTSTATUS WINAPI NtFlushVirtualMemory( HANDLE process, LPCVOID *addr_ptr,
memset( &call, 0, sizeof(call) );
call.virtual_flush.type = APC_VIRTUAL_FLUSH;
call.virtual_flush.addr = addr;
call.virtual_flush.addr = wine_server_client_ptr( addr );
call.virtual_flush.size = *size_ptr;
status = NTDLL_queue_process_apc( process, &call, &result );
if (status != STATUS_SUCCESS) return status;
if (result.virtual_flush.status == STATUS_SUCCESS)
{
*addr_ptr = result.virtual_flush.addr;
*addr_ptr = wine_server_get_ptr( result.virtual_flush.addr );
*size_ptr = result.virtual_flush.size;
}
return result.virtual_flush.status;

View File

@ -278,6 +278,7 @@ typedef union
struct
{
enum apc_type type;
int __pad;
client_ptr_t func;
timeout_t time;
client_ptr_t arg;
@ -293,54 +294,58 @@ typedef union
struct
{
enum apc_type type;
void *addr;
unsigned int op_type;
client_ptr_t addr;
mem_size_t size;
unsigned int zero_bits;
unsigned int op_type;
unsigned int prot;
} virtual_alloc;
struct
{
enum apc_type type;
void *addr;
mem_size_t size;
unsigned int op_type;
client_ptr_t addr;
mem_size_t size;
} virtual_free;
struct
{
enum apc_type type;
const void *addr;
int __pad;
client_ptr_t addr;
} virtual_query;
struct
{
enum apc_type type;
void *addr;
mem_size_t size;
unsigned int prot;
client_ptr_t addr;
mem_size_t size;
} virtual_protect;
struct
{
enum apc_type type;
const void *addr;
int __pad;
client_ptr_t addr;
mem_size_t size;
} virtual_flush;
struct
{
enum apc_type type;
void *addr;
int __pad;
client_ptr_t addr;
mem_size_t size;
} virtual_lock;
struct
{
enum apc_type type;
void *addr;
int __pad;
client_ptr_t addr;
mem_size_t size;
} virtual_unlock;
struct
{
enum apc_type type;
obj_handle_t handle;
void *addr;
client_ptr_t addr;
mem_size_t size;
file_pos_t offset;
unsigned int zero_bits;
@ -350,7 +355,8 @@ typedef union
struct
{
enum apc_type type;
void *addr;
int __pad;
client_ptr_t addr;
} unmap_view;
struct
{
@ -376,22 +382,22 @@ typedef union
{
enum apc_type type;
unsigned int status;
void *addr;
client_ptr_t addr;
mem_size_t size;
} virtual_alloc;
struct
{
enum apc_type type;
unsigned int status;
void *addr;
client_ptr_t addr;
mem_size_t size;
} virtual_free;
struct
{
enum apc_type type;
unsigned int status;
void *base;
void *alloc_base;
client_ptr_t base;
client_ptr_t alloc_base;
mem_size_t size;
unsigned int state;
unsigned int prot;
@ -402,7 +408,7 @@ typedef union
{
enum apc_type type;
unsigned int status;
void *addr;
client_ptr_t addr;
mem_size_t size;
unsigned int prot;
} virtual_protect;
@ -410,28 +416,28 @@ typedef union
{
enum apc_type type;
unsigned int status;
const void *addr;
client_ptr_t addr;
mem_size_t size;
} virtual_flush;
struct
{
enum apc_type type;
unsigned int status;
void *addr;
client_ptr_t addr;
mem_size_t size;
} virtual_lock;
struct
{
enum apc_type type;
unsigned int status;
void *addr;
client_ptr_t addr;
mem_size_t size;
} virtual_unlock;
struct
{
enum apc_type type;
unsigned int status;
void *addr;
client_ptr_t addr;
mem_size_t size;
} map_view;
struct
@ -870,9 +876,9 @@ struct select_request
struct select_reply
{
struct reply_header __header;
obj_handle_t apc_handle;
timeout_t timeout;
apc_call_t call;
obj_handle_t apc_handle;
};
#define SELECT_ALL 1
#define SELECT_ALERTABLE 2
@ -5052,6 +5058,6 @@ union generic_reply
struct set_window_layered_info_reply set_window_layered_info_reply;
};
#define SERVER_PROTOCOL_VERSION 366
#define SERVER_PROTOCOL_VERSION 367
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */

View File

@ -294,6 +294,7 @@ typedef union
struct
{
enum apc_type type; /* APC_TIMER */
int __pad;
client_ptr_t func; /* void (__stdcall *func)(void*, unsigned int, unsigned int); */
timeout_t time; /* absolute time of expiration */
client_ptr_t arg; /* user argument */
@ -309,54 +310,58 @@ typedef union
struct
{
enum apc_type type; /* APC_VIRTUAL_ALLOC */
void *addr; /* requested address */
unsigned int op_type; /* type of operation */
client_ptr_t addr; /* requested address */
mem_size_t size; /* allocation size */
unsigned int zero_bits; /* allocation alignment */
unsigned int op_type; /* type of operation */
unsigned int prot; /* memory protection flags */
} virtual_alloc;
struct
{
enum apc_type type; /* APC_VIRTUAL_FREE */
void *addr; /* requested address */
mem_size_t size; /* allocation size */
unsigned int op_type; /* type of operation */
client_ptr_t addr; /* requested address */
mem_size_t size; /* allocation size */
} virtual_free;
struct
{
enum apc_type type; /* APC_VIRTUAL_QUERY */
const void *addr; /* requested address */
int __pad;
client_ptr_t addr; /* requested address */
} virtual_query;
struct
{
enum apc_type type; /* APC_VIRTUAL_PROTECT */
void *addr; /* requested address */
mem_size_t size; /* requested size */
unsigned int prot; /* new protection flags */
client_ptr_t addr; /* requested address */
mem_size_t size; /* requested size */
} virtual_protect;
struct
{
enum apc_type type; /* APC_VIRTUAL_FLUSH */
const void *addr; /* requested address */
int __pad;
client_ptr_t addr; /* requested address */
mem_size_t size; /* requested size */
} virtual_flush;
struct
{
enum apc_type type; /* APC_VIRTUAL_LOCK */
void *addr; /* requested address */
int __pad;
client_ptr_t addr; /* requested address */
mem_size_t size; /* requested size */
} virtual_lock;
struct
{
enum apc_type type; /* APC_VIRTUAL_UNLOCK */
void *addr; /* requested address */
int __pad;
client_ptr_t addr; /* requested address */
mem_size_t size; /* requested size */
} virtual_unlock;
struct
{
enum apc_type type; /* APC_MAP_VIEW */
obj_handle_t handle; /* mapping handle */
void *addr; /* requested address */
client_ptr_t addr; /* requested address */
mem_size_t size; /* allocation size */
file_pos_t offset; /* file offset */
unsigned int zero_bits; /* allocation alignment */
@ -366,7 +371,8 @@ typedef union
struct
{
enum apc_type type; /* APC_UNMAP_VIEW */
void *addr; /* view address */
int __pad;
client_ptr_t addr; /* view address */
} unmap_view;
struct
{
@ -392,22 +398,22 @@ typedef union
{
enum apc_type type; /* APC_VIRTUAL_ALLOC */
unsigned int status; /* status returned by call */
void *addr; /* resulting address */
client_ptr_t addr; /* resulting address */
mem_size_t size; /* resulting size */
} virtual_alloc;
struct
{
enum apc_type type; /* APC_VIRTUAL_FREE */
unsigned int status; /* status returned by call */
void *addr; /* resulting address */
client_ptr_t addr; /* resulting address */
mem_size_t size; /* resulting size */
} virtual_free;
struct
{
enum apc_type type; /* APC_VIRTUAL_QUERY */
unsigned int status; /* status returned by call */
void *base; /* resulting base address */
void *alloc_base;/* resulting allocation base */
client_ptr_t base; /* resulting base address */
client_ptr_t alloc_base;/* resulting allocation base */
mem_size_t size; /* resulting region size */
unsigned int state; /* resulting region state */
unsigned int prot; /* resulting region protection */
@ -418,7 +424,7 @@ typedef union
{
enum apc_type type; /* APC_VIRTUAL_PROTECT */
unsigned int status; /* status returned by call */
void *addr; /* resulting address */
client_ptr_t addr; /* resulting address */
mem_size_t size; /* resulting size */
unsigned int prot; /* old protection flags */
} virtual_protect;
@ -426,28 +432,28 @@ typedef union
{
enum apc_type type; /* APC_VIRTUAL_FLUSH */
unsigned int status; /* status returned by call */
const void *addr; /* resulting address */
client_ptr_t addr; /* resulting address */
mem_size_t size; /* resulting size */
} virtual_flush;
struct
{
enum apc_type type; /* APC_VIRTUAL_LOCK */
unsigned int status; /* status returned by call */
void *addr; /* resulting address */
client_ptr_t addr; /* resulting address */
mem_size_t size; /* resulting size */
} virtual_lock;
struct
{
enum apc_type type; /* APC_VIRTUAL_UNLOCK */
unsigned int status; /* status returned by call */
void *addr; /* resulting address */
client_ptr_t addr; /* resulting address */
mem_size_t size; /* resulting size */
} virtual_unlock;
struct
{
enum apc_type type; /* APC_MAP_VIEW */
unsigned int status; /* status returned by call */
void *addr; /* resulting address */
client_ptr_t addr; /* resulting address */
mem_size_t size; /* resulting size */
} map_view;
struct
@ -755,9 +761,9 @@ typedef union
VARARG(result,apc_result); /* result of previous APC */
VARARG(handles,handles); /* handles to select on */
@REPLY
obj_handle_t apc_handle; /* handle to next APC */
timeout_t timeout; /* timeout converted to absolute */
apc_call_t call; /* APC call arguments */
obj_handle_t apc_handle; /* handle to next APC */
@END
#define SELECT_ALL 1
#define SELECT_ALERTABLE 2

View File

@ -134,40 +134,54 @@ static void dump_apc_call( const apc_call_t *call )
get_status_name(call->async_io.status) );
break;
case APC_VIRTUAL_ALLOC:
fprintf( stderr, "APC_VIRTUAL_ALLOC,addr=%p,size=", call->virtual_alloc.addr );
fprintf( stderr, "APC_VIRTUAL_ALLOC,addr==" );
dump_uint64( &call->virtual_alloc.addr );
fprintf( stderr, ",size=" );
dump_uint64( &call->virtual_alloc.size );
fprintf( stderr, ",zero_bits=%u,op_type=%x,prot=%x",
call->virtual_alloc.zero_bits, call->virtual_alloc.op_type,
call->virtual_alloc.prot );
break;
case APC_VIRTUAL_FREE:
fprintf( stderr, "APC_VIRTUAL_FREE,addr=%p,size=", call->virtual_free.addr );
fprintf( stderr, "APC_VIRTUAL_FREE,addr=" );
dump_uint64( &call->virtual_free.addr );
fprintf( stderr, ",size=" );
dump_uint64( &call->virtual_free.size );
fprintf( stderr, ",op_type=%x", call->virtual_free.op_type );
break;
case APC_VIRTUAL_QUERY:
fprintf( stderr, "APC_VIRTUAL_QUERY,addr=%p", call->virtual_query.addr );
fprintf( stderr, "APC_VIRTUAL_QUERY,addr=" );
dump_uint64( &call->virtual_query.addr );
break;
case APC_VIRTUAL_PROTECT:
fprintf( stderr, "APC_VIRTUAL_PROTECT,addr=%p,size=", call->virtual_protect.addr );
fprintf( stderr, "APC_VIRTUAL_PROTECT,addr=" );
dump_uint64( &call->virtual_protect.addr );
fprintf( stderr, ",size=" );
dump_uint64( &call->virtual_protect.size );
fprintf( stderr, ",prot=%x", call->virtual_protect.prot );
break;
case APC_VIRTUAL_FLUSH:
fprintf( stderr, "APC_VIRTUAL_FLUSH,addr=%p,size=", call->virtual_flush.addr );
fprintf( stderr, "APC_VIRTUAL_FLUSH,addr=" );
dump_uint64( &call->virtual_flush.addr );
fprintf( stderr, ",size=" );
dump_uint64( &call->virtual_flush.size );
break;
case APC_VIRTUAL_LOCK:
fprintf( stderr, "APC_VIRTUAL_LOCK,addr=%p,size=", call->virtual_lock.addr );
fprintf( stderr, "APC_VIRTUAL_LOCK,addr=" );
dump_uint64( &call->virtual_lock.addr );
fprintf( stderr, ",size=" );
dump_uint64( &call->virtual_lock.size );
break;
case APC_VIRTUAL_UNLOCK:
fprintf( stderr, "APC_VIRTUAL_UNLOCK,addr=%p,size=", call->virtual_unlock.addr );
fprintf( stderr, "APC_VIRTUAL_UNLOCK,addr=" );
dump_uint64( &call->virtual_unlock.addr );
fprintf( stderr, ",size=" );
dump_uint64( &call->virtual_unlock.size );
break;
case APC_MAP_VIEW:
fprintf( stderr, "APC_MAP_VIEW,handle=%04x,addr=%p,size=",
call->map_view.handle, call->map_view.addr );
fprintf( stderr, "APC_MAP_VIEW,handle=%04x,addr=", call->map_view.handle );
dump_uint64( &call->map_view.addr );
fprintf( stderr, ",size=" );
dump_uint64( &call->map_view.size );
fprintf( stderr, ",offset=" );
dump_uint64( &call->map_view.offset );
@ -175,7 +189,8 @@ static void dump_apc_call( const apc_call_t *call )
call->map_view.zero_bits, call->map_view.alloc_type, call->map_view.prot );
break;
case APC_UNMAP_VIEW:
fprintf( stderr, "APC_UNMAP_VIEW,addr=%p", call->unmap_view.addr );
fprintf( stderr, "APC_UNMAP_VIEW,addr=" );
dump_uint64( &call->unmap_view.addr );
break;
case APC_CREATE_THREAD:
fprintf( stderr, "APC_CREATE_THREAD,func=%p,arg=%p,reserve=",
@ -204,48 +219,65 @@ static void dump_apc_result( const apc_result_t *result )
get_status_name( result->async_io.status ) );
break;
case APC_VIRTUAL_ALLOC:
fprintf( stderr, "APC_VIRTUAL_ALLOC,status=%s,addr=%p,size=",
get_status_name( result->virtual_alloc.status ), result->virtual_alloc.addr );
fprintf( stderr, "APC_VIRTUAL_ALLOC,status=%s,addr=",
get_status_name( result->virtual_alloc.status ));
dump_uint64( &result->virtual_alloc.addr );
fprintf( stderr, ",size=" );
dump_uint64( &result->virtual_alloc.size );
break;
case APC_VIRTUAL_FREE:
fprintf( stderr, "APC_VIRTUAL_FREE,status=%s,addr=%p,size=",
get_status_name( result->virtual_free.status ), result->virtual_free.addr );
fprintf( stderr, "APC_VIRTUAL_FREE,status=%s,addr=",
get_status_name( result->virtual_free.status ));
dump_uint64( &result->virtual_free.addr );
fprintf( stderr, ",size=" );
dump_uint64( &result->virtual_free.size );
break;
case APC_VIRTUAL_QUERY:
fprintf( stderr, "APC_VIRTUAL_QUERY,status=%s,base=%p,alloc_base=%p,size=",
get_status_name( result->virtual_query.status ),
result->virtual_query.base, result->virtual_query.alloc_base );
fprintf( stderr, "APC_VIRTUAL_QUERY,status=%s,base=",
get_status_name( result->virtual_query.status ));
dump_uint64( &result->virtual_query.base );
fprintf( stderr, ",alloc_base=" );
dump_uint64( &result->virtual_query.alloc_base );
fprintf( stderr, ",size=" );
dump_uint64( &result->virtual_query.size );
fprintf( stderr, ",state=%x,prot=%x,alloc_prot=%x,alloc_type=%x",
result->virtual_query.state, result->virtual_query.prot,
result->virtual_query.alloc_prot, result->virtual_query.alloc_type );
break;
case APC_VIRTUAL_PROTECT:
fprintf( stderr, "APC_VIRTUAL_PROTECT,status=%s,addr=%p,size=",
get_status_name( result->virtual_protect.status ), result->virtual_protect.addr );
fprintf( stderr, "APC_VIRTUAL_PROTECT,status=%s,addr=",
get_status_name( result->virtual_protect.status ));
dump_uint64( &result->virtual_protect.addr );
fprintf( stderr, ",size=" );
dump_uint64( &result->virtual_protect.size );
fprintf( stderr, ",prot=%x", result->virtual_protect.prot );
break;
case APC_VIRTUAL_FLUSH:
fprintf( stderr, "APC_VIRTUAL_FLUSH,status=%s,addr=%p,size=",
get_status_name( result->virtual_flush.status ), result->virtual_flush.addr );
fprintf( stderr, "APC_VIRTUAL_FLUSH,status=%s,addr=",
get_status_name( result->virtual_flush.status ));
dump_uint64( &result->virtual_flush.addr );
fprintf( stderr, ",size=" );
dump_uint64( &result->virtual_flush.size );
break;
case APC_VIRTUAL_LOCK:
fprintf( stderr, "APC_VIRTUAL_LOCK,status=%s,addr=%p,size=",
get_status_name( result->virtual_lock.status ), result->virtual_lock.addr );
fprintf( stderr, "APC_VIRTUAL_LOCK,status=%s,addr=",
get_status_name( result->virtual_lock.status ));
dump_uint64( &result->virtual_lock.addr );
fprintf( stderr, ",size=" );
dump_uint64( &result->virtual_lock.size );
break;
case APC_VIRTUAL_UNLOCK:
fprintf( stderr, "APC_VIRTUAL_UNLOCK,status=%s,addr=%p,size=",
get_status_name( result->virtual_unlock.status ), result->virtual_unlock.addr );
fprintf( stderr, "APC_VIRTUAL_UNLOCK,status=%s,addr=",
get_status_name( result->virtual_unlock.status ));
dump_uint64( &result->virtual_unlock.addr );
fprintf( stderr, ",size=" );
dump_uint64( &result->virtual_unlock.size );
break;
case APC_MAP_VIEW:
fprintf( stderr, "APC_MAP_VIEW,status=%s,addr=%p,size=",
get_status_name( result->map_view.status ), result->map_view.addr );
fprintf( stderr, "APC_MAP_VIEW,status=%s,addr=",
get_status_name( result->map_view.status ));
dump_uint64( &result->map_view.addr );
fprintf( stderr, ",size=" );
dump_uint64( &result->map_view.size );
break;
case APC_UNMAP_VIEW:
@ -1193,12 +1225,13 @@ static void dump_select_request( const struct select_request *req )
static void dump_select_reply( const struct select_reply *req )
{
fprintf( stderr, " apc_handle=%04x,", req->apc_handle );
fprintf( stderr, " timeout=" );
dump_timeout( &req->timeout );
fprintf( stderr, "," );
fprintf( stderr, " call=" );
dump_apc_call( &req->call );
fprintf( stderr, "," );
fprintf( stderr, " apc_handle=%04x", req->apc_handle );
}
static void dump_create_event_request( const struct create_event_request *req )

View File

@ -45,8 +45,8 @@ my %formats =
"timeout_t" => [ 8, 8, "&dump_timeout" ],
"rectangle_t" => [ 16, 4, "&dump_rectangle" ],
"char_info_t" => [ 4, 2, "&dump_char_info" ],
"apc_call_t" => [ 40, 8, "&dump_apc_call" ],
"apc_result_t" => [ 40, 8, "&dump_apc_result" ],
"apc_call_t" => [ 44, 8, "&dump_apc_call" ],
"apc_result_t" => [ 48, 8, "&dump_apc_result" ],
"async_data_t" => [ 32, 8, "&dump_async_data" ],
"luid_t" => [ 8, 4, "&dump_luid" ],
"ioctl_code_t" => [ 4, 4, "&dump_ioctl_code" ],