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
b2f5b034
Commit
b2f5b034
authored
Feb 12, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add threadpool stack information exports.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f6425471
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
4 deletions
+50
-4
ntdll.spec
dlls/ntdll/ntdll.spec
+2
-0
threadpool.c
dlls/ntdll/threadpool.c
+46
-4
winternl.h
include/winternl.h
+2
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
b2f5b034
...
...
@@ -1070,6 +1070,7 @@
@ stdcall TpDisassociateCallback(ptr)
@ stdcall TpIsTimerSet(ptr)
@ stdcall TpPostWork(ptr)
@ stdcall TpQueryPoolStackInformation(ptr ptr)
@ stdcall TpReleaseCleanupGroup(ptr)
@ stdcall TpReleaseCleanupGroupMembers(ptr long ptr)
@ stdcall TpReleasePool(ptr)
...
...
@@ -1078,6 +1079,7 @@
@ stdcall TpReleaseWork(ptr)
@ stdcall TpSetPoolMaxThreads(ptr long)
@ stdcall TpSetPoolMinThreads(ptr long)
@ stdcall TpSetPoolStackInformation(ptr ptr)
@ stdcall TpSetTimer(ptr ptr long long)
@ stdcall TpSetWait(ptr long ptr)
@ stdcall TpSimpleTryPost(ptr ptr ptr)
...
...
dlls/ntdll/threadpool.c
View file @
b2f5b034
...
...
@@ -131,6 +131,7 @@ struct threadpool
int
min_workers
;
int
num_workers
;
int
num_busy_workers
;
TP_POOL_STACK_INFORMATION
stack_info
;
};
enum
threadpool_objtype
...
...
@@ -1648,6 +1649,7 @@ static void tp_waitqueue_unlock( struct threadpool_object *wait )
*/
static
NTSTATUS
tp_threadpool_alloc
(
struct
threadpool
**
out
)
{
IMAGE_NT_HEADERS
*
nt
=
RtlImageNtHeader
(
NtCurrentTeb
()
->
Peb
->
ImageBaseAddress
);
struct
threadpool
*
pool
;
unsigned
int
i
;
...
...
@@ -1666,10 +1668,12 @@ static NTSTATUS tp_threadpool_alloc( struct threadpool **out )
list_init
(
&
pool
->
pools
[
i
]
);
RtlInitializeConditionVariable
(
&
pool
->
update_event
);
pool
->
max_workers
=
500
;
pool
->
min_workers
=
0
;
pool
->
num_workers
=
0
;
pool
->
num_busy_workers
=
0
;
pool
->
max_workers
=
500
;
pool
->
min_workers
=
0
;
pool
->
num_workers
=
0
;
pool
->
num_busy_workers
=
0
;
pool
->
stack_info
.
StackReserve
=
nt
->
OptionalHeader
.
SizeOfStackReserve
;
pool
->
stack_info
.
StackCommit
=
nt
->
OptionalHeader
.
SizeOfStackCommit
;
TRACE
(
"allocated threadpool %p
\n
"
,
pool
);
...
...
@@ -2989,3 +2993,41 @@ VOID WINAPI TpWaitForWork( TP_WORK *work, BOOL cancel_pending )
tp_object_cancel
(
this
);
tp_object_wait
(
this
,
FALSE
);
}
/***********************************************************************
* TpSetPoolStackInformation (NTDLL.@)
*/
NTSTATUS
WINAPI
TpSetPoolStackInformation
(
TP_POOL
*
pool
,
TP_POOL_STACK_INFORMATION
*
stack_info
)
{
struct
threadpool
*
this
=
impl_from_TP_POOL
(
pool
);
TRACE
(
"%p %p
\n
"
,
pool
,
stack_info
);
if
(
!
stack_info
)
return
STATUS_INVALID_PARAMETER
;
RtlEnterCriticalSection
(
&
this
->
cs
);
this
->
stack_info
=
*
stack_info
;
RtlLeaveCriticalSection
(
&
this
->
cs
);
return
STATUS_SUCCESS
;
}
/***********************************************************************
* TpQueryPoolStackInformation (NTDLL.@)
*/
NTSTATUS
WINAPI
TpQueryPoolStackInformation
(
TP_POOL
*
pool
,
TP_POOL_STACK_INFORMATION
*
stack_info
)
{
struct
threadpool
*
this
=
impl_from_TP_POOL
(
pool
);
TRACE
(
"%p %p
\n
"
,
pool
,
stack_info
);
if
(
!
stack_info
)
return
STATUS_INVALID_PARAMETER
;
RtlEnterCriticalSection
(
&
this
->
cs
);
*
stack_info
=
this
->
stack_info
;
RtlLeaveCriticalSection
(
&
this
->
cs
);
return
STATUS_SUCCESS
;
}
include/winternl.h
View file @
b2f5b034
...
...
@@ -3021,6 +3021,7 @@ NTSYSAPI void WINAPI TpCallbackUnloadDllOnCompletion(TP_CALLBACK_INSTANCE *
NTSYSAPI
void
WINAPI
TpDisassociateCallback
(
TP_CALLBACK_INSTANCE
*
);
NTSYSAPI
BOOL
WINAPI
TpIsTimerSet
(
TP_TIMER
*
);
NTSYSAPI
void
WINAPI
TpPostWork
(
TP_WORK
*
);
NTSYSAPI
NTSTATUS
WINAPI
TpQueryPoolStackInformation
(
TP_POOL
*
,
TP_POOL_STACK_INFORMATION
*
stack_info
);
NTSYSAPI
void
WINAPI
TpReleaseCleanupGroup
(
TP_CLEANUP_GROUP
*
);
NTSYSAPI
void
WINAPI
TpReleaseCleanupGroupMembers
(
TP_CLEANUP_GROUP
*
,
BOOL
,
PVOID
);
NTSYSAPI
void
WINAPI
TpReleasePool
(
TP_POOL
*
);
...
...
@@ -3029,6 +3030,7 @@ NTSYSAPI void WINAPI TpReleaseWait(TP_WAIT *);
NTSYSAPI
void
WINAPI
TpReleaseWork
(
TP_WORK
*
);
NTSYSAPI
void
WINAPI
TpSetPoolMaxThreads
(
TP_POOL
*
,
DWORD
);
NTSYSAPI
BOOL
WINAPI
TpSetPoolMinThreads
(
TP_POOL
*
,
DWORD
);
NTSYSAPI
NTSTATUS
WINAPI
TpSetPoolStackInformation
(
TP_POOL
*
,
TP_POOL_STACK_INFORMATION
*
stack_info
);
NTSYSAPI
void
WINAPI
TpSetTimer
(
TP_TIMER
*
,
LARGE_INTEGER
*
,
LONG
,
LONG
);
NTSYSAPI
void
WINAPI
TpSetWait
(
TP_WAIT
*
,
HANDLE
,
LARGE_INTEGER
*
);
NTSYSAPI
NTSTATUS
WINAPI
TpSimpleTryPost
(
PTP_SIMPLE_CALLBACK
,
PVOID
,
TP_CALLBACK_ENVIRON
*
);
...
...
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