kernelbase: Implement CreateThreadpoolIo.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1da0d17419
commit
b66e13ef24
|
@ -1187,14 +1187,23 @@ PTP_CLEANUP_GROUP WINAPI DECLSPEC_HOTPATCH CreateThreadpoolCleanupGroup(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void WINAPI tp_io_callback( TP_CALLBACK_INSTANCE *instance, void *userdata, void *cvalue, IO_STATUS_BLOCK *iosb, TP_IO *io )
|
||||||
|
{
|
||||||
|
PTP_WIN32_IO_CALLBACK callback = *(void **)io;
|
||||||
|
callback( instance, userdata, cvalue, RtlNtStatusToDosError( iosb->u.Status ), iosb->Information, io );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* CreateThreadpoolIo (kernelbase.@)
|
* CreateThreadpoolIo (kernelbase.@)
|
||||||
*/
|
*/
|
||||||
PTP_IO WINAPI /* DECLSPEC_HOTPATCH */ CreateThreadpoolIo( HANDLE handle, PTP_WIN32_IO_CALLBACK callback,
|
PTP_IO WINAPI DECLSPEC_HOTPATCH CreateThreadpoolIo( HANDLE handle, PTP_WIN32_IO_CALLBACK callback,
|
||||||
PVOID userdata, TP_CALLBACK_ENVIRON *environment )
|
PVOID userdata, TP_CALLBACK_ENVIRON *environment )
|
||||||
{
|
{
|
||||||
FIXME( "(%p, %p, %p, %p): stub\n", handle, callback, userdata, environment );
|
TP_IO *io;
|
||||||
return FALSE;
|
if (!set_ntstatus( TpAllocIoCompletion( &io, handle, tp_io_callback, userdata, environment ))) return NULL;
|
||||||
|
*(void **)io = callback; /* ntdll leaves us space to store our callback at the beginning of TP_IO struct */
|
||||||
|
return io;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2130,9 +2130,7 @@ static void test_kernel32_tp_io(void)
|
||||||
environment.Pool = pool;
|
environment.Pool = pool;
|
||||||
io = NULL;
|
io = NULL;
|
||||||
io = pCreateThreadpoolIo(server, kernel32_io_cb, &userdata, &environment);
|
io = pCreateThreadpoolIo(server, kernel32_io_cb, &userdata, &environment);
|
||||||
todo_wine ok(!!io, "expected non-NULL TP_IO\n");
|
ok(!!io, "expected non-NULL TP_IO\n");
|
||||||
if (!io)
|
|
||||||
return;
|
|
||||||
|
|
||||||
pWaitForThreadpoolIoCallbacks(io, FALSE);
|
pWaitForThreadpoolIoCallbacks(io, FALSE);
|
||||||
|
|
||||||
|
|
|
@ -153,6 +153,7 @@ struct io_completion
|
||||||
/* internal threadpool object representation */
|
/* internal threadpool object representation */
|
||||||
struct threadpool_object
|
struct threadpool_object
|
||||||
{
|
{
|
||||||
|
void *win32_callback; /* leave space for kernelbase to store win32 callback */
|
||||||
LONG refcount;
|
LONG refcount;
|
||||||
BOOL shutdown;
|
BOOL shutdown;
|
||||||
/* read-only information */
|
/* read-only information */
|
||||||
|
|
Loading…
Reference in New Issue