Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6d4ec125
Commit
6d4ec125
authored
Apr 18, 2022
by
Brendan Shanks
Committed by
Alexandre Julliard
Apr 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Test that threads have unique TEBs.
Signed-off-by:
Brendan Shanks
<
bshanks@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6d19495e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
thread.c
dlls/ntdll/tests/thread.c
+36
-0
No files found.
dlls/ntdll/tests/thread.c
View file @
6d4ec125
...
...
@@ -118,9 +118,45 @@ static void test_dbg_hidden_thread_creation(void)
CloseHandle
(
thread
);
}
static
void
CALLBACK
test_unique_teb_proc
(
void
*
param
)
{
TEB
**
teb
=
param
;
*
teb
=
NtCurrentTeb
();
}
static
void
test_unique_teb
(
void
)
{
HANDLE
threads
[
2
];
TEB
*
teb1
,
*
teb2
;
NTSTATUS
status
;
if
(
!
pNtCreateThreadEx
)
{
win_skip
(
"NtCreateThreadEx is not available.
\n
"
);
return
;
}
status
=
pNtCreateThreadEx
(
&
threads
[
0
],
THREAD_ALL_ACCESS
,
NULL
,
GetCurrentProcess
(),
test_unique_teb_proc
,
&
teb1
,
0
,
0
,
0
,
0
,
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Got unexpected status %#lx.
\n
"
,
status
);
status
=
pNtCreateThreadEx
(
&
threads
[
1
],
THREAD_ALL_ACCESS
,
NULL
,
GetCurrentProcess
(),
test_unique_teb_proc
,
&
teb2
,
0
,
0
,
0
,
0
,
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Got unexpected status %#lx.
\n
"
,
status
);
WaitForMultipleObjects
(
2
,
threads
,
TRUE
,
INFINITE
);
CloseHandle
(
threads
[
0
]
);
CloseHandle
(
threads
[
1
]
);
ok
(
NtCurrentTeb
()
!=
teb1
,
"Multiple threads have TEB %p.
\n
"
,
teb1
);
ok
(
NtCurrentTeb
()
!=
teb2
,
"Multiple threads have TEB %p.
\n
"
,
teb2
);
ok
(
teb1
!=
teb2
,
"Multiple threads have TEB %p.
\n
"
,
teb1
);
}
START_TEST
(
thread
)
{
init_function_pointers
();
test_dbg_hidden_thread_creation
();
test_unique_teb
();
}
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