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
31df70a3
Commit
31df70a3
authored
May 04, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Jun 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add block padding when HEAP_ADD_USER_INFO flag is set.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
parent
15d01a2a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
heap.c
dlls/kernel32/tests/heap.c
+1
-2
heap.c
dlls/ntdll/heap.c
+3
-2
No files found.
dlls/kernel32/tests/heap.c
View file @
31df70a3
...
...
@@ -2277,14 +2277,13 @@ static void test_block_layout( HANDLE heap, DWORD global_flags, DWORD heap_flags
expect_size
=
max
(
alloc_size
,
2
*
sizeof
(
void
*
)
);
expect_size
=
ALIGN_BLOCK_SIZE
(
expect_size
+
extra_size
+
2
*
sizeof
(
void
*
)
);
diff
=
min
(
llabs
(
ptr2
-
ptr1
),
llabs
(
ptr1
-
ptr0
)
);
todo_wine
ok
(
diff
==
expect_size
,
"got diff %#Ix
\n
"
,
diff
);
ok
(
!
memcmp
(
ptr0
+
alloc_size
,
tail_buf
,
tail_size
),
"missing block tail
\n
"
);
ok
(
!
memcmp
(
ptr1
+
alloc_size
,
tail_buf
,
tail_size
),
"missing block tail
\n
"
);
ok
(
!
memcmp
(
ptr2
+
alloc_size
,
tail_buf
,
tail_size
),
"missing block tail
\n
"
);
todo_wine
todo_wine
_if
(
global_flags
&
FLG_HEAP_ENABLE_FREE_CHECK
)
ok
(
!
memcmp
(
ptr0
+
alloc_size
+
tail_size
,
padd_buf
,
2
*
sizeof
(
void
*
)
),
"unexpected padding
\n
"
);
tmp_ptr
=
(
void
*
)
0xdeadbeef
;
...
...
dlls/ntdll/heap.c
View file @
31df70a3
...
...
@@ -212,6 +212,7 @@ C_ASSERT( offsetof(HEAP, subheap) <= COMMIT_MASK );
/* some undocumented flags (names are made up) */
#define HEAP_PRIVATE 0x00001000
#define HEAP_ADD_USER_INFO 0x00000100
#define HEAP_PAGE_ALLOCS 0x01000000
#define HEAP_VALIDATE 0x10000000
#define HEAP_VALIDATE_ALL 0x20000000
...
...
@@ -451,7 +452,7 @@ static RTL_CRITICAL_SECTION_DEBUG process_heap_cs_debug =
static
inline
ULONG
heap_get_flags
(
const
HEAP
*
heap
,
ULONG
flags
)
{
if
(
flags
&
(
HEAP_TAIL_CHECKING_ENABLED
|
HEAP_FREE_CHECKING_ENABLED
))
flags
|=
HEAP_CHECKING_ENABLED
;
flags
&=
HEAP_GENERATE_EXCEPTIONS
|
HEAP_NO_SERIALIZE
|
HEAP_ZERO_MEMORY
|
HEAP_REALLOC_IN_PLACE_ONLY
|
HEAP_CHECKING_ENABLED
;
flags
&=
HEAP_GENERATE_EXCEPTIONS
|
HEAP_NO_SERIALIZE
|
HEAP_ZERO_MEMORY
|
HEAP_REALLOC_IN_PLACE_ONLY
|
HEAP_CHECKING_ENABLED
|
HEAP_ADD_USER_INFO
;
return
heap
->
flags
|
flags
;
}
...
...
@@ -1476,7 +1477,7 @@ HANDLE WINAPI RtlDestroyHeap( HANDLE heap )
static
SIZE_T
heap_get_block_size
(
HEAP
*
heap
,
ULONG
flags
,
SIZE_T
size
)
{
static
const
ULONG
padd_flags
=
HEAP_VALIDATE
|
HEAP_VALIDATE_ALL
|
HEAP_VALIDATE_PARAMS
;
static
const
ULONG
padd_flags
=
HEAP_VALIDATE
|
HEAP_VALIDATE_ALL
|
HEAP_VALIDATE_PARAMS
|
HEAP_ADD_USER_INFO
;
static
const
ULONG
check_flags
=
HEAP_TAIL_CHECKING_ENABLED
|
HEAP_FREE_CHECKING_ENABLED
|
HEAP_CHECKING_ENABLED
;
SIZE_T
overhead
;
...
...
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