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
9dd6a660
Commit
9dd6a660
authored
Nov 10, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
May 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Pass allocation type to map_view().
Based on a patch by Nikolay Sivov.
parent
376bd69c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
virtual.c
dlls/ntdll/unix/virtual.c
+8
-7
No files found.
dlls/ntdll/unix/virtual.c
View file @
9dd6a660
...
...
@@ -1970,8 +1970,9 @@ static NTSTATUS map_fixed_area( void *base, size_t size, unsigned int vprot )
* virtual_mutex must be held by caller.
*/
static
NTSTATUS
map_view
(
struct
file_view
**
view_ret
,
void
*
base
,
size_t
size
,
int
top_down
,
unsigned
int
vprot
,
ULONG_PTR
limit
,
size_t
align_mask
)
unsigned
int
alloc_type
,
unsigned
int
vprot
,
ULONG_PTR
limit
,
size_t
align_mask
)
{
int
top_down
=
alloc_type
&
MEM_TOP_DOWN
;
void
*
ptr
;
NTSTATUS
status
;
...
...
@@ -2244,7 +2245,7 @@ static NTSTATUS allocate_dos_memory( struct file_view **view, unsigned int vprot
if
(
mmap_is_in_reserved_area
(
low_64k
,
dosmem_size
-
0x10000
)
!=
1
)
{
addr
=
anon_mmap_tryfixed
(
low_64k
,
dosmem_size
-
0x10000
,
unix_prot
,
0
);
if
(
addr
==
MAP_FAILED
)
return
map_view
(
view
,
NULL
,
dosmem_size
,
FALSE
,
vprot
,
0
,
0
);
if
(
addr
==
MAP_FAILED
)
return
map_view
(
view
,
NULL
,
dosmem_size
,
0
,
vprot
,
0
,
0
);
}
/* now try to allocate the low 64K too */
...
...
@@ -2724,9 +2725,9 @@ static NTSTATUS virtual_map_image( HANDLE mapping, ACCESS_MASK access, void **ad
if
((
ULONG_PTR
)
base
!=
image_info
->
base
)
base
=
NULL
;
if
((
char
*
)
base
>=
(
char
*
)
address_space_start
)
/* make sure the DOS area remains free */
status
=
map_view
(
&
view
,
base
,
size
,
alloc_type
&
MEM_TOP_DOWN
,
vprot
,
limit
,
0
);
status
=
map_view
(
&
view
,
base
,
size
,
alloc_type
,
vprot
,
limit
,
0
);
if
(
status
)
status
=
map_view
(
&
view
,
NULL
,
size
,
alloc_type
&
MEM_TOP_DOWN
,
vprot
,
limit
,
0
);
if
(
status
)
status
=
map_view
(
&
view
,
NULL
,
size
,
alloc_type
,
vprot
,
limit
,
0
);
if
(
status
)
goto
done
;
status
=
map_image_into_view
(
view
,
filename
,
unix_fd
,
base
,
image_info
,
...
...
@@ -2850,7 +2851,7 @@ static unsigned int virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG_P
server_enter_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
res
=
map_view
(
&
view
,
base
,
size
,
alloc_type
&
MEM_TOP_DOWN
,
vprot
,
limit
,
0
);
res
=
map_view
(
&
view
,
base
,
size
,
alloc_type
,
vprot
,
limit
,
0
);
if
(
res
)
goto
done
;
TRACE
(
"handle=%p size=%lx offset=%s
\n
"
,
handle
,
size
,
wine_dbgstr_longlong
(
offset
.
QuadPart
)
);
...
...
@@ -3419,7 +3420,7 @@ NTSTATUS virtual_alloc_thread_stack( INITIAL_TEB *stack, ULONG_PTR limit, SIZE_T
server_enter_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
status
=
map_view
(
&
view
,
NULL
,
size
,
FALSE
,
VPROT_READ
|
VPROT_WRITE
|
VPROT_COMMITTED
,
limit
,
0
);
status
=
map_view
(
&
view
,
NULL
,
size
,
0
,
VPROT_READ
|
VPROT_WRITE
|
VPROT_COMMITTED
,
limit
,
0
);
if
(
status
!=
STATUS_SUCCESS
)
goto
done
;
#ifdef VALGRIND_STACK_REGISTER
...
...
@@ -4093,7 +4094,7 @@ static NTSTATUS allocate_virtual_memory( void **ret, SIZE_T *size_ptr, ULONG typ
if
(
vprot
&
VPROT_WRITECOPY
)
status
=
STATUS_INVALID_PAGE_PROTECTION
;
else
if
(
is_dos_memory
)
status
=
allocate_dos_memory
(
&
view
,
vprot
);
else
status
=
map_view
(
&
view
,
base
,
size
,
type
&
MEM_TOP_DOWN
,
vprot
,
limit
,
else
status
=
map_view
(
&
view
,
base
,
size
,
type
,
vprot
,
limit
,
align
?
align
-
1
:
granularity_mask
);
if
(
status
==
STATUS_SUCCESS
)
base
=
view
->
base
;
...
...
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