Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7e947879
Commit
7e947879
authored
Nov 04, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add a noexec flag for memory views where we don't want to force exec permission.
parent
0b0b6c35
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
virtual.c
dlls/ntdll/virtual.c
+5
-3
server_protocol.h
include/wine/server_protocol.h
+1
-0
protocol.def
server/protocol.def
+1
-0
No files found.
dlls/ntdll/virtual.c
View file @
7e947879
...
...
@@ -473,7 +473,7 @@ static NTSTATUS create_view( struct file_view **view_ret, void *base, size_t siz
*
view_ret
=
view
;
VIRTUAL_DEBUG_DUMP_VIEW
(
view
);
if
(
force_exec_prot
&&
(
unix_prot
&
PROT_READ
)
&&
!
(
unix_prot
&
PROT_EXEC
))
if
(
force_exec_prot
&&
!
(
vprot
&
VPROT_NOEXEC
)
&&
(
unix_prot
&
PROT_READ
)
&&
!
(
unix_prot
&
PROT_EXEC
))
{
TRACE
(
"forcing exec permission on %p-%p
\n
"
,
base
,
(
char
*
)
base
+
size
-
1
);
mprotect
(
base
,
size
,
unix_prot
|
PROT_EXEC
);
...
...
@@ -585,7 +585,8 @@ static BOOL VIRTUAL_SetProt( FILE_VIEW *view, /* [in] Pointer to view */
return
TRUE
;
}
if
(
force_exec_prot
&&
(
unix_prot
&
PROT_READ
)
&&
!
(
unix_prot
&
PROT_EXEC
))
if
(
force_exec_prot
&&
!
(
view
->
protect
&
VPROT_NOEXEC
)
&&
(
unix_prot
&
PROT_READ
)
&&
!
(
unix_prot
&
PROT_EXEC
))
{
TRACE
(
"forcing exec permission on %p-%p
\n
"
,
base
,
(
char
*
)
base
+
size
-
1
);
if
(
!
mprotect
(
base
,
size
,
unix_prot
|
PROT_EXEC
))
goto
done
;
...
...
@@ -1386,6 +1387,7 @@ void VIRTUAL_SetForceExec( BOOL enable )
char
*
addr
=
view
->
base
;
BYTE
prot
=
view
->
prot
[
0
];
if
(
view
->
protect
&
VPROT_NOEXEC
)
continue
;
for
(
count
=
i
=
1
;
i
<
view
->
size
>>
page_shift
;
i
++
,
count
++
)
{
if
(
view
->
prot
[
i
]
==
prot
)
continue
;
...
...
@@ -1525,7 +1527,7 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_
if
(
type
&
MEM_SYSTEM
)
{
if
(
type
&
MEM_IMAGE
)
vprot
|=
VPROT_IMAGE
;
if
(
type
&
MEM_IMAGE
)
vprot
|=
VPROT_IMAGE
|
VPROT_NOEXEC
;
status
=
create_view
(
&
view
,
base
,
size
,
vprot
|
VPROT_COMMITTED
|
VPROT_SYSTEM
);
if
(
status
==
STATUS_SUCCESS
)
base
=
view
->
base
;
}
...
...
include/wine/server_protocol.h
View file @
7e947879
...
...
@@ -1692,6 +1692,7 @@ struct create_mapping_reply
#define VPROT_IMAGE 0x0100
#define VPROT_SYSTEM 0x0200
#define VPROT_VALLOC 0x0400
#define VPROT_NOEXEC 0x0800
...
...
server/protocol.def
View file @
7e947879
...
...
@@ -1334,6 +1334,7 @@ enum char_info_mode
#define VPROT_IMAGE 0x0100 /* mapping for an exe image */
#define VPROT_SYSTEM 0x0200 /* system view (underlying mmap not under our control) */
#define VPROT_VALLOC 0x0400 /* allocated by VirtualAlloc */
#define VPROT_NOEXEC 0x0800 /* don't force exec permission */
/* Open a mapping */
...
...
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