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

This commit is contained in:
Bernhard Loos 2011-09-29 11:20:42 +02:00 committed by Alexandre Julliard
parent c2015d3341
commit e4c2a6d1cd
2 changed files with 5 additions and 2 deletions

View file

@ -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*/,

View file

@ -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;
}