Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
Stack sizes are only stored as pool parameters for now.
These are meant to replace 178405 and 178406.
dlls/ntdll/ntdll.spec | 2 ++ dlls/ntdll/tests/threadpool.c | 32 ++++++++++++++++++++++ dlls/ntdll/threadpool.c | 50 ++++++++++++++++++++++++++++++++--- include/winternl.h | 2 ++ 4 files changed, 82 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index fe36235bda..7aa953ca6c 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -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) diff --git a/dlls/ntdll/tests/threadpool.c b/dlls/ntdll/tests/threadpool.c index bf5493cac0..912a77b82a 100644 --- a/dlls/ntdll/tests/threadpool.c +++ b/dlls/ntdll/tests/threadpool.c @@ -30,6 +30,7 @@ static NTSTATUS (WINAPI *pTpCallbackMayRunLong)(TP_CALLBACK_INSTANCE *); static VOID (WINAPI *pTpCallbackReleaseSemaphoreOnCompletion)(TP_CALLBACK_INSTANCE *,HANDLE,DWORD); static VOID (WINAPI *pTpDisassociateCallback)(TP_CALLBACK_INSTANCE *); static BOOL (WINAPI *pTpIsTimerSet)(TP_TIMER *); +static NTSTATUS (WINAPI *pTpQueryPoolStackInformation)(TP_POOL *, TP_POOL_STACK_INFORMATION *info); static VOID (WINAPI *pTpReleaseWait)(TP_WAIT *); static VOID (WINAPI *pTpPostWork)(TP_WORK *); static VOID (WINAPI *pTpReleaseCleanupGroup)(TP_CLEANUP_GROUP *); @@ -37,6 +38,7 @@ static VOID (WINAPI *pTpReleaseCleanupGroupMembers)(TP_CLEANUP_GROUP *,BOOL, static VOID (WINAPI *pTpReleasePool)(TP_POOL *); static VOID (WINAPI *pTpReleaseTimer)(TP_TIMER *); static VOID (WINAPI *pTpReleaseWork)(TP_WORK *); +static NTSTATUS (WINAPI *pTpSetPoolStackInformation)(TP_POOL *, TP_POOL_STACK_INFORMATION *info); static VOID (WINAPI *pTpSetPoolMaxThreads)(TP_POOL *,DWORD); static VOID (WINAPI *pTpSetTimer)(TP_TIMER *,LARGE_INTEGER *,LONG,LONG); static VOID (WINAPI *pTpSetWait)(TP_WAIT *,HANDLE,LARGE_INTEGER *); @@ -72,12 +74,14 @@ static BOOL init_threadpool(void) NTDLL_GET_PROC(TpDisassociateCallback); NTDLL_GET_PROC(TpIsTimerSet); NTDLL_GET_PROC(TpPostWork); + NTDLL_GET_PROC(TpQueryPoolStackInformation); NTDLL_GET_PROC(TpReleaseCleanupGroup); NTDLL_GET_PROC(TpReleaseCleanupGroupMembers); NTDLL_GET_PROC(TpReleasePool); NTDLL_GET_PROC(TpReleaseTimer); NTDLL_GET_PROC(TpReleaseWait); NTDLL_GET_PROC(TpReleaseWork); + NTDLL_GET_PROC(TpSetPoolStackInformation); NTDLL_GET_PROC(TpSetPoolMaxThreads); NTDLL_GET_PROC(TpSetTimer); NTDLL_GET_PROC(TpSetWait); @@ -601,6 +605,7 @@ static void CALLBACK work2_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP
static void test_tp_work(void) { + TP_POOL_STACK_INFORMATION stack_info, stack_info2; TP_CALLBACK_ENVIRON environment; TP_WORK *work; TP_POOL *pool; @@ -615,6 +620,33 @@ static void test_tp_work(void) ok(pool != NULL, "expected pool != NULL\n"); pTpSetPoolMaxThreads(pool, 1);
+ if (pTpQueryPoolStackInformation) + { + status = pTpQueryPoolStackInformation(pool, NULL); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %#x.\n", status); + + status = pTpSetPoolStackInformation(pool, NULL); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %#x.\n", status); + + status = pTpQueryPoolStackInformation(pool, &stack_info); + ok(!status, "Failed to get stack information, status %#x.\n", status); + ok(stack_info.StackReserve > 0 && stack_info.StackCommit > 0, "Unexpected stack info.\n"); + + stack_info2.StackReserve = 0; + stack_info2.StackCommit = 0; + status = pTpSetPoolStackInformation(pool, &stack_info2); + ok(!status, "Failed to get stack information, status %#x.\n", status); + + memset(&stack_info2, 0xcc, sizeof(stack_info2)); + status = pTpQueryPoolStackInformation(pool, &stack_info2); + ok(!status, "Failed to get stack information, status %#x.\n", status); + ok(!stack_info2.StackReserve && !stack_info2.StackCommit, "Unexpected stack info.\n"); + + /* Restore to original default values. */ + status = pTpSetPoolStackInformation(pool, &stack_info); + ok(!status, "Failed to get stack information, status %#x.\n", status); + } + /* allocate new work item */ work = NULL; memset(&environment, 0, sizeof(environment)); diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c index a7ad321a8b..b7a096f981 100644 --- a/dlls/ntdll/threadpool.c +++ b/dlls/ntdll/threadpool.c @@ -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; +} diff --git a/include/winternl.h b/include/winternl.h index ea6707714d..5298eaa0f7 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -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 *);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- .../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);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64991
Your paranoid android.
=== debian10 (32 bit report) ===
kernel32: comm.c:918: Test failed: OutQueue should not be empty
=== debian10 (32 bit Chinese:China report) ===
kernel32: comm.c:918: Test failed: OutQueue should not be empty
=== debian10 (32 bit WoW report) ===
kernel32: comm.c:918: Test failed: OutQueue should not be empty
=== debian10 (64 bit WoW report) ===
kernel32: comm.c:918: Test failed: OutQueue should not be empty debugger.c:305: Test failed: GetThreadContext failed: 5
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- .../api-ms-win-core-threadpool-l1-1-0.spec | 2 +- .../api-ms-win-core-threadpool-l1-2-0.spec | 2 +- dlls/kernel32/kernel32.spec | 2 +- dlls/kernelbase/kernelbase.spec | 2 +- dlls/ntdll/threadpool.c | 8 ++++++++ include/winternl.h | 1 + 6 files changed, 13 insertions(+), 4 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 9cefa5aed5..a8a264182a 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 @@ -32,7 +32,7 @@ @ stdcall SetThreadpoolThreadMinimum(ptr long) kernel32.SetThreadpoolThreadMinimum @ stdcall SetThreadpoolTimer(ptr ptr long long) kernel32.SetThreadpoolTimer @ stdcall SetThreadpoolWait(ptr long ptr) kernel32.SetThreadpoolWait -@ stub StartThreadpoolIo +@ stdcall StartThreadpoolIo(ptr) kernel32.StartThreadpoolIo @ stdcall SubmitThreadpoolWork(ptr) kernel32.SubmitThreadpoolWork @ stdcall TrySubmitThreadpoolCallback(ptr ptr ptr) kernel32.TrySubmitThreadpoolCallback @ stdcall UnregisterWaitEx(long long) kernel32.UnregisterWaitEx 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 9510c5bcf2..fc373c3c89 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 @@ -28,7 +28,7 @@ @ stub SetThreadpoolTimerEx @ stdcall SetThreadpoolWait(ptr long ptr) kernel32.SetThreadpoolWait @ stub SetThreadpoolWaitEx -@ stub StartThreadpoolIo +@ stdcall StartThreadpoolIo(ptr) kernel32.StartThreadpoolIo @ stdcall SubmitThreadpoolWork(ptr) kernel32.SubmitThreadpoolWork @ stdcall TrySubmitThreadpoolCallback(ptr ptr ptr) kernel32.TrySubmitThreadpoolCallback @ stub WaitForThreadpoolIoCallbacks diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index d138df9fc1..b7c148395b 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -1490,7 +1490,7 @@ @ stdcall -import SleepEx(long long) # @ stub SortCloseHandle # @ stub SortGetHandle -# @ stub StartThreadpoolIo +@ stdcall StartThreadpoolIo(ptr) ntdll.TpStartAsyncIoOperation @ stdcall SubmitThreadpoolWork(ptr) ntdll.TpPostWork @ stdcall -import SuspendThread(long) @ stdcall -import SwitchToFiber(ptr) diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index d9f50e8789..7f928e3085 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -1515,7 +1515,7 @@ @ stdcall SleepConditionVariableSRW(ptr ptr long long) @ stdcall SleepEx(long long) @ stub SpecialMBToWC -@ stub StartThreadpoolIo +@ stdcall StartThreadpoolIo(ptr) ntdll.TpStartAsyncIoOperation # @ stub StmAlignSize # @ stub StmAllocateFlat # @ stub StmCoalesceChunks diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c index b7a096f981..4b4bdf2cd7 100644 --- a/dlls/ntdll/threadpool.c +++ b/dlls/ntdll/threadpool.c @@ -3031,3 +3031,11 @@ NTSTATUS WINAPI TpQueryPoolStackInformation( TP_POOL *pool, TP_POOL_STACK_INFORM
return STATUS_SUCCESS; } + +/*********************************************************************** + * TpStartAsyncIoOperation (NTDLL.@) + */ +void WINAPI TpStartAsyncIoOperation( TP_IO *io ) +{ + FIXME( "%p\n", io ); +} diff --git a/include/winternl.h b/include/winternl.h index 5298eaa0f7..940337153d 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -3028,6 +3028,7 @@ NTSYSAPI void WINAPI TpReleasePool(TP_POOL *); NTSYSAPI void WINAPI TpReleaseTimer(TP_TIMER *); NTSYSAPI void WINAPI TpReleaseWait(TP_WAIT *); NTSYSAPI void WINAPI TpReleaseWork(TP_WORK *); +NTSYSAPI void WINAPI TpStartAsyncIoOperation(TP_IO *); 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);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64993
Your paranoid android.
=== debian10 (32 bit report) ===
kernel32: comm.c:918: Test failed: OutQueue should not be empty debugger.c:305: Test failed: GetThreadContext failed: 5
=== debian10 (32 bit Chinese:China report) ===
kernel32: comm.c:918: Test failed: OutQueue should not be empty
=== debian10 (32 bit WoW report) ===
kernel32: comm.c:918: Test failed: OutQueue should not be empty
ntdll: pipe.c:1557: Test failed: pipe is not signaled
=== debian10 (64 bit WoW report) ===
kernel32: comm.c:918: Test failed: OutQueue should not be empty debugger.c:305: Test failed: GetThreadContext failed: 5
I'm a bit confused about this patch.
I can see how api-horribly-long-name.StartThreadpoolIo goes to kernel32.StartThreadpoolIo which then goes to ntdll.TpStartAsyncIoOperation.
But as far as I can tell Wine's ntdll is not exporting TpStartAsyncIoOperation(): it's not mentioned anywhere in ntdll.spec. In fact, as far as I can tell it's not used anywhere.
Am I missing something?
W dniu sob., 15.02.2020 o 14:54 Francois Gouget fgouget@free.fr napisał(a):
I'm a bit confused about this patch.
I can see how api-horribly-long-name.StartThreadpoolIo goes to kernel32.StartThreadpoolIo which then goes to ntdll.TpStartAsyncIoOperation.
But as far as I can tell Wine's ntdll is not exporting TpStartAsyncIoOperation(): it's not mentioned anywhere in ntdll.spec. In fact, as far as I can tell it's not used anywhere.
Am I missing something?
I don’t think you miss anything. Looks like I forgot to add it there.
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ Any sufficiently advanced bug is indistinguishable from a feature. -- from some indian guy
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64990
Your paranoid android.
=== wxppro (32 bit report) ===
=== w8adm (32 bit report) ===
ntdll: threadpool.c:164 threadpool.c:320: Test failed: WaitForSingleObject returned 258 threadpool.c:321: Test failed: expected info.userdata = 1, got 0 threadpool.c:322: Test failed: expected info.threadid != 0, got 0 threadpool.c:371: Test failed: threadpool.c:164 WaitForSingleObject returned 258 threadpool.c:372: Test failed: Running rtl_wait callback threadpool.c:383: Test failed: expected info.userdata = 0x10000, got 0 threadpool.c:394: Test failed: threadpool.c:164 Running rtl_wait callback threadpool.c:413: Test failed: expected info.userdata = 1, got 0 threadpool.c:164 threadpool.c:426: Test failed: expected info.userdata = 1, got 0 threadpool.c:440: Test failed: expected info.userdata = 1, got 0 threadpool.c:453: Test failed: expected info.userdata = 1, got 0 threadpool.c:1365: Test failed: WaitForSingleObject returned 258 threadpool.c:1379: Test failed: WaitForSingleObject returned 0 threadpool.c:1381: Test failed: WaitForSingleObject returned 258
=== w1064v1507 (32 bit report) ===
ntdll: threadpool.c:164 threadpool.c:320: Test failed: WaitForSingleObject returned 258 threadpool.c:321: Test failed: expected info.userdata = 1, got 0 threadpool.c:322: Test failed: expected info.threadid != 0, got 0 threadpool.c:324: Test failed: OpenThread failed with 87 threadpool.c:327: Test failed: QueueUserAPC failed with 6 threadpool.c:1394: Test failed: WaitForSingleObject returned 258 threadpool.c:1433: Test failed: expected approximately 600 ticks, got 906 threadpool.c:1629: Test failed: WaitForSingleObject returned 258 threadpool.c:1639: Test failed: WaitForSingleObject returned 0 threadpool.c:1642: Test failed: WaitForSingleObject returned 258 threadpool.c:1652: Test failed: WaitForSingleObject returned 0 threadpool.c:1674: Test failed: WaitForSingleObject returned 258 threadpool.c:1684: Test failed: WaitForSingleObject returned 0 threadpool.c:1713: Test failed: WaitForSingleObject returned 258 threadpool.c:1724: Test failed: WaitForSingleObject returned 0 threadpool.c:1763: Test failed: WaitForSingleObject returned 258 threadpool.c:1771: Test failed: WaitForSingleObject returned 0 threadpool.c:1807: Test failed: threadpool.c:1575 Running wait callback
=== w1064v1809_2scr (32 bit report) ===
ntdll: threadpool.c:320: Test failed: WaitForSingleObject returned 258 threadpool.c:335: Test failed: WaitForSingleObject returned 258 threadpool.c:372: Test failed: expected info.userdata = 0x10000, got 0 threadpool.c:375: Test failed: RtlDeregisterWaitEx failed with status 103 threadpool.c:383: Test failed: expected info.userdata = 0x10000, got 0 threadpool.c:394: Test failed: expected info.userdata = 0x10000, got 0 threadpool.c:413: Test failed: expected info.userdata = 1, got 0 threadpool.c:426: Test failed: expected info.userdata = 1, got 0 threadpool.c:440: Test failed: threadpool.c:164 Running rtl_wait callback threadpool.c:453: Test failed: expected info.userdata = 1, got 0
=== w1064v1809_ar (32 bit report) ===
ntdll: threadpool.c:320: Test failed: WaitForSingleObject returned 258
=== w1064v1809_ja (32 bit report) ===
ntdll: threadpool.c:1763: Test failed: WaitForSingleObject returned 258 threadpool.c:1771: Test failed: WaitForSingleObject returned 0
=== w864 (64 bit report) ===
ntdll: threadpool.c:164 threadpool.c:320: Test failed: WaitForSingleObject returned 258 threadpool.c:321: Test failed: expected info.userdata = 1, got 0 threadpool.c:322: Test failed: expected info.threadid != 0, got 0 threadpool.c:324: Test failed: Running rtl_wait callback threadpool.c:327: Test failed: QueueUserAPC failed with 6 threadpool.c:164 threadpool.c:371: Test failed: WaitForSingleObject returned 258 threadpool.c:372: Test failed: expected info.userdata = 0x10000, got 0 threadpool.c:383: Test failed: expected info.userdata = 0x10000, got 0 threadpool.c:394: Test failed: threadpool.c:164 Running rtl_wait callback threadpool.c:164 threadpool.c:413: Test failed: Running rtl_wait callback threadpool.c:426: Test failed: expected info.userdata = 1, got 0 threadpool.c:164 threadpool.c:440: Test failed: expected info.userdata = 1, got 0 threadpool.c:453: Test failed: expected info.userdata = 1, got 0
=== w1064v1507 (64 bit report) ===
ntdll: threadpool.c:371: Test failed: WaitForSingleObject returned 258 threadpool.c:383: Test failed: expected info.userdata = 0x10000, got 0 threadpool.c:394: Test failed: expected info.userdata = 0x10000, got 0 threadpool.c:413: Test failed: expected info.userdata = 1, got 0 threadpool.c:426: Test failed: expected info.userdata = 1, got 0 threadpool.c:440: Test failed: expected info.userdata = 1, got 0 threadpool.c:453: Test failed: expected info.userdata = 1, got 0
=== w1064v1809 (64 bit report) ===
ntdll: threadpool.c:382: Test failed: WaitForSingleObject returned 258 threadpool.c:394: Test failed: expected info.userdata = 0x10000, got 0 threadpool.c:413: Test failed: expected info.userdata = 1, got 0 threadpool.c:426: Test failed: expected info.userdata = 1, got 0 threadpool.c:440: Test failed: expected info.userdata = 1, got 0 threadpool.c:453: Test failed: expected info.userdata = 1, got 0
=== debian10 (32 bit Chinese:China report) ===
On 2/12/20 10:14 AM, Marvin wrote:
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64990
Your paranoid android.
This also fails if I comment out new tests and run it manually, no idea why. I'm going to resend without them.