mfplat: Use newer threadpool environment structure.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2019-03-13 09:29:32 +03:00 committed by Alexandre Julliard
parent 733b438583
commit 1654116dd2
1 changed files with 8 additions and 5 deletions

View File

@ -62,7 +62,7 @@ struct work_item
struct queue struct queue
{ {
TP_POOL *pool; TP_POOL *pool;
TP_CALLBACK_ENVIRON env; TP_CALLBACK_ENVIRON_V3 env;
CRITICAL_SECTION cs; CRITICAL_SECTION cs;
struct list pending_items; struct list pending_items;
}; };
@ -163,10 +163,13 @@ static void init_work_queue(MFASYNC_WORKQUEUE_TYPE queue_type, struct queue *que
unsigned int max_thread; unsigned int max_thread;
queue->pool = CreateThreadpool(NULL); queue->pool = CreateThreadpool(NULL);
queue->env.Version = 1; memset(&queue->env, 0, sizeof(queue->env));
queue->env.Version = 3;
queue->env.Size = sizeof(queue->env);
queue->env.Pool = queue->pool; queue->env.Pool = queue->pool;
queue->env.CleanupGroup = CreateThreadpoolCleanupGroup(); queue->env.CleanupGroup = CreateThreadpoolCleanupGroup();
queue->env.CleanupGroupCancelCallback = standard_queue_cleanup_callback; queue->env.CleanupGroupCancelCallback = standard_queue_cleanup_callback;
queue->env.CallbackPriority = TP_CALLBACK_PRIORITY_NORMAL;
list_init(&queue->pending_items); list_init(&queue->pending_items);
InitializeCriticalSection(&queue->cs); InitializeCriticalSection(&queue->cs);
@ -344,7 +347,7 @@ static HRESULT queue_submit_item(struct queue *queue, IMFAsyncResult *result)
if (!(item = alloc_work_item(queue, result))) if (!(item = alloc_work_item(queue, result)))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
work_object = CreateThreadpoolWork(standard_queue_worker, item, &queue->env); work_object = CreateThreadpoolWork(standard_queue_worker, item, (TP_CALLBACK_ENVIRON *)&queue->env);
SubmitThreadpoolWork(work_object); SubmitThreadpoolWork(work_object);
TRACE("dispatched %p.\n", result); TRACE("dispatched %p.\n", result);
@ -483,7 +486,7 @@ static HRESULT queue_submit_wait(struct queue *queue, HANDLE event, LONG priorit
else else
callback = waiting_item_callback; callback = waiting_item_callback;
item->u.wait_object = CreateThreadpoolWait(callback, item, &queue->env); item->u.wait_object = CreateThreadpoolWait(callback, item, (TP_CALLBACK_ENVIRON *)&queue->env);
SetThreadpoolWait(item->u.wait_object, event, NULL); SetThreadpoolWait(item->u.wait_object, event, NULL);
TRACE("dispatched %p.\n", result); TRACE("dispatched %p.\n", result);
@ -516,7 +519,7 @@ static HRESULT queue_submit_timer(struct queue *queue, IMFAsyncResult *result, I
filetime.dwLowDateTime = t.u.LowPart; filetime.dwLowDateTime = t.u.LowPart;
filetime.dwHighDateTime = t.u.HighPart; filetime.dwHighDateTime = t.u.HighPart;
item->u.timer_object = CreateThreadpoolTimer(callback, item, &queue->env); item->u.timer_object = CreateThreadpoolTimer(callback, item, (TP_CALLBACK_ENVIRON *)&queue->env);
SetThreadpoolTimer(item->u.timer_object, &filetime, period, 0); SetThreadpoolTimer(item->u.timer_object, &filetime, period, 0);
TRACE("dispatched %p.\n", result); TRACE("dispatched %p.\n", result);