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
1f28e92e
Commit
1f28e92e
authored
Sep 23, 2021
by
Paul Gofman
Committed by
Alexandre Julliard
Sep 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Scan pages only once in get_basic_memory_info().
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b7fafabc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
virtual.c
dlls/ntdll/unix/virtual.c
+14
-14
No files found.
dlls/ntdll/unix/virtual.c
View file @
1f28e92e
...
...
@@ -2060,19 +2060,19 @@ done:
/***********************************************************************
* get_committed_size
*
* Get the size of the committed range starting at base.
* Get the size of the committed range
with equal masked vprot bytes
starting at base.
* Also return the protections for the first page.
*/
static
SIZE_T
get_committed_size
(
struct
file_view
*
view
,
void
*
base
,
BYTE
*
vprot
)
static
SIZE_T
get_committed_size
(
struct
file_view
*
view
,
void
*
base
,
BYTE
*
vprot
,
BYTE
vprot_mask
)
{
SIZE_T
offset
;
SIZE_T
offset
,
size
;
base
=
ROUND_ADDR
(
base
,
page_mask
);
offset
=
(
char
*
)
base
-
(
char
*
)
view
->
base
;
if
(
view
->
protect
&
SEC_RESERVE
)
{
SIZE_T
ret
=
0
;
size
=
0
;
*
vprot
=
get_page_vprot
(
base
);
...
...
@@ -2082,19 +2082,21 @@ static SIZE_T get_committed_size( struct file_view *view, void *base, BYTE *vpro
req
->
offset
=
offset
;
if
(
!
wine_server_call
(
req
))
{
ret
=
reply
->
size
;
size
=
reply
->
size
;
if
(
reply
->
committed
)
{
*
vprot
|=
VPROT_COMMITTED
;
set_page_vprot_bits
(
base
,
ret
,
VPROT_COMMITTED
,
0
);
set_page_vprot_bits
(
base
,
size
,
VPROT_COMMITTED
,
0
);
}
}
}
SERVER_END_REQ
;
return
ret
;
if
(
!
size
||
!
(
vprot_mask
&
~
VPROT_COMMITTED
))
return
size
;
}
else
size
=
view
->
size
-
offset
;
return
get_vprot_range_size
(
base
,
view
->
size
-
offset
,
VPROT_COMMITTED
,
vprot
);
return
get_vprot_range_size
(
base
,
size
,
vprot_mask
,
vprot
);
}
...
...
@@ -4045,7 +4047,7 @@ NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T
if
((
view
=
find_view
(
base
,
size
)))
{
/* Make sure all the pages are committed */
if
(
get_committed_size
(
view
,
base
,
&
vprot
)
>=
size
&&
(
vprot
&
VPROT_COMMITTED
))
if
(
get_committed_size
(
view
,
base
,
&
vprot
,
VPROT_COMMITTED
)
>=
size
&&
(
vprot
&
VPROT_COMMITTED
))
{
old
=
get_win32_prot
(
vprot
,
view
->
protect
);
status
=
set_protection
(
view
,
base
,
size
,
new_prot
);
...
...
@@ -4216,16 +4218,14 @@ static NTSTATUS get_basic_memory_info( HANDLE process, LPCVOID addr,
else
{
BYTE
vprot
;
SIZE_T
range_size
=
get_committed_size
(
view
,
base
,
&
vprot
);
info
->
RegionSize
=
get_committed_size
(
view
,
base
,
&
vprot
,
~
VPROT_WRITEWATCH
);
info
->
State
=
(
vprot
&
VPROT_COMMITTED
)
?
MEM_COMMIT
:
MEM_RESERVE
;
info
->
Protect
=
(
vprot
&
VPROT_COMMITTED
)
?
get_win32_prot
(
vprot
,
view
->
protect
)
:
0
;
info
->
AllocationProtect
=
get_win32_prot
(
view
->
protect
,
view
->
protect
);
if
(
view
->
protect
&
SEC_IMAGE
)
info
->
Type
=
MEM_IMAGE
;
else
if
(
view
->
protect
&
(
SEC_FILE
|
SEC_RESERVE
|
SEC_COMMIT
))
info
->
Type
=
MEM_MAPPED
;
else
info
->
Type
=
MEM_PRIVATE
;
info
->
RegionSize
=
get_vprot_range_size
(
base
,
range_size
,
~
VPROT_WRITEWATCH
,
&
vprot
);
}
server_leave_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
...
...
@@ -4271,8 +4271,8 @@ static NTSTATUS get_working_set_ex( HANDLE process, LPCVOID addr,
}
if
((
view
=
find_view
(
p
->
VirtualAddress
,
0
))
&&
get_committed_size
(
view
,
p
->
VirtualAddress
,
&
vprot
)
&&
(
vprot
&
VPROT_COMMITTED
))
get_committed_size
(
view
,
p
->
VirtualAddress
,
&
vprot
,
VPROT_COMMITTED
)
&&
(
vprot
&
VPROT_COMMITTED
))
{
p
->
VirtualAttributes
.
Valid
=
!
(
vprot
&
VPROT_GUARD
)
&&
(
vprot
&
0x0f
)
&&
(
pagemap
>>
63
);
p
->
VirtualAttributes
.
Shared
=
!
is_view_valloc
(
view
)
&&
((
pagemap
>>
61
)
&
1
);
...
...
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