Nikolay Sivov : kernel32: Add threadpool stack information exports.

Alexandre Julliard julliard at winehq.org
Wed Feb 12 16:21:07 CST 2020


Module: wine
Branch: master
Commit: ad5257b3b6cd95061e5afc6d611842e42e10b475
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ad5257b3b6cd95061e5afc6d611842e42e10b475

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Feb 12 12:05:28 2020 +0300

kernel32: Add threadpool stack information exports.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 .../api-ms-win-core-threadpool-l1-1-0.spec               |  4 ++--
 .../api-ms-win-core-threadpool-l1-2-0.spec               |  4 ++--
 dlls/kernel32/kernel32.spec                              |  4 ++--
 dlls/kernelbase/kernelbase.spec                          |  4 ++--
 dlls/kernelbase/thread.c                                 | 16 ++++++++++++++++
 include/threadpoolapiset.h                               |  2 ++
 6 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/dlls/api-ms-win-core-threadpool-l1-1-0/api-ms-win-core-threadpool-l1-1-0.spec b/dlls/api-ms-win-core-threadpool-l1-1-0/api-ms-win-core-threadpool-l1-1-0.spec
index 4f4580a293..9cefa5aed5 100644
--- a/dlls/api-ms-win-core-threadpool-l1-1-0/api-ms-win-core-threadpool-l1-1-0.spec
+++ b/dlls/api-ms-win-core-threadpool-l1-1-0/api-ms-win-core-threadpool-l1-1-0.spec
@@ -22,12 +22,12 @@
 @ stdcall FreeLibraryWhenCallbackReturns(ptr ptr) kernel32.FreeLibraryWhenCallbackReturns
 @ stdcall IsThreadpoolTimerSet(ptr) kernel32.IsThreadpoolTimerSet
 @ stdcall LeaveCriticalSectionWhenCallbackReturns(ptr ptr) kernel32.LeaveCriticalSectionWhenCallbackReturns
-@ stub QueryThreadpoolStackInformation
+@ stdcall QueryThreadpoolStackInformation(ptr ptr) kernel32.QueryThreadpoolStackInformation
 @ stdcall RegisterWaitForSingleObjectEx(long ptr ptr long long) kernel32.RegisterWaitForSingleObjectEx
 @ stdcall ReleaseMutexWhenCallbackReturns(ptr long) kernel32.ReleaseMutexWhenCallbackReturns
 @ stdcall ReleaseSemaphoreWhenCallbackReturns(ptr long long) kernel32.ReleaseSemaphoreWhenCallbackReturns
 @ stdcall SetEventWhenCallbackReturns(ptr long) kernel32.SetEventWhenCallbackReturns
-@ stub SetThreadpoolStackInformation
+@ stdcall SetThreadpoolStackInformation(ptr ptr) kernel32.SetThreadpoolStackInformation
 @ stdcall SetThreadpoolThreadMaximum(ptr long) kernel32.SetThreadpoolThreadMaximum
 @ stdcall SetThreadpoolThreadMinimum(ptr long) kernel32.SetThreadpoolThreadMinimum
 @ stdcall SetThreadpoolTimer(ptr ptr long long) kernel32.SetThreadpoolTimer
diff --git a/dlls/api-ms-win-core-threadpool-l1-2-0/api-ms-win-core-threadpool-l1-2-0.spec b/dlls/api-ms-win-core-threadpool-l1-2-0/api-ms-win-core-threadpool-l1-2-0.spec
index dc110ef9ed..9510c5bcf2 100644
--- a/dlls/api-ms-win-core-threadpool-l1-2-0/api-ms-win-core-threadpool-l1-2-0.spec
+++ b/dlls/api-ms-win-core-threadpool-l1-2-0/api-ms-win-core-threadpool-l1-2-0.spec
@@ -17,11 +17,11 @@
 @ stdcall FreeLibraryWhenCallbackReturns(ptr ptr) kernel32.FreeLibraryWhenCallbackReturns
 @ stdcall IsThreadpoolTimerSet(ptr) kernel32.IsThreadpoolTimerSet
 @ stdcall LeaveCriticalSectionWhenCallbackReturns(ptr ptr) kernel32.LeaveCriticalSectionWhenCallbackReturns
-@ stub QueryThreadpoolStackInformation
+@ stdcall QueryThreadpoolStackInformation(ptr ptr) kernel32.QueryThreadpoolStackInformation
 @ stdcall ReleaseMutexWhenCallbackReturns(ptr long) kernel32.ReleaseMutexWhenCallbackReturns
 @ stdcall ReleaseSemaphoreWhenCallbackReturns(ptr long long) kernel32.ReleaseSemaphoreWhenCallbackReturns
 @ stdcall SetEventWhenCallbackReturns(ptr long) kernel32.SetEventWhenCallbackReturns
-@ stub SetThreadpoolStackInformation
+@ stdcall SetThreadpoolStackInformation(ptr ptr) kernel32.SetThreadpoolStackInformation
 @ stdcall SetThreadpoolThreadMaximum(ptr long) kernel32.SetThreadpoolThreadMaximum
 @ stdcall SetThreadpoolThreadMinimum(ptr long) kernel32.SetThreadpoolThreadMinimum
 @ stdcall SetThreadpoolTimer(ptr ptr long long) kernel32.SetThreadpoolTimer
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index 47c7d63761..d138df9fc1 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -1177,7 +1177,7 @@
 @ stdcall QueryProcessCycleTime(long ptr)
 @ stdcall QueryThreadCycleTime(long ptr)
 # @ stub QueryThreadProfiling
