Rebase against 3d62cd26d1b988b373efae0b9c4a0a988985d45f.

This commit is contained in:
Sebastian Lackner
2017-02-22 06:50:16 +01:00
parent dc52cbef3c
commit 2ae8a0be02
11 changed files with 141 additions and 196 deletions

View File

@@ -1,4 +1,4 @@
From 463a6541de5c95ed1ca3c79a3b5b721e2edade45 Mon Sep 17 00:00:00 2001
From 8bba3ddd8ee9234d7c1f9d21b2aa3f4cdcdd1b3a Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 6 Jun 2015 01:21:05 +0200
Subject: server: Return correct error codes for NtWriteFile when pipes are
@@ -12,7 +12,7 @@ Subject: server: Return correct error codes for NtWriteFile when pipes are
4 files changed, 46 insertions(+), 3 deletions(-)
diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c
index 6f70285..817f857 100644
index ba365ed666e..23f1a5f5f55 100644
--- a/dlls/kernel32/tests/pipe.c
+++ b/dlls/kernel32/tests/pipe.c
@@ -1917,7 +1917,7 @@ static void test_CloseHandle(void)
@@ -25,10 +25,10 @@ index 6f70285..817f857 100644
CloseHandle(hfile);
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 863ff78..e9efa92 100644
index ab34d99d5b6..d0662d9ae59 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -1239,6 +1239,9 @@ static NTSTATUS write_unix_fd(int fd, const char *buf, ULONG *total, ULONG lengt
@@ -1235,6 +1235,9 @@ static NTSTATUS write_unix_fd(int fd, const char *buf, ULONG *total, ULONG lengt
return STATUS_SUCCESS;
else if (errno == EFAULT)
return STATUS_INVALID_USER_BUFFER;
@@ -39,7 +39,7 @@ index 863ff78..e9efa92 100644
}
}
diff --git a/server/named_pipe.c b/server/named_pipe.c
index ad7d537..5bec9bc 100644
index e480f31a00e..eccf6a463f5 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -147,6 +147,7 @@ static const struct object_ops named_pipe_ops =
@@ -48,7 +48,7 @@ index ad7d537..5bec9bc 100644
static struct fd *pipe_server_get_fd( struct object *obj );
+static int pipe_server_close_handle( struct object *obj, struct process *process, obj_handle_t handle );
static void pipe_server_destroy( struct object *obj);
static obj_handle_t pipe_server_flush( struct fd *fd, const async_data_t *async, int blocking );
static obj_handle_t pipe_server_flush( struct fd *fd, struct async *async, int blocking );
static enum server_fd_type pipe_server_get_fd_type( struct fd *fd );
@@ -172,7 +173,7 @@ static const struct object_ops pipe_server_ops =
NULL, /* unlink_name */
@@ -65,7 +65,7 @@ index ad7d537..5bec9bc 100644
static struct fd *pipe_client_get_fd( struct object *obj );
+static int pipe_client_close_handle( struct object *obj, struct process *process, obj_handle_t handle );
static void pipe_client_destroy( struct object *obj );
static obj_handle_t pipe_client_flush( struct fd *fd, const async_data_t *async, int blocking );
static obj_handle_t pipe_client_flush( struct fd *fd, struct async *async, int blocking );
static enum server_fd_type pipe_client_get_fd_type( struct fd *fd );
@@ -216,7 +218,7 @@ static const struct object_ops pipe_client_ops =
NULL, /* unlink_name */
@@ -135,7 +135,7 @@ index ad7d537..5bec9bc 100644
{
struct pipe_client *client = (struct pipe_client *)obj;
diff --git a/server/protocol.def b/server/protocol.def
index e7a55d7..f1e7af1 100644
index e7a55d7a2d8..f1e7af1d568 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -2427,6 +2427,7 @@ enum message_type
@@ -147,5 +147,5 @@ index e7a55d7..f1e7af1 100644
/* Get named pipe information by handle */
--
2.9.0
2.11.0

View File

@@ -1,4 +1,4 @@
From 5ae266b76e7d946b3228faee7924af63d5f08ac2 Mon Sep 17 00:00:00 2001
From c108a14664db758d26cffd022a8c9255b6c47b1c Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 24 Feb 2016 15:45:09 +0100
Subject: server: Do not allow to queue async operation for broken pipes.
@@ -8,14 +8,14 @@ Subject: server: Do not allow to queue async operation for broken pipes.
1 file changed, 32 insertions(+), 2 deletions(-)
diff --git a/server/named_pipe.c b/server/named_pipe.c
index 5bec9bc..4dda82a 100644
index eccf6a463f5..2f1a8c8fb99 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -153,6 +153,7 @@ static obj_handle_t pipe_server_flush( struct fd *fd, const async_data_t *async,
@@ -153,6 +153,7 @@ static obj_handle_t pipe_server_flush( struct fd *fd, struct async *async, int b
static enum server_fd_type pipe_server_get_fd_type( struct fd *fd );
static obj_handle_t pipe_server_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async,
static obj_handle_t pipe_server_ioctl( struct fd *fd, ioctl_code_t code, struct async *async,
int blocking );
+static void pipe_server_queue_async( struct fd *fd, const async_data_t *data, int type, int count );
+static void pipe_server_queue_async( struct fd *fd, struct async *async, int type, int count );
static const struct object_ops pipe_server_ops =
{
@@ -30,9 +30,9 @@ index 5bec9bc..4dda82a 100644
@@ -198,6 +199,7 @@ static int pipe_client_close_handle( struct object *obj, struct process *process
static void pipe_client_destroy( struct object *obj );
static obj_handle_t pipe_client_flush( struct fd *fd, const async_data_t *async, int blocking );
static obj_handle_t pipe_client_flush( struct fd *fd, struct async *async, int blocking );
static enum server_fd_type pipe_client_get_fd_type( struct fd *fd );
+static void pipe_client_queue_async( struct fd *fd, const async_data_t *data, int type, int count );
+static void pipe_client_queue_async( struct fd *fd, struct async *async, int type, int count );
static const struct object_ops pipe_client_ops =
{
@@ -45,11 +45,11 @@ index 5bec9bc..4dda82a 100644
default_fd_reselect_async /* reselect_async */
};
@@ -621,6 +623,20 @@ static obj_handle_t pipe_client_flush( struct fd *fd, const async_data_t *async,
@@ -620,6 +622,20 @@ static obj_handle_t pipe_client_flush( struct fd *fd, struct async *async, int b
return 0;
}
+static void pipe_client_queue_async( struct fd *fd, const async_data_t *data, int type, int count )
+static void pipe_client_queue_async( struct fd *fd, struct async *async, int type, int count )
+{
+ struct pipe_client *client = get_fd_user( fd );
+ struct pipe_server *server = client->server;
@@ -60,17 +60,17 @@ index 5bec9bc..4dda82a 100644
+ return;
+ }
+
+ default_fd_queue_async( fd, data, type, count );
+ default_fd_queue_async( fd, async, type, count );
+}
+
static inline int is_overlapped( unsigned int options )
{
return !(options & (FILE_SYNCHRONOUS_IO_ALERT | FILE_SYNCHRONOUS_IO_NONALERT));
@@ -707,6 +723,20 @@ static obj_handle_t pipe_server_ioctl( struct fd *fd, ioctl_code_t code, const a
@@ -705,6 +721,20 @@ static obj_handle_t pipe_server_ioctl( struct fd *fd, ioctl_code_t code, struct
}
}
+static void pipe_server_queue_async( struct fd *fd, const async_data_t *data, int type, int count )
+static void pipe_server_queue_async( struct fd *fd, struct async *async, int type, int count )
+{
+ struct pipe_server *server = get_fd_user( fd );
+ struct pipe_client *client = server->client;
@@ -81,12 +81,12 @@ index 5bec9bc..4dda82a 100644
+ return;
+ }
+
+ default_fd_queue_async( fd, data, type, count );
+ default_fd_queue_async( fd, async, type, count );
+}
+
static struct pipe_server *get_pipe_server_obj( struct process *process,
obj_handle_t handle, unsigned int access )
{
--
2.9.0
2.11.0