Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
server/async.c | 2 +-
server/change.c | 1 +
server/console.c | 6 ++++++
server/device.c | 1 +
server/fd.c | 10 ++++++++++
server/file.c | 1 +
server/file.h | 4 ++++
server/mailslot.c | 3 +++
server/mapping.c | 1 +
server/named_pipe.c | 3 +++
server/serial.c | 1 +
server/sock.c | 2 ++
12 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/server/async.c b/server/async.c
index 50cb47dec92..278048bc7a3 100644
--- a/server/async.c
+++ b/server/async.c
@@ -502,7 +502,7 @@ restart:
(!thread || async->thread == thread) &&
(!iosb || async->data.iosb == iosb))
{
- async_terminate( async, STATUS_CANCELLED );
+ fd_cancel_async( async->fd, async );
woken++;
goto restart;
}
diff --git a/server/change.c b/server/change.c
index b02a9cd65bf..5edeebf89d3 100644
--- a/server/change.c
+++ b/server/change.c
@@ -144,6 +144,7 @@ static const struct fd_ops dir_fd_ops =
default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */
default_fd_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
default_fd_queue_async, /* queue_async */
default_fd_reselect_async /* reselect_async */
};
diff --git a/server/console.c b/server/console.c
index 2a23081037b..3a5b1270116 100644
--- a/server/console.c
+++ b/server/console.c
@@ -115,6 +115,7 @@ static const struct fd_ops console_fd_ops =
console_get_file_info, /* get_file_info */
console_get_volume_info, /* get_volume_info */
console_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
default_fd_queue_async, /* queue_async */
default_fd_reselect_async /* reselect_async */
};
@@ -185,6 +186,7 @@ static const struct fd_ops console_server_fd_ops =
no_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */
console_server_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
default_fd_queue_async, /* queue_async */
default_fd_reselect_async /* reselect_async */
};
@@ -254,6 +256,7 @@ static const struct fd_ops screen_buffer_fd_ops =
console_get_file_info, /* get_file_info */
console_get_volume_info, /* get_volume_info */
screen_buffer_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
default_fd_queue_async, /* queue_async */
default_fd_reselect_async /* reselect_async */
};
@@ -340,6 +343,7 @@ static const struct fd_ops console_input_fd_ops =
console_get_file_info, /* get_file_info */
console_get_volume_info, /* get_volume_info */
console_input_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
default_fd_queue_async, /* queue_async */
default_fd_reselect_async /* reselect_async */
};
@@ -395,6 +399,7 @@ static const struct fd_ops console_output_fd_ops =
console_get_file_info, /* get_file_info */
console_get_volume_info, /* get_volume_info */
console_output_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
default_fd_queue_async, /* queue_async */
default_fd_reselect_async /* reselect_async */
};
@@ -451,6 +456,7 @@ static const struct fd_ops console_connection_fd_ops =
no_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */
console_connection_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
default_fd_queue_async, /* queue_async */
default_fd_reselect_async /* reselect_async */
};
diff --git a/server/device.c b/server/device.c
index d9199e8ddd8..2310de43ac4 100644
--- a/server/device.c
+++ b/server/device.c
@@ -243,6 +243,7 @@ static const struct fd_ops device_file_fd_ops =
default_fd_get_file_info, /* get_file_info */
device_file_get_volume_info, /* get_volume_info */
device_file_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
default_fd_queue_async, /* queue_async */
device_file_reselect_async /* reselect_async */
};
diff --git a/server/fd.c b/server/fd.c
index 7a88f412c7a..904b4e4217d 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -2216,6 +2216,11 @@ void fd_async_wake_up( struct fd *fd, int type, unsigned int status )
}
}
+void fd_cancel_async( struct fd *fd, struct async *async )
+{
+ fd->fd_ops->cancel_async( fd, async );
+}
+
void fd_reselect_async( struct fd *fd, struct async_queue *queue )
{
fd->fd_ops->reselect_async( fd, queue );
@@ -2226,6 +2231,11 @@ void no_fd_queue_async( struct fd *fd, struct async *async, int type, int count
set_error( STATUS_OBJECT_TYPE_MISMATCH );
}
+void default_fd_cancel_async( struct fd *fd, struct async *async )
+{
+ async_terminate( async, STATUS_CANCELLED );
+}
+
void default_fd_queue_async( struct fd *fd, struct async *async, int type, int count )
{
fd_queue_async( fd, async, type );
diff --git a/server/file.c b/server/file.c
index aff4d9e09e1..2c7cb0ce5ca 100644
--- a/server/file.c
+++ b/server/file.c
@@ -124,6 +124,7 @@ static const struct fd_ops file_fd_ops =
default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */
default_fd_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
default_fd_queue_async, /* queue_async */
default_fd_reselect_async /* reselect_async */
};
diff --git a/server/file.h b/server/file.h
index b481a68e530..22879b75c05 100644
--- a/server/file.h
+++ b/server/file.h
@@ -68,6 +68,8 @@ struct fd_ops
void (*get_volume_info)( struct fd *, struct async *, unsigned int );
/* perform an ioctl on the file */
void (*ioctl)(struct fd *fd, ioctl_code_t code, struct async *async );
+ /* cancel an async operation */
+ void (*cancel_async)(struct fd *fd, struct async *async);
/* queue an async operation */
void (*queue_async)(struct fd *, struct async *async, int type, int count);
/* selected events for async i/o need an update */
@@ -106,6 +108,7 @@ extern void get_nt_name( struct fd *fd, struct unicode_str *name );
extern int default_fd_signaled( struct object *obj, struct wait_queue_entry *entry );
extern int default_fd_get_poll_events( struct fd *fd );
extern void default_poll_event( struct fd *fd, int event );
+extern void fd_cancel_async( struct fd *fd, struct async *async );
extern void fd_queue_async( struct fd *fd, struct async *async, int type );
extern void fd_async_wake_up( struct fd *fd, int type, unsigned int status );
extern void fd_reselect_async( struct fd *fd, struct async_queue *queue );
@@ -117,6 +120,7 @@ extern void default_fd_get_file_info( struct fd *fd, obj_handle_t handle, unsign
extern void no_fd_get_volume_info( struct fd *fd, struct async *async, unsigned int info_class );
extern void no_fd_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
extern void default_fd_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
+extern void default_fd_cancel_async( struct fd *fd, struct async *async );
extern void no_fd_queue_async( struct fd *fd, struct async *async, int type, int count );
extern void default_fd_queue_async( struct fd *fd, struct async *async, int type, int count );
extern void default_fd_reselect_async( struct fd *fd, struct async_queue *queue );
diff --git a/server/mailslot.c b/server/mailslot.c
index d4b2fd1b562..1f4cb87d0fc 100644
--- a/server/mailslot.c
+++ b/server/mailslot.c
@@ -108,6 +108,7 @@ static const struct fd_ops mailslot_fd_ops =
default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */
default_fd_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
mailslot_queue_async, /* queue_async */
default_fd_reselect_async /* reselect_async */
};
@@ -165,6 +166,7 @@ static const struct fd_ops mail_writer_fd_ops =
default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */
default_fd_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
default_fd_queue_async, /* queue_async */
default_fd_reselect_async /* reselect_async */
};
@@ -255,6 +257,7 @@ static const struct fd_ops mailslot_device_fd_ops =
default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */
default_fd_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
default_fd_queue_async, /* queue_async */
default_fd_reselect_async /* reselect_async */
};
diff --git a/server/mapping.c b/server/mapping.c
index a814fe8090f..eb500ea67f4 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -204,6 +204,7 @@ static const struct fd_ops mapping_fd_ops =
no_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */
no_fd_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
no_fd_queue_async, /* queue_async */
default_fd_reselect_async /* reselect_async */
};
diff --git a/server/named_pipe.c b/server/named_pipe.c
index 234dfc701d9..f964ae19637 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -194,6 +194,7 @@ static const struct fd_ops pipe_server_fd_ops =
pipe_end_get_file_info, /* get_file_info */
pipe_end_get_volume_info, /* get_volume_info */
pipe_server_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
no_fd_queue_async, /* queue_async */
pipe_end_reselect_async /* reselect_async */
};
@@ -237,6 +238,7 @@ static const struct fd_ops pipe_client_fd_ops =
pipe_end_get_file_info, /* get_file_info */
pipe_end_get_volume_info, /* get_volume_info */
pipe_client_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
no_fd_queue_async, /* queue_async */
pipe_end_reselect_async /* reselect_async */
};
@@ -314,6 +316,7 @@ static const struct fd_ops named_pipe_device_fd_ops =
default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */
named_pipe_device_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
default_fd_queue_async, /* queue_async */
default_fd_reselect_async /* reselect_async */
};
diff --git a/server/serial.c b/server/serial.c
index a5f7ef917b9..bdc27de8e4f 100644
--- a/server/serial.c
+++ b/server/serial.c
@@ -119,6 +119,7 @@ static const struct fd_ops serial_fd_ops =
default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */
serial_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
serial_queue_async, /* queue_async */
serial_reselect_async /* reselect_async */
};
diff --git a/server/sock.c b/server/sock.c
index 3c5f2612b51..bfaf6329ff4 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -274,6 +274,7 @@ static const struct fd_ops sock_fd_ops =
default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */
sock_ioctl, /* ioctl */
+ default_fd_cancel_async, /* cancel_async */
sock_queue_async, /* queue_async */
sock_reselect_async /* reselect_async */
};
@@ -2973,6 +2974,7 @@ static const struct fd_ops ifchange_fd_ops =
no_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */
no_fd_ioctl, /* ioctl */
+ NULL, /* cancel_async */
NULL, /* queue_async */
NULL /* reselect_async */
};
--
2.33.0