Module: wine Branch: master Commit: 1b9db994178fe964f826ca2a28ed7c9b53c6f0f9 URL: https://gitlab.winehq.org/wine/wine/-/commit/1b9db994178fe964f826ca2a28ed7c9...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Feb 21 11:16:04 2023 +0100
ntdll: Return the correct IOSB information when creating a named pipe.
---
dlls/ntdll/tests/om.c | 4 ---- dlls/ntdll/unix/file.c | 6 +++++- include/wine/server_protocol.h | 4 ++-- server/named_pipe.c | 1 + server/protocol.def | 1 + server/request.h | 1 + server/trace.c | 1 + 7 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c index 2b2805d0b00..3f42b7d045d 100644 --- a/dlls/ntdll/tests/om.c +++ b/dlls/ntdll/tests/om.c @@ -379,7 +379,6 @@ static void test_name_collisions(void) FILE_OPEN_IF, FILE_PIPE_FULL_DUPLEX, FALSE, FALSE, FALSE, 10, 256, 256, &timeout ); ok(status == STATUS_SUCCESS, "failed to create pipe %08lx\n", status); - todo_wine ok( iosb.Information == FILE_CREATED, "wrong info %Ix\n", iosb.Information ); pNtClose( h );
@@ -389,7 +388,6 @@ static void test_name_collisions(void) FILE_CREATE, FILE_PIPE_FULL_DUPLEX, FALSE, FALSE, FALSE, 10, 256, 256, &timeout ); ok(status == STATUS_SUCCESS, "failed to create pipe %08lx\n", status); - todo_wine ok( iosb.Information == FILE_CREATED, "wrong info %Ix\n", iosb.Information );
memset( &iosb, 0xcc, sizeof(iosb) ); @@ -398,7 +396,6 @@ static void test_name_collisions(void) FILE_OPEN, FILE_PIPE_FULL_DUPLEX, FALSE, FALSE, FALSE, 10, 256, 256, &timeout ); ok(status == STATUS_SUCCESS, "failed to create pipe %08lx\n", status); - todo_wine ok( iosb.Information == FILE_OPENED, "wrong info %Ix\n", iosb.Information ); pNtClose(h1);
@@ -408,7 +405,6 @@ static void test_name_collisions(void) FILE_OPEN_IF, FILE_PIPE_FULL_DUPLEX, FALSE, FALSE, FALSE, 10, 256, 256, &timeout ); ok(status == STATUS_SUCCESS, "failed to create pipe %08lx\n", status); - todo_wine ok( iosb.Information == FILE_OPENED, "wrong info %Ix\n", iosb.Information ); pNtClose(h1);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index ba4730eced4..4daf1a5335c 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -4144,7 +4144,11 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( HANDLE *handle, ULONG access, OBJECT_ATTR req->insize = inbound_quota; req->timeout = timeout->QuadPart; wine_server_add_data( req, objattr, len ); - if (!(status = wine_server_call( req ))) *handle = wine_server_ptr_handle( reply->handle ); + if (!(status = wine_server_call( req ))) + { + *handle = wine_server_ptr_handle( reply->handle ); + io->Information = reply->created ? FILE_CREATED : FILE_OPENED; + } } SERVER_END_REQ;
diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index e2bc1a71940..c5e0182f42a 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -3086,7 +3086,7 @@ struct create_named_pipe_reply { struct reply_header __header; obj_handle_t handle; - char __pad_12[4]; + int created; };
@@ -6356,7 +6356,7 @@ union generic_reply
/* ### protocol_version begin ### */
-#define SERVER_PROTOCOL_VERSION 759 +#define SERVER_PROTOCOL_VERSION 760
/* ### protocol_version end ### */
diff --git a/server/named_pipe.c b/server/named_pipe.c index bf3b1b1bd35..9a10c2bf041 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -1437,6 +1437,7 @@ DECL_HANDLER(create_named_pipe) GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION ); + reply->created = 1; } else { diff --git a/server/protocol.def b/server/protocol.def index 2445288bbcc..69888fa643e 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -2279,6 +2279,7 @@ enum message_type VARARG(objattr,object_attributes); /* object attributes */ @REPLY obj_handle_t handle; /* handle to the pipe */ + int created; @END
/* flags in create_named_pipe and get_named_pipe_info */ diff --git a/server/request.h b/server/request.h index fe8e9c2f258..10b877b1deb 100644 --- a/server/request.h +++ b/server/request.h @@ -1459,6 +1459,7 @@ C_ASSERT( FIELD_OFFSET(struct create_named_pipe_request, timeout) == 40 ); C_ASSERT( FIELD_OFFSET(struct create_named_pipe_request, flags) == 48 ); C_ASSERT( sizeof(struct create_named_pipe_request) == 56 ); C_ASSERT( FIELD_OFFSET(struct create_named_pipe_reply, handle) == 8 ); +C_ASSERT( FIELD_OFFSET(struct create_named_pipe_reply, created) == 12 ); C_ASSERT( sizeof(struct create_named_pipe_reply) == 16 ); C_ASSERT( FIELD_OFFSET(struct set_named_pipe_info_request, handle) == 12 ); C_ASSERT( FIELD_OFFSET(struct set_named_pipe_info_request, flags) == 16 ); diff --git a/server/trace.c b/server/trace.c index f114039b97b..b63bc386ee8 100644 --- a/server/trace.c +++ b/server/trace.c @@ -2873,6 +2873,7 @@ static void dump_create_named_pipe_request( const struct create_named_pipe_reque static void dump_create_named_pipe_reply( const struct create_named_pipe_reply *req ) { fprintf( stderr, " handle=%04x", req->handle ); + fprintf( stderr, ", created=%d", req->created ); }
static void dump_set_named_pipe_info_request( const struct set_named_pipe_info_request *req )