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
9b60b671
Commit
9b60b671
authored
Sep 28, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Don't release the low address space reservation on wow64.
parent
a81c5350
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
31 deletions
+12
-31
virtual.c
dlls/ntdll/unix/virtual.c
+12
-31
No files found.
dlls/ntdll/unix/virtual.c
View file @
9b60b671
...
@@ -4110,12 +4110,6 @@ void virtual_set_force_exec( BOOL enable )
...
@@ -4110,12 +4110,6 @@ void virtual_set_force_exec( BOOL enable )
server_leave_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
server_leave_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
}
}
struct
free_range
{
char
*
base
;
char
*
limit
;
};
/* free reserved areas within a given range */
/* free reserved areas within a given range */
static
void
free_reserved_memory
(
char
*
base
,
char
*
limit
)
static
void
free_reserved_memory
(
char
*
base
,
char
*
limit
)
{
{
...
@@ -4142,6 +4136,8 @@ static void free_reserved_memory( char *base, char *limit )
...
@@ -4142,6 +4136,8 @@ static void free_reserved_memory( char *base, char *limit )
}
}
}
}
#ifndef _WIN64
/***********************************************************************
/***********************************************************************
* virtual_release_address_space
* virtual_release_address_space
*
*
...
@@ -4149,33 +4145,14 @@ static void free_reserved_memory( char *base, char *limit )
...
@@ -4149,33 +4145,14 @@ static void free_reserved_memory( char *base, char *limit )
*/
*/
static
void
virtual_release_address_space
(
void
)
static
void
virtual_release_address_space
(
void
)
{
{
char
*
base
=
(
char
*
)
0x82000000
;
#ifndef __APPLE__
/* On macOS, we still want to free some of low memory, for OpenGL resources */
char
*
limit
=
get_wow_user_space_limit
();
if
(
user_space_limit
>
(
void
*
)
limit_2g
)
return
;
#if defined(__APPLE__) && !defined(__i386__)
/* On 64-bit macOS, don't release any address space.
* It needs to be reserved for use by Wow64
*/
return
;
#endif
if
(
limit
>
(
char
*
)
0xfffff000
)
return
;
/* 64-bit limit, nothing to do */
if
(
limit
>
base
)
{
free_reserved_memory
(
base
,
limit
);
#ifdef __APPLE__
/* On macOS, we still want to free some of low memory, for OpenGL resources */
base
=
(
char
*
)
0x40000000
;
#else
return
;
#endif
#endif
}
free_reserved_memory
(
(
char
*
)
0x20000000
,
(
char
*
)
0x7f000000
);
else
base
=
(
char
*
)
0x20000000
;
free_reserved_memory
(
base
,
(
char
*
)
0x7f000000
);
}
}
#endif
/* _WIN64 */
/***********************************************************************
/***********************************************************************
* virtual_set_large_address_space
* virtual_set_large_address_space
...
@@ -4191,6 +4168,7 @@ void virtual_set_large_address_space(void)
...
@@ -4191,6 +4168,7 @@ void virtual_set_large_address_space(void)
free_reserved_memory
(
0
,
(
char
*
)
0x7ffe0000
);
free_reserved_memory
(
0
,
(
char
*
)
0x7ffe0000
);
#else
#else
if
(
!
(
main_image_info
.
ImageCharacteristics
&
IMAGE_FILE_LARGE_ADDRESS_AWARE
))
return
;
if
(
!
(
main_image_info
.
ImageCharacteristics
&
IMAGE_FILE_LARGE_ADDRESS_AWARE
))
return
;
free_reserved_memory
(
(
char
*
)
0x80000000
,
address_space_limit
);
#endif
#endif
user_space_limit
=
working_set_limit
=
address_space_limit
;
user_space_limit
=
working_set_limit
=
address_space_limit
;
}
}
...
@@ -4564,9 +4542,12 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si
...
@@ -4564,9 +4542,12 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si
/* avoid freeing the DOS area when a broken app passes a NULL pointer */
/* avoid freeing the DOS area when a broken app passes a NULL pointer */
if
(
!
base
)
if
(
!
base
)
{
{
#ifndef _WIN64
/* address 1 is magic to mean release reserved space */
/* address 1 is magic to mean release reserved space */
if
(
addr
==
(
void
*
)
1
&&
!
size
&&
type
==
MEM_RELEASE
)
virtual_release_address_space
();
if
(
addr
==
(
void
*
)
1
&&
!
size
&&
type
==
MEM_RELEASE
)
virtual_release_address_space
();
else
status
=
STATUS_INVALID_PARAMETER
;
else
#endif
status
=
STATUS_INVALID_PARAMETER
;
}
}
else
if
(
!
(
view
=
find_view
(
base
,
0
)))
status
=
STATUS_MEMORY_NOT_ALLOCATED
;
else
if
(
!
(
view
=
find_view
(
base
,
0
)))
status
=
STATUS_MEMORY_NOT_ALLOCATED
;
else
if
(
!
is_view_valloc
(
view
))
status
=
STATUS_INVALID_PARAMETER
;
else
if
(
!
is_view_valloc
(
view
))
status
=
STATUS_INVALID_PARAMETER
;
...
...
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