server: Change cancel_async to take an optional iosb and only_thread.
diff --git a/server/async.c b/server/async.c
index 91f0c44..73cd76d 100644
--- a/server/async.c
+++ b/server/async.c
@@ -288,6 +288,28 @@
return async->status == STATUS_PENDING;
}
+int async_wake_up_by( struct async_queue *queue, struct process *process,
+ struct thread *thread, client_ptr_t iosb, unsigned int status )
+{
+ struct list *ptr, *next;
+ int woken = 0;
+
+ if (!queue || (!process && !thread && !iosb)) return 0;
+
+ LIST_FOR_EACH_SAFE( ptr, next, &queue->queue )
+ {
+ struct async *async = LIST_ENTRY( ptr, struct async, queue_entry );
+ if ( (!process || async->thread->process == process) &&
+ (!thread || async->thread == thread) &&
+ (!iosb || async->data.iosb == iosb) )
+ {
+ async_terminate( async, status );
+ woken++;
+ }
+ }
+ return woken;
+}
+
/* wake up async operations on the queue */
void async_wake_up( struct async_queue *queue, unsigned int status )
{