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
710ae292
Commit
710ae292
authored
Feb 08, 2023
by
Francois Gouget
Committed by
Alexandre Julliard
Feb 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Test the thread pool stack APIs.
parent
41a53f53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
threadpool.c
dlls/ntdll/tests/threadpool.c
+22
-1
No files found.
dlls/ntdll/tests/threadpool.c
View file @
710ae292
...
...
@@ -33,15 +33,17 @@ static VOID (WINAPI *pTpCallbackReleaseSemaphoreOnCompletion)(TP_CALLBACK_IN
static
void
(
WINAPI
*
pTpCancelAsyncIoOperation
)(
TP_IO
*
);
static
VOID
(
WINAPI
*
pTpDisassociateCallback
)(
TP_CALLBACK_INSTANCE
*
);
static
BOOL
(
WINAPI
*
pTpIsTimerSet
)(
TP_TIMER
*
);
static
VOID
(
WINAPI
*
pTpReleaseWait
)(
TP_WAIT
*
);
static
VOID
(
WINAPI
*
pTpPostWork
)(
TP_WORK
*
);
static
NTSTATUS
(
WINAPI
*
pTpQueryPoolStackInformation
)(
TP_POOL
*
,
TP_POOL_STACK_INFORMATION
*
);
static
VOID
(
WINAPI
*
pTpReleaseCleanupGroup
)(
TP_CLEANUP_GROUP
*
);
static
VOID
(
WINAPI
*
pTpReleaseCleanupGroupMembers
)(
TP_CLEANUP_GROUP
*
,
BOOL
,
PVOID
);
static
void
(
WINAPI
*
pTpReleaseIoCompletion
)(
TP_IO
*
);
static
VOID
(
WINAPI
*
pTpReleasePool
)(
TP_POOL
*
);
static
VOID
(
WINAPI
*
pTpReleaseTimer
)(
TP_TIMER
*
);
static
VOID
(
WINAPI
*
pTpReleaseWait
)(
TP_WAIT
*
);
static
VOID
(
WINAPI
*
pTpReleaseWork
)(
TP_WORK
*
);
static
VOID
(
WINAPI
*
pTpSetPoolMaxThreads
)(
TP_POOL
*
,
DWORD
);
static
NTSTATUS
(
WINAPI
*
pTpSetPoolStackInformation
)(
TP_POOL
*
,
TP_POOL_STACK_INFORMATION
*
);
static
VOID
(
WINAPI
*
pTpSetTimer
)(
TP_TIMER
*
,
LARGE_INTEGER
*
,
LONG
,
LONG
);
static
VOID
(
WINAPI
*
pTpSetWait
)(
TP_WAIT
*
,
HANDLE
,
LARGE_INTEGER
*
);
static
NTSTATUS
(
WINAPI
*
pTpSimpleTryPost
)(
PTP_SIMPLE_CALLBACK
,
PVOID
,
TP_CALLBACK_ENVIRON
*
);
...
...
@@ -80,6 +82,7 @@ static BOOL init_threadpool(void)
GET_PROC
(
TpDisassociateCallback
);
GET_PROC
(
TpIsTimerSet
);
GET_PROC
(
TpPostWork
);
GET_PROC
(
TpQueryPoolStackInformation
);
GET_PROC
(
TpReleaseCleanupGroup
);
GET_PROC
(
TpReleaseCleanupGroupMembers
);
GET_PROC
(
TpReleaseIoCompletion
);
...
...
@@ -88,6 +91,7 @@ static BOOL init_threadpool(void)
GET_PROC
(
TpReleaseWait
);
GET_PROC
(
TpReleaseWork
);
GET_PROC
(
TpSetPoolMaxThreads
);
GET_PROC
(
TpSetPoolStackInformation
);
GET_PROC
(
TpSetTimer
);
GET_PROC
(
TpSetWait
);
GET_PROC
(
TpSimpleTryPost
);
...
...
@@ -575,6 +579,7 @@ static void CALLBACK simple2_cb(TP_CALLBACK_INSTANCE *instance, void *userdata)
static
void
test_tp_simple
(
void
)
{
TP_POOL_STACK_INFORMATION
stack_info
;
TP_CALLBACK_ENVIRON
environment
;
TP_CALLBACK_ENVIRON_V3
environment3
;
TP_CLEANUP_GROUP
*
group
;
...
...
@@ -678,6 +683,22 @@ static void test_tp_simple(void)
pTpReleaseCleanupGroupMembers
(
group
,
TRUE
,
NULL
);
ok
(
userdata
<
100
,
"expected userdata < 100, got %lu
\n
"
,
userdata
);
/* test querying and setting the stack size */
status
=
pTpQueryPoolStackInformation
(
pool
,
&
stack_info
);
ok
(
!
status
,
"TpQueryPoolStackInformation failed: %lx
\n
"
,
status
);
ok
(
stack_info
.
StackReserve
==
2
*
1024
*
1024
,
"expected default StackReserve, got %ld
\n
"
,
(
ULONG
)
stack_info
.
StackReserve
);
ok
(
stack_info
.
StackCommit
==
4
*
1024
,
"expected default StackCommit, got %ld
\n
"
,
(
ULONG
)
stack_info
.
StackCommit
);
/* threadpool does not validate the stack size values */
stack_info
.
StackReserve
=
stack_info
.
StackCommit
=
1
;
status
=
pTpSetPoolStackInformation
(
pool
,
&
stack_info
);
ok
(
!
status
,
"TpSetPoolStackInformation failed: %lx
\n
"
,
status
);
status
=
pTpQueryPoolStackInformation
(
pool
,
&
stack_info
);
ok
(
!
status
,
"TpQueryPoolStackInformation failed: %lx
\n
"
,
status
);
ok
(
stack_info
.
StackReserve
==
1
,
"expected 1 byte StackReserve, got %ld
\n
"
,
(
ULONG
)
stack_info
.
StackReserve
);
ok
(
stack_info
.
StackCommit
==
1
,
"expected 1 byte StackCommit, got %ld
\n
"
,
(
ULONG
)
stack_info
.
StackCommit
);
/* cleanup */
pTpReleaseCleanupGroup
(
group
);
pTpReleasePool
(
pool
);
...
...
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