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
d99e9da9
Commit
d99e9da9
authored
Oct 13, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Test (Global|Local)Handle with heap allocated pointers.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53741
parent
5c928bc0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
heap.c
dlls/kernel32/tests/heap.c
+35
-0
No files found.
dlls/kernel32/tests/heap.c
View file @
d99e9da9
...
...
@@ -1813,6 +1813,23 @@ static void test_GlobalAlloc(void)
mem
=
GlobalFree
(
mem
);
ok
(
!
mem
,
"GlobalFree failed, error %lu
\n
"
,
GetLastError
()
);
}
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
16
);
ok
(
!!
ptr
,
"HeapAlloc failed, error %lu
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
tmp_mem
=
GlobalHandle
(
ptr
);
ok
(
!!
tmp_mem
,
"GlobalHandle failed, error %lu
\n
"
,
GetLastError
()
);
todo_wine
ok
(
tmp_mem
==
ptr
,
"GlobalHandle returned unexpected handle
\n
"
);
tmp_ptr
=
(
void
*
)
0xdeadbeef
;
tmp_flags
=
0xdeadbeef
;
ret
=
pRtlGetUserInfoHeap
(
GetProcessHeap
(),
0
,
ptr
,
(
void
**
)
&
tmp_ptr
,
&
tmp_flags
);
ok
(
ret
,
"RtlGetUserInfoHeap failed, error %lu
\n
"
,
GetLastError
()
);
todo_wine
ok
(
tmp_ptr
==
(
void
*
)
0xdeadbeef
,
"got user value %p
\n
"
,
tmp_ptr
);
ok
(
tmp_flags
==
0
,
"got user flags %#lx
\n
"
,
tmp_flags
);
ret
=
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
ok
(
ret
,
"HeapFree failed, error %lu
\n
"
,
GetLastError
()
);
}
static
void
test_LocalAlloc
(
void
)
...
...
@@ -1833,6 +1850,7 @@ static void test_LocalAlloc(void)
HLOCAL
locals
[
0x10000
];
HLOCAL
mem
,
tmp_mem
;
BYTE
*
ptr
,
*
tmp_ptr
;
ULONG
tmp_flags
;
UINT
i
,
flags
;
SIZE_T
size
;
BOOL
ret
;
...
...
@@ -2162,6 +2180,23 @@ static void test_LocalAlloc(void)
mem
=
LocalFree
(
mem
);
ok
(
!
mem
,
"LocalFree failed, error %lu
\n
"
,
GetLastError
()
);
}
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
16
);
ok
(
!!
ptr
,
"HeapAlloc failed, error %lu
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
tmp_mem
=
LocalHandle
(
ptr
);
ok
(
!!
tmp_mem
,
"LocalHandle failed, error %lu
\n
"
,
GetLastError
()
);
todo_wine
ok
(
tmp_mem
==
ptr
,
"LocalHandle returned unexpected handle
\n
"
);
tmp_ptr
=
(
void
*
)
0xdeadbeef
;
tmp_flags
=
0xdeadbeef
;
ret
=
pRtlGetUserInfoHeap
(
GetProcessHeap
(),
0
,
ptr
,
(
void
**
)
&
tmp_ptr
,
&
tmp_flags
);
ok
(
ret
,
"RtlGetUserInfoHeap failed, error %lu
\n
"
,
GetLastError
()
);
todo_wine
ok
(
tmp_ptr
==
(
void
*
)
0xdeadbeef
,
"got user value %p
\n
"
,
tmp_ptr
);
ok
(
tmp_flags
==
0
,
"got user flags %#lx
\n
"
,
tmp_flags
);
ret
=
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
ok
(
ret
,
"HeapFree failed, error %lu
\n
"
,
GetLastError
()
);
}
static
void
test_block_layout
(
HANDLE
heap
,
DWORD
global_flags
,
DWORD
heap_flags
,
DWORD
alloc_flags
)
...
...
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