Commit e4c2a6d1 authored by Bernhard Loos's avatar Bernhard Loos Committed by Alexandre Julliard

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

parent c2015d33
...@@ -160,7 +160,7 @@ static void test_create_invalid(void) ...@@ -160,7 +160,7 @@ static void test_create_invalid(void)
ok(!res, "NtCreateNamedPipeFile returned %x\n", res); ok(!res, "NtCreateNamedPipeFile returned %x\n", res);
res = pNtQueryInformationFile(handle, &iosb, &info, sizeof(info), (FILE_INFORMATION_CLASS)24); 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 */ /* test FILE_CREATE creation disposition */
res = pNtCreateNamedPipeFile(&handle2, SYNCHRONIZE, &attr, &iosb, FILE_SHARE_READ | FILE_SHARE_WRITE, 2 /*FILE_CREATE*/, res = pNtCreateNamedPipeFile(&handle2, SYNCHRONIZE, &attr, &iosb, FILE_SHARE_READ | FILE_SHARE_WRITE, 2 /*FILE_CREATE*/,
......
...@@ -1005,9 +1005,12 @@ DECL_HANDLER(get_named_pipe_info) ...@@ -1005,9 +1005,12 @@ DECL_HANDLER(get_named_pipe_info)
server = get_pipe_server_obj( current->process, req->handle, FILE_READ_ATTRIBUTES ); server = get_pipe_server_obj( current->process, req->handle, FILE_READ_ATTRIBUTES );
if (!server) if (!server)
{ {
if (get_error() != STATUS_OBJECT_TYPE_MISMATCH)
return;
clear_error(); clear_error();
client = (struct pipe_client *)get_handle_obj( current->process, req->handle, client = (struct pipe_client *)get_handle_obj( current->process, req->handle,
FILE_READ_ATTRIBUTES, &pipe_client_ops ); 0, &pipe_client_ops );
if (!client) return; if (!client) return;
server = client->server; server = client->server;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment