Commit c86ec644 authored by Alexandre Julliard's avatar Alexandre Julliard

server: Make a couple of fields smaller in the apc_call_t/apc_result_t structures.

parent 7560a890
......@@ -916,10 +916,10 @@ static BOOL invoke_apc( const apc_call_t *call, apc_result_t *result )
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;
result->virtual_query.alloc_prot = info.AllocationProtect;
result->virtual_query.alloc_type = info.Type;
result->virtual_query.state = info.State >> 12;
result->virtual_query.alloc_type = info.Type >> 16;
}
break;
}
......
......@@ -1963,10 +1963,10 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
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;
info->AllocationProtect = result.virtual_query.alloc_prot;
info->Type = result.virtual_query.alloc_type;
info->State = (DWORD)result.virtual_query.state << 12;
info->Type = (DWORD)result.virtual_query.alloc_type << 16;
if (info->RegionSize != result.virtual_query.size) /* truncated */
return STATUS_INVALID_PARAMETER; /* FIXME */
if (res_len) *res_len = sizeof(*info);
......@@ -2233,6 +2233,26 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
if ((offset.u.LowPart & mask) || (*addr_ptr && ((UINT_PTR)*addr_ptr & mask)))
return STATUS_INVALID_PARAMETER;
switch(protect)
{
case PAGE_NOACCESS:
access = SECTION_QUERY;
break;
case PAGE_READWRITE:
case PAGE_EXECUTE_READWRITE:
access = SECTION_QUERY | SECTION_MAP_WRITE;
break;
case PAGE_READONLY:
case PAGE_WRITECOPY:
case PAGE_EXECUTE:
case PAGE_EXECUTE_READ:
case PAGE_EXECUTE_WRITECOPY:
access = SECTION_QUERY | SECTION_MAP_READ;
break;
default:
return STATUS_INVALID_PARAMETER;
}
if (process != NtCurrentProcess())
{
apc_call_t call;
......@@ -2259,26 +2279,6 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
return result.map_view.status;
}
switch(protect)
{
case PAGE_NOACCESS:
access = SECTION_QUERY;
break;
case PAGE_READWRITE:
case PAGE_EXECUTE_READWRITE:
access = SECTION_QUERY | SECTION_MAP_WRITE;
break;
case PAGE_READONLY:
case PAGE_WRITECOPY:
case PAGE_EXECUTE:
case PAGE_EXECUTE_READ:
case PAGE_EXECUTE_WRITECOPY:
access = SECTION_QUERY | SECTION_MAP_READ;
break;
default:
return STATUS_INVALID_PARAMETER;
}
SERVER_START_REQ( get_mapping_info )
{
req->handle = wine_server_obj_handle( handle );
......
......@@ -349,9 +349,9 @@ typedef union
client_ptr_t addr;
mem_size_t size;
file_pos_t offset;
unsigned int zero_bits;
unsigned int alloc_type;
unsigned int prot;
unsigned short zero_bits;
unsigned short prot;
} map_view;
struct
{
......@@ -400,10 +400,10 @@ typedef union
client_ptr_t base;
client_ptr_t alloc_base;
mem_size_t size;
unsigned int state;
unsigned int prot;
unsigned int alloc_prot;
unsigned int alloc_type;
unsigned short state;
unsigned short prot;
unsigned short alloc_prot;
unsigned short alloc_type;
} virtual_query;
struct
{
......@@ -5059,6 +5059,6 @@ union generic_reply
struct set_window_layered_info_reply set_window_layered_info_reply;
};
#define SERVER_PROTOCOL_VERSION 368
#define SERVER_PROTOCOL_VERSION 369
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
......@@ -365,9 +365,9 @@ typedef union
client_ptr_t addr; /* requested address */
mem_size_t size; /* allocation size */
file_pos_t offset; /* file offset */
unsigned int zero_bits; /* allocation alignment */
unsigned int alloc_type;/* allocation type */
unsigned int prot; /* memory protection flags */
unsigned short zero_bits; /* allocation alignment */
unsigned short prot; /* memory protection flags */
} map_view;
struct
{
......@@ -416,10 +416,10 @@ typedef union
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 */
unsigned int alloc_prot;/* resulting allocation protection */
unsigned int alloc_type;/* resulting region allocation type */
unsigned short state; /* resulting region state */
unsigned short prot; /* resulting region protection */
unsigned short alloc_prot;/* resulting allocation protection */
unsigned short alloc_type;/* resulting region allocation type */
} virtual_query;
struct
{
......
......@@ -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" => [ 44, 8, "&dump_apc_call" ],
"apc_result_t" => [ 48, 8, "&dump_apc_result" ],
"apc_call_t" => [ 40, 8, "&dump_apc_call" ],
"apc_result_t" => [ 40, 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" ],
......
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