Paul Gofman : server: Return STATUS_OBJECT_PATH_INVALID for noname pipe name query.

Alexandre Julliard julliard at winehq.org
Thu Nov 26 16:31:01 CST 2020


Module: wine
Branch: master
Commit: aa5c1e871b9a3f0521c1249e45d31d38c705ea60
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=aa5c1e871b9a3f0521c1249e45d31d38c705ea60

Author: Paul Gofman <pgofman at codeweavers.com>
Date:   Wed Nov 25 21:42:44 2020 +0300

server: Return STATUS_OBJECT_PATH_INVALID for noname pipe name query.

Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/tests/pipe.c |  2 +-
 server/named_pipe.c     | 12 +++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c
index bfc8dc0b3be..1230fecfda7 100644
--- a/dlls/ntdll/tests/pipe.c
+++ b/dlls/ntdll/tests/pipe.c
@@ -2479,7 +2479,7 @@ static void test_empty_name(void)
     ok(type_info->TypeName.Buffer && !wcscmp(type_info->TypeName.Buffer, L"File"),
             "Got unexpected type %s.\n", debugstr_w(type_info->TypeName.Buffer));
     status = pNtQueryObject(hpipe, ObjectNameInformation, name_info, sizeof(buffer), NULL);
-    todo_wine ok(status == STATUS_OBJECT_PATH_INVALID, "Got unexpected status %#x.\n", status);
+    ok(status == STATUS_OBJECT_PATH_INVALID, "Got unexpected status %#x.\n", status);
 
     status = pNtCreateNamedPipeFile(&handle, GENERIC_READ | SYNCHRONIZE, &attr,
             &io, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN, FILE_SYNCHRONOUS_IO_NONALERT,
diff --git a/server/named_pipe.c b/server/named_pipe.c
index 6e65f3e364a..5adfd444ada 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -105,6 +105,7 @@ struct named_pipe_device_file
 
 static void named_pipe_dump( struct object *obj, int verbose );
 static unsigned int named_pipe_map_access( struct object *obj, unsigned int access );
+static WCHAR *named_pipe_get_full_name( struct object *obj, data_size_t *ret_len );
 static int named_pipe_link_name( struct object *obj, struct object_name *name, struct object *parent );
 static struct object *named_pipe_open_file( struct object *obj, unsigned int access,
                                             unsigned int sharing, unsigned int options );
@@ -124,7 +125,7 @@ static const struct object_ops named_pipe_ops =
     named_pipe_map_access,        /* map_access */
     default_get_sd,               /* get_sd */
     default_set_sd,               /* set_sd */
-    default_get_full_name,        /* get_full_name */
+    named_pipe_get_full_name,     /* get_full_name */
     no_lookup_name,               /* lookup_name */
     named_pipe_link_name,         /* link_name */
     default_unlink_name,          /* unlink_name */
@@ -328,6 +329,15 @@ static unsigned int named_pipe_map_access( struct object *obj, unsigned int acce
     return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL);
 }
 
+static WCHAR *named_pipe_get_full_name( struct object *obj, data_size_t *ret_len )
+{
+    WCHAR *ret;
+
+    if (!(ret = default_get_full_name( obj, ret_len )))
+        set_error( STATUS_OBJECT_PATH_INVALID );
+    return ret;
+}
+
 static void pipe_server_dump( struct object *obj, int verbose )
 {
     struct pipe_server *server = (struct pipe_server *) obj;




More information about the wine-cvs mailing list