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
ffab9d97
Commit
ffab9d97
authored
Sep 15, 2022
by
Witold Baryluk
Committed by
Alexandre Julliard
Sep 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use pread in NtQueryVirtualMemory(MemoryWorkingSetExInformation).
1 syscall instead of 2 syscalls. Faster and simpler code.
parent
96a4a2b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
virtual.c
dlls/ntdll/unix/virtual.c
+7
-7
No files found.
dlls/ntdll/unix/virtual.c
View file @
ffab9d97
...
...
@@ -4203,7 +4203,7 @@ static NTSTATUS get_working_set_ex( HANDLE process, LPCVOID addr,
MEMORY_WORKING_SET_EX_INFORMATION
*
info
,
SIZE_T
len
,
SIZE_T
*
res_len
)
{
FILE
*
f
=
NULL
;
int
pagemap_fd
;
MEMORY_WORKING_SET_EX_INFORMATION
*
p
;
sigset_t
sigset
;
...
...
@@ -4266,8 +4266,8 @@ static NTSTATUS get_working_set_ex( HANDLE process, LPCVOID addr,
procstat_close
(
pstat
);
}
#else
f
=
fopen
(
"/proc/self/pagemap"
,
"rb"
);
if
(
!
f
)
pagemap_fd
=
open
(
"/proc/self/pagemap"
,
O_RDONLY
,
0
);
if
(
pagemap_fd
==
-
1
)
{
static
int
once
;
if
(
!
once
++
)
WARN
(
"unable to open /proc/self/pagemap
\n
"
);
...
...
@@ -4286,8 +4286,8 @@ static NTSTATUS get_working_set_ex( HANDLE process, LPCVOID addr,
get_committed_size
(
view
,
p
->
VirtualAddress
,
&
vprot
,
VPROT_COMMITTED
)
&&
(
vprot
&
VPROT_COMMITTED
))
{
if
(
!
f
||
fseek
(
f
,
((
UINT_PTR
)
p
->
VirtualAddress
>>
page_shift
)
*
sizeof
(
pagemap
),
SEEK_SET
)
==
-
1
||
fread
(
&
pagemap
,
sizeof
(
pagemap
),
1
,
f
)
!=
1
)
if
(
pagemap_fd
==
-
1
||
pread
(
pagemap_fd
,
&
pagemap
,
sizeof
(
pagemap
),
((
UINT_PTR
)
p
->
VirtualAddress
>>
page_shift
)
*
sizeof
(
pagemap
)
)
!=
sizeof
(
pagemap
)
)
{
/* If we don't have pagemap information, default to invalid. */
pagemap
=
0
;
...
...
@@ -4304,8 +4304,8 @@ static NTSTATUS get_working_set_ex( HANDLE process, LPCVOID addr,
server_leave_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
#endif
if
(
f
)
fclose
(
f
);
if
(
pagemap_fd
!=
-
1
)
close
(
pagemap_fd
);
if
(
res_len
)
*
res_len
=
(
UINT_PTR
)
p
-
(
UINT_PTR
)
info
;
return
STATUS_SUCCESS
;
...
...
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