Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
29d97591
Commit
29d97591
authored
Dec 17, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Use mem_size_t instead of file_pos_t for memory mapping sizes.
parent
401f4b71
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
19 deletions
+24
-19
virtual.c
dlls/ntdll/virtual.c
+8
-4
server_protocol.h
include/wine/server_protocol.h
+4
-4
mapping.c
server/mapping.c
+6
-6
protocol.def
server/protocol.def
+4
-4
make_requests
tools/make_requests
+2
-1
No files found.
dlls/ntdll/virtual.c
View file @
29d97591
...
...
@@ -2210,7 +2210,7 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
SECTION_INHERIT
inherit
,
ULONG
alloc_type
,
ULONG
protect
)
{
NTSTATUS
res
;
ULONGLONG
full_size
;
mem_size_t
full_size
;
ACCESS_MASK
access
;
SIZE_T
size
=
0
;
SIZE_T
mask
=
get_mask
(
zero_bits
);
...
...
@@ -2295,9 +2295,13 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
if
(
res
)
return
res
;
size
=
full_size
;
if
(
sizeof
(
size
)
<
sizeof
(
full_size
)
&&
(
size
!=
full_size
))
ERR
(
"Sizes larger than 4Gb (%x%08x) not supported on this platform
\n
"
,
(
DWORD
)(
full_size
>>
32
),
(
DWORD
)
full_size
);
if
(
size
!=
full_size
)
{
WARN
(
"Sizes larger than 4Gb (%s) not supported on this platform
\n
"
,
wine_dbgstr_longlong
(
full_size
)
);
if
(
dup_mapping
)
NtClose
(
dup_mapping
);
return
STATUS_INVALID_PARAMETER
;
}
if
((
res
=
server_get_unix_fd
(
handle
,
0
,
&
unix_handle
,
&
needs_close
,
NULL
,
NULL
)))
goto
done
;
...
...
include/wine/server_protocol.h
View file @
29d97591
...
...
@@ -1673,7 +1673,7 @@ struct create_mapping_request
struct
request_header
__header
;
unsigned
int
access
;
unsigned
int
attributes
;
file_pos
_t
size
;
mem_size
_t
size
;
unsigned
int
protect
;
obj_handle_t
file_handle
;
/* VARARG(objattr,object_attributes); */
...
...
@@ -1725,7 +1725,7 @@ struct get_mapping_info_request
struct
get_mapping_info_reply
{
struct
reply_header
__header
;
file_pos
_t
size
;
mem_size
_t
size
;
int
protect
;
int
header_size
;
void
*
base
;
...
...
@@ -1744,7 +1744,7 @@ struct get_mapping_committed_range_request
struct
get_mapping_committed_range_reply
{
struct
reply_header
__header
;
file_pos
_t
size
;
mem_size
_t
size
;
int
committed
;
};
...
...
@@ -1755,7 +1755,7 @@ struct add_mapping_committed_range_request
struct
request_header
__header
;
obj_handle_t
handle
;
file_pos_t
offset
;
file_pos
_t
size
;
mem_size
_t
size
;
};
struct
add_mapping_committed_range_reply
{
...
...
server/mapping.c
View file @
29d97591
...
...
@@ -54,7 +54,7 @@ struct ranges
struct
mapping
{
struct
object
obj
;
/* object header */
file_pos
_t
size
;
/* mapping size */
mem_size
_t
size
;
/* mapping size */
int
protect
;
/* protection flags */
struct
file
*
file
;
/* file mapped */
int
header_size
;
/* size of headers (for PE image mapping) */
...
...
@@ -199,7 +199,7 @@ static void add_committed_range( struct mapping *mapping, file_pos_t start, file
}
/* find the range containing start and return whether it's committed */
static
int
find_committed_range
(
struct
mapping
*
mapping
,
file_pos_t
start
,
file_pos
_t
*
size
)
static
int
find_committed_range
(
struct
mapping
*
mapping
,
file_pos_t
start
,
mem_size
_t
*
size
)
{
unsigned
int
i
;
struct
range
*
ranges
;
...
...
@@ -231,7 +231,7 @@ static int build_shared_mapping( struct mapping *mapping, int fd,
IMAGE_SECTION_HEADER
*
sec
,
unsigned
int
nb_sec
)
{
unsigned
int
i
;
file_pos
_t
total_size
;
mem_size
_t
total_size
;
size_t
file_size
,
map_size
,
max_size
;
off_t
shared_pos
,
read_pos
,
write_pos
;
char
*
buffer
=
NULL
;
...
...
@@ -360,7 +360,7 @@ static int get_image_params( struct mapping *mapping )
}
/* get the size of the unix file associated with the mapping */
static
inline
int
get_file_size
(
struct
file
*
file
,
file_pos
_t
*
size
)
static
inline
int
get_file_size
(
struct
file
*
file
,
mem_size
_t
*
size
)
{
struct
stat
st
;
int
unix_fd
=
get_file_unix_fd
(
file
);
...
...
@@ -371,7 +371,7 @@ static inline int get_file_size( struct file *file, file_pos_t *size )
}
static
struct
object
*
create_mapping
(
struct
directory
*
root
,
const
struct
unicode_str
*
name
,
unsigned
int
attr
,
file_pos
_t
size
,
int
protect
,
unsigned
int
attr
,
mem_size
_t
size
,
int
protect
,
obj_handle_t
handle
,
const
struct
security_descriptor
*
sd
)
{
struct
mapping
*
mapping
;
...
...
@@ -440,7 +440,7 @@ static struct object *create_mapping( struct directory *root, const struct unico
if
(
!
(
mapping
->
file
=
create_temp_file
(
access
)))
goto
error
;
if
(
!
grow_file
(
mapping
->
file
,
size
))
goto
error
;
}
mapping
->
size
=
(
size
+
page_mask
)
&
~
((
file_pos
_t
)
page_mask
);
mapping
->
size
=
(
size
+
page_mask
)
&
~
((
mem_size
_t
)
page_mask
);
mapping
->
protect
=
protect
;
return
&
mapping
->
obj
;
...
...
server/protocol.def
View file @
29d97591
...
...
@@ -1318,7 +1318,7 @@ enum char_info_mode
@REQ(create_mapping)
unsigned int access; /* wanted access rights */
unsigned int attributes; /* object attributes */
file_pos
_t size; /* mapping size */
mem_size
_t size; /* mapping size */
unsigned int protect; /* protection flags (see below) */
obj_handle_t file_handle; /* file handle */
VARARG(objattr,object_attributes); /* object attributes */
...
...
@@ -1357,7 +1357,7 @@ enum char_info_mode
obj_handle_t handle; /* handle to the mapping */
unsigned int access; /* wanted access rights */
@REPLY
file_pos
_t size; /* mapping size */
mem_size
_t size; /* mapping size */
int protect; /* protection flags */
int header_size; /* header size (for VPROT_IMAGE mapping) */
void* base; /* default base addr (for VPROT_IMAGE mapping) */
...
...
@@ -1371,7 +1371,7 @@ enum char_info_mode
obj_handle_t handle; /* handle to the mapping */
file_pos_t offset; /* starting offset (page-aligned, in bytes) */
@REPLY
file_pos
_t size; /* size of range starting at offset (page-aligned, in bytes) */
mem_size
_t size; /* size of range starting at offset (page-aligned, in bytes) */
int committed; /* whether it is a committed range */
@END
...
...
@@ -1380,7 +1380,7 @@ enum char_info_mode
@REQ(add_mapping_committed_range)
obj_handle_t handle; /* handle to the mapping */
file_pos_t offset; /* starting offset (page-aligned, in bytes) */
file_pos
_t size; /* size to set (page-aligned, in bytes) or 0 if only retrieving */
mem_size
_t size; /* size to set (page-aligned, in bytes) or 0 if only retrieving */
@END
...
...
tools/make_requests
View file @
29d97591
...
...
@@ -38,6 +38,8 @@ my %formats =
"thread_id_t"
=>
[
4
,
4
,
"%04x"
],
"lparam_t"
=>
[
4
,
4
,
"%lx"
],
"apc_param_t"
=>
[
4
,
4
,
"%lx"
],
"file_pos_t"
=>
[
8
,
8
,
"&dump_uint64"
],
"mem_size_t"
=>
[
8
,
8
,
"&dump_uint64"
],
"timeout_t"
=>
[
8
,
8
,
"&dump_timeout"
],
"rectangle_t"
=>
[
16
,
4
,
"&dump_rectangle"
],
"char_info_t"
=>
[
4
,
2
,
"&dump_char_info"
],
...
...
@@ -46,7 +48,6 @@ my %formats =
"async_data_t"
=>
[
24
,
4
,
"&dump_async_data"
],
"luid_t"
=>
[
8
,
4
,
"&dump_luid"
],
"ioctl_code_t"
=>
[
4
,
4
,
"&dump_ioctl_code"
],
"file_pos_t"
=>
[
8
,
8
,
"&dump_uint64"
],
);
my
@requests
=
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment