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
a10c40df
Commit
a10c40df
authored
Dec 05, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Added support for the HEAP_CREATE_ENABLE_EXECUTE flag.
parent
338fc524
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
heap.c
dlls/ntdll/heap.c
+9
-3
No files found.
dlls/ntdll/heap.c
View file @
a10c40df
...
...
@@ -201,6 +201,12 @@ static inline unsigned int get_freelist_index( SIZE_T size )
return
i
;
}
/* get the memory protection type to use for a given heap */
static
inline
ULONG
get_protection_type
(
DWORD
flags
)
{
return
(
flags
&
HEAP_CREATE_ENABLE_EXECUTE
)
?
PAGE_EXECUTE_READWRITE
:
PAGE_READWRITE
;
}
static
RTL_CRITICAL_SECTION_DEBUG
process_heap_critsect_debug
=
{
0
,
0
,
NULL
,
/* will be set later */
...
...
@@ -411,7 +417,7 @@ static inline BOOL HEAP_Commit( SUBHEAP *subheap, ARENA_INUSE *pArena, SIZE_T da
size
-=
subheap
->
commitSize
;
ptr
=
(
char
*
)
subheap
+
subheap
->
commitSize
;
if
(
NtAllocateVirtualMemory
(
NtCurrentProcess
(),
&
ptr
,
0
,
&
size
,
MEM_COMMIT
,
PAGE_READWRITE
))
&
size
,
MEM_COMMIT
,
get_protection_type
(
subheap
->
heap
->
flags
)
))
{
WARN
(
"Could not commit %08lx bytes at %p for heap %p
\n
"
,
size
,
ptr
,
subheap
->
heap
);
...
...
@@ -594,7 +600,7 @@ static BOOL HEAP_InitSubHeap( HEAP *heap, LPVOID address, DWORD flags,
if
(
flags
&
HEAP_SHARED
)
commitSize
=
totalSize
;
/* always commit everything in a shared heap */
if
(
NtAllocateVirtualMemory
(
NtCurrentProcess
(),
&
address
,
0
,
&
commitSize
,
MEM_COMMIT
,
PAGE_READWRITE
))
&
commitSize
,
MEM_COMMIT
,
get_protection_type
(
flags
)
))
{
WARN
(
"Could not commit %08lx bytes for sub-heap %p
\n
"
,
commitSize
,
address
);
return
FALSE
;
...
...
@@ -690,7 +696,7 @@ static SUBHEAP *HEAP_CreateSubHeap( HEAP *heap, void *base, DWORD flags,
{
/* allocate the memory block */
if
(
NtAllocateVirtualMemory
(
NtCurrentProcess
(),
&
address
,
0
,
&
totalSize
,
MEM_RESERVE
,
PAGE_READWRITE
))
MEM_RESERVE
,
get_protection_type
(
flags
)
))
{
WARN
(
"Could not allocate %08lx bytes
\n
"
,
totalSize
);
return
NULL
;
...
...
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