Bernhard Loos : server: It' s possible to call NtQueryInformationFile on a pipe if it was opened with access 0 .

Alexandre Julliard julliard at winehq.org
Sat Oct 8 15:16:36 CDT 2011


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

Author: Bernhard Loos <bernhardloos at googlemail.com>
Date:   Thu Sep 29 11:20:42 2011 +0200

server: It's possible to call NtQueryInformationFile on a pipe if it was opened with access 0.

---

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

diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c
index 358e702..26c38b0 100644
--- a/dlls/ntdll/tests/pipe.c
+++ b/dlls/ntdll/tests/pipe.c
@@ -160,7 +160,7 @@ static void test_create_invalid(void)
     ok(!res, "NtCreateNamedPipeFile returned %x\n", res);
 
     res = pNtQueryInformationFile(handle, &iosb, &info, sizeof(info), (FILE_INFORMATION_CLASS)24);
-    todo_wine ok(res == STATUS_ACCESS_DENIED, "NtQueryInformationFile returned %x\n", res);
+    ok(res == STATUS_ACCESS_DENIED, "NtQueryInformationFile returned %x\n", res);
 
 /* test FILE_CREATE creation disposition */
     res = pNtCreateNamedPipeFile(&handle2, SYNCHRONIZE, &attr, &iosb, FILE_SHARE_READ | FILE_SHARE_WRITE, 2 /*FILE_CREATE*/,
diff --git a/server/named_pipe.c b/server/named_pipe.c
index 66664bb..750f3bc 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -1005,9 +1005,12 @@ DECL_HANDLER(get_named_pipe_info)
     server = get_pipe_server_obj( current->process, req->handle, FILE_READ_ATTRIBUTES );
     if (!server)
     {
+        if (get_error() != STATUS_OBJECT_TYPE_MISMATCH)
+            return;
+
         clear_error();
         client = (struct pipe_client *)get_handle_obj( current->process, req->handle,
-                                                       FILE_READ_ATTRIBUTES, &pipe_client_ops );
+                                                       0, &pipe_client_ops );
         if (!client) return;
         server = client->server;
     }




More information about the wine-cvs mailing list