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
c68594a9
Commit
c68594a9
authored
Jun 25, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Don't try to decommit a heap past its initial commit size.
parent
476324e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
heap.c
dlls/ntdll/heap.c
+4
-0
No files found.
dlls/ntdll/heap.c
View file @
c68594a9
...
...
@@ -125,6 +125,7 @@ typedef struct tagSUBHEAP
{
void
*
base
;
/* Base address of the sub-heap memory block */
SIZE_T
size
;
/* Size of the whole sub-heap */
SIZE_T
min_commit
;
/* Minimum committed size */
SIZE_T
commitSize
;
/* Committed size of the sub-heap */
struct
list
entry
;
/* Entry in sub-heap list */
struct
tagHEAP
*
heap
;
/* Main heap structure */
...
...
@@ -490,6 +491,7 @@ static inline BOOL HEAP_Decommit( SUBHEAP *subheap, void *ptr )
/* round to next block and add one full block */
size
=
((
size
+
COMMIT_MASK
)
&
~
COMMIT_MASK
)
+
COMMIT_MASK
+
1
;
size
=
max
(
size
,
subheap
->
min_commit
);
if
(
size
>=
subheap
->
commitSize
)
return
TRUE
;
decommit_size
=
subheap
->
commitSize
-
size
;
addr
=
(
char
*
)
subheap
->
base
+
size
;
...
...
@@ -799,6 +801,7 @@ static SUBHEAP *HEAP_CreateSubHeap( HEAP *heap, LPVOID address, DWORD flags,
subheap
->
base
=
address
;
subheap
->
heap
=
heap
;
subheap
->
size
=
totalSize
;
subheap
->
min_commit
=
0x10000
;
subheap
->
commitSize
=
commitSize
;
subheap
->
magic
=
SUBHEAP_MAGIC
;
subheap
->
headerSize
=
ROUND_SIZE
(
sizeof
(
SUBHEAP
)
);
...
...
@@ -819,6 +822,7 @@ static SUBHEAP *HEAP_CreateSubHeap( HEAP *heap, LPVOID address, DWORD flags,
subheap
->
base
=
address
;
subheap
->
heap
=
heap
;
subheap
->
size
=
totalSize
;
subheap
->
min_commit
=
commitSize
;
subheap
->
commitSize
=
commitSize
;
subheap
->
magic
=
SUBHEAP_MAGIC
;
subheap
->
headerSize
=
ROUND_SIZE
(
sizeof
(
HEAP
)
);
...
...
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