Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
b8f94f7e
Commit
b8f94f7e
authored
Feb 05, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtworkq: Add RtwqCancelWorkItem().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e9e087fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
1 deletion
+42
-1
queue.c
dlls/rtworkq/queue.c
+40
-0
rtworkq.spec
dlls/rtworkq/rtworkq.spec
+1
-1
rtworkq.idl
include/rtworkq.idl
+1
-0
No files found.
dlls/rtworkq/queue.c
View file @
b8f94f7e
...
...
@@ -465,6 +465,33 @@ static HRESULT queue_submit_wait(struct queue *queue, HANDLE event, LONG priorit
return
S_OK
;
}
static
HRESULT
queue_cancel_item
(
struct
queue
*
queue
,
RTWQWORKITEM_KEY
key
)
{
HRESULT
hr
=
RTWQ_E_NOT_FOUND
;
struct
work_item
*
item
;
EnterCriticalSection
(
&
queue
->
cs
);
LIST_FOR_EACH_ENTRY
(
item
,
&
queue
->
pending_items
,
struct
work_item
,
entry
)
{
if
(
item
->
key
==
key
)
{
key
>>=
32
;
if
((
key
&
WAIT_ITEM_KEY_MASK
)
==
WAIT_ITEM_KEY_MASK
)
CloseThreadpoolWait
(
item
->
u
.
wait_object
);
else
if
((
key
&
SCHEDULED_ITEM_KEY_MASK
)
==
SCHEDULED_ITEM_KEY_MASK
)
CloseThreadpoolTimer
(
item
->
u
.
timer_object
);
else
WARN
(
"Unknown item key mask %#x.
\n
"
,
(
DWORD
)
key
);
queue_release_pending_item
(
item
);
hr
=
S_OK
;
break
;
}
}
LeaveCriticalSection
(
&
queue
->
cs
);
return
hr
;
}
struct
async_result
{
RTWQASYNCRESULT
result
;
...
...
@@ -724,6 +751,19 @@ HRESULT WINAPI RtwqPutWaitingWorkItem(HANDLE event, LONG priority, IRtwqAsyncRes
return
hr
;
}
HRESULT
WINAPI
RtwqCancelWorkItem
(
RTWQWORKITEM_KEY
key
)
{
struct
queue
*
queue
;
HRESULT
hr
;
TRACE
(
"%s.
\n
"
,
wine_dbgstr_longlong
(
key
));
if
(
FAILED
(
hr
=
grab_queue
(
RTWQ_CALLBACK_QUEUE_TIMER
,
&
queue
)))
return
hr
;
return
queue_cancel_item
(
queue
,
key
);
}
HRESULT
WINAPI
RtwqLockWorkQueue
(
DWORD
queue
)
{
TRACE
(
"%#x.
\n
"
,
queue
);
...
...
dlls/rtworkq/rtworkq.spec
View file @
b8f94f7e
...
...
@@ -5,7 +5,7 @@
@ stub RtwqBeginUnregisterWorkQueueWithMMCSS
@ stub RtwqCancelDeadline
@ stub RtwqCancelMultipleWaitingWorkItem
@ st
ub RtwqCancelWorkItem
@ st
dcall RtwqCancelWorkItem(int64)
@ stdcall RtwqCreateAsyncResult(ptr ptr ptr ptr)
@ stub RtwqEndRegisterWorkQueueWithMMCSS
@ stub RtwqEndUnregisterWorkQueueWithMMCSS
...
...
include/rtworkq.idl
View file @
b8f94f7e
...
...
@@ -75,6 +75,7 @@ cpp_quote(" DWORD dwBytesTransferred;")
cpp_quote
(
" HANDLE hEvent;"
)
cpp_quote
(
"} RTWQASYNCRESULT;"
)
cpp_quote
(
"HRESULT WINAPI RtwqCancelWorkItem(RTWQWORKITEM_KEY key);"
)
cpp_quote
(
"HRESULT WINAPI RtwqCreateAsyncResult(IUnknown *object, IRtwqAsyncCallback *callback, IUnknown *state, IRtwqAsyncResult **result);"
)
cpp_quote
(
"HRESULT WINAPI RtwqLockPlatform(void);"
)
cpp_quote
(
"HRESULT WINAPI RtwqLockWorkQueue(DWORD queue);"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment