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
cbf8838d
Commit
cbf8838d
authored
Oct 03, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix the HEAP_CreateSubHeap return value (spotted by Allan Tong).
parent
1e25c7b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
heap.c
dlls/ntdll/heap.c
+7
-8
No files found.
dlls/ntdll/heap.c
View file @
cbf8838d
...
...
@@ -581,8 +581,8 @@ static void HEAP_ShrinkBlock(SUBHEAP *subheap, ARENA_INUSE *pArena, SIZE_T size)
/***********************************************************************
* HEAP_InitSubHeap
*/
static
BOOL
HEAP_InitSubHeap
(
HEAP
*
heap
,
LPVOID
address
,
DWORD
flags
,
SIZE_T
commitSize
,
SIZE_T
totalSize
)
static
SUBHEAP
*
HEAP_InitSubHeap
(
HEAP
*
heap
,
LPVOID
address
,
DWORD
flags
,
SIZE_T
commitSize
,
SIZE_T
totalSize
)
{
SUBHEAP
*
subheap
;
FREE_LIST_ENTRY
*
pEntry
;
...
...
@@ -596,7 +596,7 @@ static BOOL HEAP_InitSubHeap( HEAP *heap, LPVOID address, DWORD flags,
&
commitSize
,
MEM_COMMIT
,
get_protection_type
(
flags
)
))
{
WARN
(
"Could not commit %08lx bytes for sub-heap %p
\n
"
,
commitSize
,
address
);
return
FALSE
;
return
NULL
;
}
if
(
heap
)
...
...
@@ -677,7 +677,7 @@ static BOOL HEAP_InitSubHeap( HEAP *heap, LPVOID address, DWORD flags,
HEAP_CreateFreeBlock
(
subheap
,
(
LPBYTE
)
subheap
->
base
+
subheap
->
headerSize
,
subheap
->
size
-
subheap
->
headerSize
);
return
TRUE
;
return
subheap
;
}
/***********************************************************************
...
...
@@ -690,6 +690,7 @@ static SUBHEAP *HEAP_CreateSubHeap( HEAP *heap, void *base, DWORD flags,
SIZE_T
commitSize
,
SIZE_T
totalSize
)
{
LPVOID
address
=
base
;
SUBHEAP
*
ret
;
/* round-up sizes on a 64K boundary */
totalSize
=
(
totalSize
+
0xffff
)
&
0xffff0000
;
...
...
@@ -710,14 +711,12 @@ static SUBHEAP *HEAP_CreateSubHeap( HEAP *heap, void *base, DWORD flags,
/* Initialize subheap */
if
(
!
HEAP_InitSubHeap
(
heap
,
address
,
flags
,
commitSize
,
totalSize
))
if
(
!
(
ret
=
HEAP_InitSubHeap
(
heap
,
address
,
flags
,
commitSize
,
totalSize
)
))
{
SIZE_T
size
=
0
;
if
(
!
base
)
NtFreeVirtualMemory
(
NtCurrentProcess
(),
&
address
,
&
size
,
MEM_RELEASE
);
return
NULL
;
}
return
(
SUBHEAP
*
)
address
;
return
ret
;
}
...
...
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