Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/rtworkq/queue.c | 21 +++++++++++++++++++++ dlls/rtworkq/rtworkq.spec | 2 +- include/rtworkq.idl | 1 + 3 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/dlls/rtworkq/queue.c b/dlls/rtworkq/queue.c index a6aac6abda..13bce0836a 100644 --- a/dlls/rtworkq/queue.c +++ b/dlls/rtworkq/queue.c @@ -1071,3 +1071,24 @@ HRESULT WINAPI RtwqUnlockWorkQueue(DWORD queue)
return unlock_user_queue(queue); } + +HRESULT WINAPI RtwqSetLongRunning(DWORD queue_id, BOOL enable) +{ + struct queue *queue; + HRESULT hr; + int i; + + TRACE("%#x, %d.\n", queue_id, enable); + + lock_user_queue(queue_id); + + if (SUCCEEDED(hr = grab_queue(queue_id, &queue))) + { + for (i = 0; i < ARRAY_SIZE(queue->envs); ++i) + queue->envs[i].u.s.LongFunction = !!enable; + } + + unlock_user_queue(queue_id); + + return hr; +} diff --git a/dlls/rtworkq/rtworkq.spec b/dlls/rtworkq/rtworkq.spec index 48bc17cbfc..2d0d3b40e6 100644 --- a/dlls/rtworkq/rtworkq.spec +++ b/dlls/rtworkq/rtworkq.spec @@ -27,7 +27,7 @@ @ stdcall RtwqScheduleWorkItem(ptr int64 ptr) @ stub RtwqSetDeadline @ stub RtwqSetDeadline2 -@ stub RtwqSetLongRunning +@ stdcall RtwqSetLongRunning(long long) @ stdcall RtwqShutdown() @ stdcall RtwqStartup() @ stub RtwqUnjoinWorkQueue diff --git a/include/rtworkq.idl b/include/rtworkq.idl index 001cf2c3e9..6ddb232fbd 100644 --- a/include/rtworkq.idl +++ b/include/rtworkq.idl @@ -88,6 +88,7 @@ cpp_quote("HRESULT WINAPI RtwqPutWaitingWorkItem(HANDLE event, LONG priority, IR cpp_quote("HRESULT WINAPI RtwqPutWorkItem(DWORD queue, LONG priority, IRtwqAsyncResult *result);") cpp_quote("HRESULT WINAPI RtwqRemovePeriodicCallback(DWORD key);") cpp_quote("HRESULT WINAPI RtwqScheduleWorkItem(IRtwqAsyncResult *result, INT64 timeout, RTWQWORKITEM_KEY *key);") +cpp_quote("HRESULT WINAPI RtwqSetLongRunning(DWORD queue_id, BOOL enable);") cpp_quote("HRESULT WINAPI RtwqShutdown(void);") cpp_quote("HRESULT WINAPI RtwqStartup(void);") cpp_quote("HRESULT WINAPI RtwqUnlockPlatform(void);")