-# @ stub QueryThreadpoolStackInformation
+@ stdcall -import QueryThreadpoolStackInformation(ptr ptr)
 @ stdcall -arch=x86_64 QueryUmsThreadInformation(ptr long ptr long ptr)
 @ stdcall -import QueryUnbiasedInterruptTime(ptr)
 @ stub QueryWin31IniFilesMappedToRegistry
@@ -1462,7 +1462,7 @@
 @ stdcall -import SetThreadStackGuarantee(ptr)
 # @ stub SetThreadToken
 @ stdcall -import SetThreadUILanguage(long)
-# @ stub SetThreadpoolStackInformation
+@ stdcall -import SetThreadpoolStackInformation(ptr ptr)
 @ stdcall SetThreadpoolThreadMaximum(ptr long) ntdll.TpSetPoolMaxThreads
 @ stdcall SetThreadpoolThreadMinimum(ptr long) ntdll.TpSetPoolMinThreads
 @ stdcall SetThreadpoolTimer(ptr ptr long long) ntdll.TpSetTimer
diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec
index caa6de1d51..d9f50e8789 100644
--- a/dlls/kernelbase/kernelbase.spec
+++ b/dlls/kernelbase/kernelbase.spec
@@ -1213,7 +1213,7 @@
 # @ stub QueryStateContainerCreatedNew
 # @ stub QueryStateContainerItemInfo
 @ stdcall QueryThreadCycleTime(long ptr) kernel32.QueryThreadCycleTime
-@ stub QueryThreadpoolStackInformation
+@ stdcall QueryThreadpoolStackInformation(ptr ptr)
 @ stdcall QueryUnbiasedInterruptTime(ptr) ntdll.RtlQueryUnbiasedInterruptTime
 # @ stub QueryUnbiasedInterruptTimePrecise
 # @ stub QueryVirtualMemoryInformation
@@ -1492,7 +1492,7 @@
 @ stdcall SetThreadStackGuarantee(ptr)
 @ stdcall SetThreadToken(ptr ptr)
 @ stdcall SetThreadUILanguage(long)
-@ stub SetThreadpoolStackInformation
+@ stdcall SetThreadpoolStackInformation(ptr ptr)
 @ stdcall SetThreadpoolThreadMaximum(ptr long) ntdll.TpSetPoolMaxThreads
 @ stdcall SetThreadpoolThreadMinimum(ptr long) ntdll.TpSetPoolMinThreads
 @ stdcall SetThreadpoolTimer(ptr ptr long long) ntdll.TpSetTimer
diff --git a/dlls/kernelbase/thread.c b/dlls/kernelbase/thread.c
index 6af9ffa406..94ea9c49de 100644
--- a/dlls/kernelbase/thread.c
+++ b/dlls/kernelbase/thread.c
@@ -1254,3 +1254,19 @@ BOOL WINAPI DECLSPEC_HOTPATCH QueueUserWorkItem( LPTHREAD_START_ROUTINE func, PV
 {
     return set_ntstatus( RtlQueueWorkItem( func, context, flags ));
 }
+
+/***********************************************************************
+ *           SetThreadpoolStackInformation   (kernelbase.@)
+ */
+BOOL WINAPI DECLSPEC_HOTPATCH SetThreadpoolStackInformation( PTP_POOL pool, PTP_POOL_STACK_INFORMATION stack_info )
+{
+    return set_ntstatus( TpSetPoolStackInformation( pool, stack_info ));
+}
+
+/***********************************************************************
+ *           QueryThreadpoolStackInformation   (kernelbase.@)
+ */
+BOOL WINAPI DECLSPEC_HOTPATCH QueryThreadpoolStackInformation( PTP_POOL pool, PTP_POOL_STACK_INFORMATION stack_info )
+{
+    return set_ntstatus( TpQueryPoolStackInformation( pool, stack_info ));
+}
diff --git a/include/threadpoolapiset.h b/include/threadpoolapiset.h
index 010ee3acf6..e218834726 100644
--- a/include/threadpoolapiset.h
+++ b/include/threadpoolapiset.h
@@ -43,9 +43,11 @@ WINBASEAPI void        WINAPI DisassociateCurrentThreadFromCallback(PTP_CALLBACK
 WINBASEAPI void        WINAPI FreeLibraryWhenCallbackReturns(PTP_CALLBACK_INSTANCE,HMODULE);
 WINBASEAPI BOOL        WINAPI IsThreadpoolTimerSet(PTP_TIMER);
 WINBASEAPI void        WINAPI LeaveCriticalSectionWhenCallbackReturns(PTP_CALLBACK_INSTANCE,RTL_CRITICAL_SECTION*);
+WINBASEAPI BOOL        WINAPI QueryThreadpoolStackInformation(PTP_POOL,PTP_POOL_STACK_INFORMATION);
 WINBASEAPI void        WINAPI ReleaseMutexWhenCallbackReturns(PTP_CALLBACK_INSTANCE,HANDLE);
 WINBASEAPI void        WINAPI ReleaseSemaphoreWhenCallbackReturns(PTP_CALLBACK_INSTANCE,HANDLE,DWORD);
 WINBASEAPI void        WINAPI SetEventWhenCallbackReturns(PTP_CALLBACK_INSTANCE,HANDLE);
+WINBASEAPI BOOL        WINAPI SetThreadpoolStackInformation(PTP_POOL,PTP_POOL_STACK_INFORMATION);
 WINBASEAPI void        WINAPI SetThreadpoolThreadMaximum(PTP_POOL,DWORD);
 WINBASEAPI BOOL        WINAPI SetThreadpoolThreadMinimum(PTP_POOL,DWORD);
 WINBASEAPI void        WINAPI SetThreadpoolTimer(PTP_TIMER,FILETIME*,DWORD,DWORD);




More information about the wine-cvs mailing list