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
8dc8b3e9
Commit
8dc8b3e9
authored
Sep 11, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Avoid accessing builtin views outside of the critical section.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a901fa9d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
virtual.c
dlls/ntdll/virtual.c
+15
-15
No files found.
dlls/ntdll/virtual.c
View file @
8dc8b3e9
...
...
@@ -1634,25 +1634,25 @@ NTSTATUS virtual_create_builtin_view( void *module )
server_enter_uninterrupted_section
(
&
csVirtual
,
&
sigset
);
status
=
create_view
(
&
view
,
base
,
size
,
SEC_IMAGE
|
SEC_FILE
|
VPROT_SYSTEM
|
VPROT_COMMITTED
|
VPROT_READ
|
VPROT_WRITECOPY
|
VPROT_EXEC
);
if
(
!
status
)
TRACE
(
"created %p-%p
\n
"
,
base
,
(
char
*
)
base
+
size
);
server_leave_uninterrupted_section
(
&
csVirtual
,
&
sigset
);
if
(
status
)
return
status
;
if
(
!
status
)
{
TRACE
(
"created %p-%p
\n
"
,
base
,
(
char
*
)
base
+
size
);
/* The PE header is always read-only, no write, no execute. */
set_page_vprot
(
view
->
base
,
page_size
,
VPROT_COMMITTED
|
VPROT_READ
);
/* The PE header is always read-only, no write, no execute. */
set_page_vprot
(
base
,
page_size
,
VPROT_COMMITTED
|
VPROT_READ
);
sec
=
(
IMAGE_SECTION_HEADER
*
)((
char
*
)
&
nt
->
OptionalHeader
+
nt
->
FileHeader
.
SizeOfOptionalHeader
);
for
(
i
=
0
;
i
<
nt
->
FileHeader
.
NumberOfSections
;
i
++
)
{
BYTE
flags
=
VPROT_COMMITTED
;
sec
=
(
IMAGE_SECTION_HEADER
*
)((
char
*
)
&
nt
->
OptionalHeader
+
nt
->
FileHeader
.
SizeOfOptionalHeader
);
for
(
i
=
0
;
i
<
nt
->
FileHeader
.
NumberOfSections
;
i
++
)
{
BYTE
flags
=
VPROT_COMMITTED
;
if
(
sec
[
i
].
Characteristics
&
IMAGE_SCN_MEM_EXECUTE
)
flags
|=
VPROT_EXEC
;
if
(
sec
[
i
].
Characteristics
&
IMAGE_SCN_MEM_READ
)
flags
|=
VPROT_READ
;
if
(
sec
[
i
].
Characteristics
&
IMAGE_SCN_MEM_WRITE
)
flags
|=
VPROT_WRITE
;
set_page_vprot
(
(
char
*
)
view
->
base
+
sec
[
i
].
VirtualAddress
,
sec
[
i
].
Misc
.
VirtualSize
,
flags
);
if
(
sec
[
i
].
Characteristics
&
IMAGE_SCN_MEM_EXECUTE
)
flags
|=
VPROT_EXEC
;
if
(
sec
[
i
].
Characteristics
&
IMAGE_SCN_MEM_READ
)
flags
|=
VPROT_READ
;
if
(
sec
[
i
].
Characteristics
&
IMAGE_SCN_MEM_WRITE
)
flags
|=
VPROT_WRITE
;
set_page_vprot
(
(
char
*
)
base
+
sec
[
i
].
VirtualAddress
,
sec
[
i
].
Misc
.
VirtualSize
,
flags
);
}
}
server_leave_uninterrupted_section
(
&
csVirtual
,
&
sigset
);
return
status
;
}
...
...
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