Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
c92dcf25
Commit
c92dcf25
authored
Jun 01, 2017
by
Michael Müller
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix holes in ELF mappings. (v2)
Based on a patch by Andrew Wesie.
parent
f39deecc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
virtual.c
dlls/ntdll/unix/virtual.c
+23
-0
psapi_main.c
dlls/psapi/tests/psapi_main.c
+13
-1
No files found.
dlls/ntdll/unix/virtual.c
View file @
c92dcf25
...
...
@@ -1211,6 +1211,16 @@ static inline BOOL is_write_watch_range( const void *addr, size_t size )
/***********************************************************************
* is_system_range
*/
static
inline
BOOL
is_system_range
(
const
void
*
addr
,
size_t
size
)
{
struct
file_view
*
view
=
find_view
(
addr
,
size
);
return
view
&&
(
view
->
protect
&
VPROT_SYSTEM
);
}
/***********************************************************************
* find_view_range
*
* Find the first view overlapping at least part of the specified range.
...
...
@@ -3416,6 +3426,19 @@ NTSTATUS virtual_handle_fault( void *addr, DWORD err, void *stack )
/* ignore fault if page is writable now */
if
(
get_unix_prot
(
get_page_vprot
(
page
)
)
&
PROT_WRITE
)
ret
=
STATUS_SUCCESS
;
}
else
if
(
!
err
&&
(
get_unix_prot
(
vprot
)
&
PROT_READ
)
&&
is_system_range
(
page
,
page_size
))
{
int
unix_prot
=
get_unix_prot
(
vprot
);
unsigned
char
vec
;
mprotect_range
(
page
,
page_size
,
0
,
0
);
if
(
!
mincore
(
page
,
page_size
,
&
vec
)
&&
(
vec
&
1
))
ret
=
STATUS_SUCCESS
;
else
if
(
anon_mmap_fixed
(
page
,
page_size
,
unix_prot
,
0
)
==
page
)
ret
=
STATUS_SUCCESS
;
else
set_page_vprot_bits
(
page
,
page_size
,
0
,
VPROT_READ
|
VPROT_EXEC
);
}
mutex_unlock
(
&
virtual_mutex
);
return
ret
;
}
...
...
dlls/psapi/tests/psapi_main.c
View file @
c92dcf25
...
...
@@ -194,6 +194,7 @@ static void test_EnumProcessModules(void)
static
void
test_GetModuleInformation
(
void
)
{
HMODULE
hMod
=
GetModuleHandleA
(
NULL
);
DWORD
*
tmp
,
counter
=
0
;
MODULEINFO
info
;
DWORD
ret
;
...
...
@@ -213,10 +214,21 @@ static void test_GetModuleInformation(void)
GetModuleInformation
(
hpQV
,
hMod
,
&
info
,
sizeof
(
info
)
-
1
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"expected error=ERROR_INSUFFICIENT_BUFFER but got %ld
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
GetModuleInformation
(
hpQV
,
hMod
,
&
info
,
sizeof
(
info
));
ok
(
ret
==
1
,
"failed with %ld
\n
"
,
GetLastError
());
ok
(
info
.
lpBaseOfDll
==
hMod
,
"lpBaseOfDll=%p hMod=%p
\n
"
,
info
.
lpBaseOfDll
,
hMod
);
hMod
=
LoadLibraryA
(
"shell32.dll"
);
ok
(
hMod
!=
NULL
,
"Failed to load shell32.dll, error: %lu
\n
"
,
GetLastError
());
ret
=
GetModuleInformation
(
hpQV
,
hMod
,
&
info
,
sizeof
(
info
));
ok
(
ret
==
1
,
"failed with %lu
\n
"
,
GetLastError
());
info
.
SizeOfImage
/=
sizeof
(
DWORD
);
for
(
tmp
=
(
DWORD
*
)
hMod
;
info
.
SizeOfImage
;
info
.
SizeOfImage
--
)
counter
^=
*
tmp
++
;
trace
(
"xor of shell32: %08lx
\n
"
,
counter
);
FreeLibrary
(
hMod
);
}
static
BOOL
check_with_margin
(
SIZE_T
perf
,
SIZE_T
sysperf
,
int
margin
)
...
...
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