Commit 570c969e authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

rtworkq: Store item priority and callback flags.

parent a4143e21
...@@ -115,6 +115,8 @@ struct work_item ...@@ -115,6 +115,8 @@ struct work_item
IRtwqAsyncResult *result; IRtwqAsyncResult *result;
struct queue *queue; struct queue *queue;
RTWQWORKITEM_KEY key; RTWQWORKITEM_KEY key;
LONG priority;
DWORD flags;
union union
{ {
TP_WAIT *wait_object; TP_WAIT *wait_object;
...@@ -204,8 +206,10 @@ static const IUnknownVtbl work_item_vtbl = ...@@ -204,8 +206,10 @@ static const IUnknownVtbl work_item_vtbl =
work_item_Release, work_item_Release,
}; };
static struct work_item * alloc_work_item(struct queue *queue, IRtwqAsyncResult *result) static struct work_item * alloc_work_item(struct queue *queue, LONG priority, IRtwqAsyncResult *result)
{ {
RTWQASYNCRESULT *async_result = (RTWQASYNCRESULT *)result;
DWORD flags = 0, queue_id = 0;
struct work_item *item; struct work_item *item;
item = heap_alloc_zero(sizeof(*item)); item = heap_alloc_zero(sizeof(*item));
...@@ -216,6 +220,10 @@ static struct work_item * alloc_work_item(struct queue *queue, IRtwqAsyncResult ...@@ -216,6 +220,10 @@ static struct work_item * alloc_work_item(struct queue *queue, IRtwqAsyncResult
item->refcount = 1; item->refcount = 1;
item->queue = queue; item->queue = queue;
list_init(&item->entry); list_init(&item->entry);
item->priority = priority;
if (SUCCEEDED(IRtwqAsyncCallback_GetParameters(async_result->pCallback, &flags, &queue_id)))
item->flags = flags;
return item; return item;
} }
...@@ -377,7 +385,7 @@ static HRESULT queue_submit_item(struct queue *queue, LONG priority, IRtwqAsyncR ...@@ -377,7 +385,7 @@ static HRESULT queue_submit_item(struct queue *queue, LONG priority, IRtwqAsyncR
struct work_item *item; struct work_item *item;
TP_WORK *work_object; TP_WORK *work_object;
if (!(item = alloc_work_item(queue, result))) if (!(item = alloc_work_item(queue, priority, result)))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
if (priority == 0) if (priority == 0)
...@@ -515,7 +523,7 @@ static HRESULT queue_submit_wait(struct queue *queue, HANDLE event, LONG priorit ...@@ -515,7 +523,7 @@ static HRESULT queue_submit_wait(struct queue *queue, HANDLE event, LONG priorit
PTP_WAIT_CALLBACK callback; PTP_WAIT_CALLBACK callback;
struct work_item *item; struct work_item *item;
if (!(item = alloc_work_item(queue, result))) if (!(item = alloc_work_item(queue, priority, result)))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
if (key) if (key)
...@@ -543,7 +551,7 @@ static HRESULT queue_submit_timer(struct queue *queue, IRtwqAsyncResult *result, ...@@ -543,7 +551,7 @@ static HRESULT queue_submit_timer(struct queue *queue, IRtwqAsyncResult *result,
FILETIME filetime; FILETIME filetime;
LARGE_INTEGER t; LARGE_INTEGER t;
if (!(item = alloc_work_item(queue, result))) if (!(item = alloc_work_item(queue, 0, result)))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
if (key) if (key)
......
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