[PATCH 3/9] rtworkq: Store item priority and callback flags.

Nikolay Sivov nsivov at codeweavers.com
Tue Feb 11 03:19:05 CST 2020


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/rtworkq/queue.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

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




More information about the wine-devel mailing list