Commit eadd27a3 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

kernel32: Forward remaining threadpool functions to ntdll.

parent 56b9af11
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
# @ stub ClosePrivateNamespace # @ stub ClosePrivateNamespace
@ stdcall CloseProfileUserMapping() @ stdcall CloseProfileUserMapping()
@ stub CloseSystemHandle @ stub CloseSystemHandle
# @ stub CloseThreadpool @ stdcall CloseThreadpool(ptr) ntdll.TpReleasePool
@ stdcall CloseThreadpoolCleanupGroup(ptr) ntdll.TpReleaseCleanupGroup @ stdcall CloseThreadpoolCleanupGroup(ptr) ntdll.TpReleaseCleanupGroup
@ stdcall CloseThreadpoolCleanupGroupMembers(ptr long ptr) ntdll.TpReleaseCleanupGroupMembers @ stdcall CloseThreadpoolCleanupGroupMembers(ptr long ptr) ntdll.TpReleaseCleanupGroupMembers
# @ stub CloseThreadpoolIo # @ stub CloseThreadpoolIo
...@@ -331,7 +331,7 @@ ...@@ -331,7 +331,7 @@
@ stdcall CreateSymbolicLinkW(wstr wstr long) @ stdcall CreateSymbolicLinkW(wstr wstr long)
@ stdcall CreateTapePartition(long long long long) @ stdcall CreateTapePartition(long long long long)
@ stdcall CreateThread(ptr long ptr long long ptr) @ stdcall CreateThread(ptr long ptr long long ptr)
# @ stub CreateThreadpool @ stdcall CreateThreadpool(ptr)
@ stdcall CreateThreadpoolCleanupGroup() @ stdcall CreateThreadpoolCleanupGroup()
# @ stub CreateThreadpoolIo # @ stub CreateThreadpoolIo
@ stdcall CreateThreadpoolTimer(ptr ptr ptr) @ stdcall CreateThreadpoolTimer(ptr ptr ptr)
...@@ -1454,8 +1454,8 @@ ...@@ -1454,8 +1454,8 @@
# @ stub SetThreadToken # @ stub SetThreadToken
@ stdcall SetThreadUILanguage(long) @ stdcall SetThreadUILanguage(long)
# @ stub SetThreadpoolStackInformation # @ stub SetThreadpoolStackInformation
# @ stub SetThreadpoolThreadMaximum @ stdcall SetThreadpoolThreadMaximum(ptr long) ntdll.TpSetPoolMaxThreads
# @ stub SetThreadpoolThreadMinimum @ stdcall SetThreadpoolThreadMinimum(ptr long) ntdll.TpSetPoolMinThreads
@ stdcall SetThreadpoolTimer(ptr ptr long long) @ stdcall SetThreadpoolTimer(ptr ptr long long)
# @ stub SetThreadpoolWait # @ stub SetThreadpoolWait
@ stdcall SetTimeZoneInformation(ptr) @ stdcall SetTimeZoneInformation(ptr)
...@@ -1509,7 +1509,7 @@ ...@@ -1509,7 +1509,7 @@
@ stdcall TryAcquireSRWLockExclusive(ptr) ntdll.RtlTryAcquireSRWLockExclusive @ stdcall TryAcquireSRWLockExclusive(ptr) ntdll.RtlTryAcquireSRWLockExclusive
@ stdcall TryAcquireSRWLockShared(ptr) ntdll.RtlTryAcquireSRWLockShared @ stdcall TryAcquireSRWLockShared(ptr) ntdll.RtlTryAcquireSRWLockShared
@ stdcall TryEnterCriticalSection(ptr) ntdll.RtlTryEnterCriticalSection @ stdcall TryEnterCriticalSection(ptr) ntdll.RtlTryEnterCriticalSection
# @ stub TrySubmitThreadpoolCallback @ stdcall TrySubmitThreadpoolCallback(ptr ptr ptr)
@ stdcall TzSpecificLocalTimeToSystemTime(ptr ptr ptr) @ stdcall TzSpecificLocalTimeToSystemTime(ptr ptr ptr)
# @ stub TzSpecificLocalTimeToSystemTimeEx # @ stub TzSpecificLocalTimeToSystemTimeEx
# @ stub -arch=x86_64 uaw_lstrcmpW # @ stub -arch=x86_64 uaw_lstrcmpW
......
...@@ -1627,8 +1627,8 @@ static void test_threadpool(void) ...@@ -1627,8 +1627,8 @@ static void test_threadpool(void)
int workcalled = 0; int workcalled = 0;
if (!pCreateThreadpool) { if (!pCreateThreadpool) {
todo_wine win_skip("thread pool apis not supported.\n"); win_skip("thread pool apis not supported.\n");
return; return;
} }
work = pCreateThreadpoolWork(threadpool_workcallback, &workcalled, NULL); work = pCreateThreadpoolWork(threadpool_workcallback, &workcalled, NULL);
...@@ -1640,7 +1640,7 @@ static void test_threadpool(void) ...@@ -1640,7 +1640,7 @@ static void test_threadpool(void)
ok (workcalled == 1, "expected work to be called once, got %d\n", workcalled); ok (workcalled == 1, "expected work to be called once, got %d\n", workcalled);
pool = pCreateThreadpool(NULL); pool = pCreateThreadpool(NULL);
todo_wine ok (pool != NULL, "CreateThreadpool failed\n"); ok (pool != NULL, "CreateThreadpool failed\n");
} }
static void test_reserved_tls(void) static void test_reserved_tls(void)
......
...@@ -881,6 +881,26 @@ BOOL WINAPI CallbackMayRunLong( TP_CALLBACK_INSTANCE *instance ) ...@@ -881,6 +881,26 @@ BOOL WINAPI CallbackMayRunLong( TP_CALLBACK_INSTANCE *instance )
} }
/*********************************************************************** /***********************************************************************
* CreateThreadpool (KERNEL32.@)
*/
PTP_POOL WINAPI CreateThreadpool( PVOID reserved )
{
TP_POOL *pool;
NTSTATUS status;
TRACE( "%p\n", reserved );
status = TpAllocPool( &pool, reserved );
if (status)
{
SetLastError( RtlNtStatusToDosError(status) );
return NULL;
}
return pool;
}
/***********************************************************************
* CreateThreadpoolCleanupGroup (KERNEL32.@) * CreateThreadpoolCleanupGroup (KERNEL32.@)
*/ */
PTP_CLEANUP_GROUP WINAPI CreateThreadpoolCleanupGroup( void ) PTP_CLEANUP_GROUP WINAPI CreateThreadpoolCleanupGroup( void )
...@@ -960,3 +980,23 @@ VOID WINAPI SetThreadpoolTimer( TP_TIMER *timer, FILETIME *due_time, ...@@ -960,3 +980,23 @@ VOID WINAPI SetThreadpoolTimer( TP_TIMER *timer, FILETIME *due_time,
TpSetTimer( timer, due_time ? &timeout : NULL, period, window_length ); TpSetTimer( timer, due_time ? &timeout : NULL, period, window_length );
} }
/***********************************************************************
* TrySubmitThreadpoolCallback (KERNEL32.@)
*/
BOOL WINAPI TrySubmitThreadpoolCallback( PTP_SIMPLE_CALLBACK callback, PVOID userdata,
TP_CALLBACK_ENVIRON *environment )
{
NTSTATUS status;
TRACE( "%p, %p, %p\n", callback, userdata, environment );
status = TpSimpleTryPost( callback, userdata, environment );
if (status)
{
SetLastError( RtlNtStatusToDosError(status) );
return FALSE;
}
return TRUE;
}
...@@ -2619,6 +2619,7 @@ NTSYSAPI NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PC ...@@ -2619,6 +2619,7 @@ NTSYSAPI NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PC
/* Threadpool functions */ /* Threadpool functions */
NTSYSAPI NTSTATUS WINAPI TpAllocCleanupGroup(TP_CLEANUP_GROUP **); NTSYSAPI NTSTATUS WINAPI TpAllocCleanupGroup(TP_CLEANUP_GROUP **);
NTSYSAPI NTSTATUS WINAPI TpAllocPool(TP_POOL **,PVOID);
NTSYSAPI NTSTATUS WINAPI TpAllocTimer(TP_TIMER **,PTP_TIMER_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *); NTSYSAPI NTSTATUS WINAPI TpAllocTimer(TP_TIMER **,PTP_TIMER_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
NTSYSAPI NTSTATUS WINAPI TpAllocWork(TP_WORK **,PTP_WORK_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *); NTSYSAPI NTSTATUS WINAPI TpAllocWork(TP_WORK **,PTP_WORK_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
NTSYSAPI void WINAPI TpCallbackLeaveCriticalSectionOnCompletion(TP_CALLBACK_INSTANCE *,RTL_CRITICAL_SECTION *); NTSYSAPI void WINAPI TpCallbackLeaveCriticalSectionOnCompletion(TP_CALLBACK_INSTANCE *,RTL_CRITICAL_SECTION *);
...@@ -2632,9 +2633,13 @@ NTSYSAPI BOOL WINAPI TpIsTimerSet(TP_TIMER *); ...@@ -2632,9 +2633,13 @@ NTSYSAPI BOOL WINAPI TpIsTimerSet(TP_TIMER *);
NTSYSAPI void WINAPI TpPostWork(TP_WORK *); NTSYSAPI void WINAPI TpPostWork(TP_WORK *);
NTSYSAPI void WINAPI TpReleaseCleanupGroup(TP_CLEANUP_GROUP *); NTSYSAPI void WINAPI TpReleaseCleanupGroup(TP_CLEANUP_GROUP *);
NTSYSAPI void WINAPI TpReleaseCleanupGroupMembers(TP_CLEANUP_GROUP *,BOOL,PVOID); NTSYSAPI void WINAPI TpReleaseCleanupGroupMembers(TP_CLEANUP_GROUP *,BOOL,PVOID);
NTSYSAPI void WINAPI TpReleasePool(TP_POOL *);
NTSYSAPI void WINAPI TpReleaseTimer(TP_TIMER *); NTSYSAPI void WINAPI TpReleaseTimer(TP_TIMER *);
NTSYSAPI void WINAPI TpReleaseWork(TP_WORK *); NTSYSAPI void WINAPI TpReleaseWork(TP_WORK *);
NTSYSAPI void WINAPI TpSetPoolMaxThreads(TP_POOL *,DWORD);
NTSYSAPI BOOL WINAPI TpSetPoolMinThreads(TP_POOL *,DWORD);
NTSYSAPI void WINAPI TpSetTimer(TP_TIMER *, LARGE_INTEGER *,LONG,LONG); NTSYSAPI void WINAPI TpSetTimer(TP_TIMER *, LARGE_INTEGER *,LONG,LONG);
NTSYSAPI NTSTATUS WINAPI TpSimpleTryPost(PTP_SIMPLE_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
NTSYSAPI void WINAPI TpWaitForTimer(TP_TIMER *,BOOL); NTSYSAPI void WINAPI TpWaitForTimer(TP_TIMER *,BOOL);
NTSYSAPI void WINAPI TpWaitForWork(TP_WORK *,BOOL); NTSYSAPI void WINAPI TpWaitForWork(TP_WORK *,BOOL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment