Commit 2c733057 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

ntdll: Implement FileAccessInformation class in NtQueryInformationFile.

parent b53957df
......@@ -2446,6 +2446,19 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
info->EaSize = 0;
}
break;
case FileAccessInformation:
{
FILE_ACCESS_INFORMATION *info = ptr;
SERVER_START_REQ( get_object_info )
{
req->handle = wine_server_obj_handle( hFile );
io->u.Status = wine_server_call( req );
if (io->u.Status == STATUS_SUCCESS)
info->AccessFlags = reply->access;
}
SERVER_END_REQ;
}
break;
case FileEndOfFileInformation:
if (fd_get_file_info( fd, &st, &attr ) == -1) io->u.Status = FILE_GetNtStatus();
else fill_file_info( &st, attr, ptr, class );
......
......@@ -3433,6 +3433,29 @@ static void test_file_id_information(void)
CloseHandle( h );
}
static void test_file_access_information(void)
{
FILE_ACCESS_INFORMATION info;
IO_STATUS_BLOCK io;
NTSTATUS status;
HANDLE h;
if (!(h = create_temp_file(0))) return;
status = pNtQueryInformationFile( h, &io, &info, sizeof(info) - 1, FileAccessInformation );
ok( status == STATUS_INFO_LENGTH_MISMATCH, "expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status );
status = pNtQueryInformationFile( (HANDLE)0xdeadbeef, &io, &info, sizeof(info), FileAccessInformation );
ok( status == STATUS_INVALID_HANDLE, "expected STATUS_INVALID_HANDLE, got %08x\n", status );
memset(&info, 0x11, sizeof(info));
status = pNtQueryInformationFile( h, &io, &info, sizeof(info), FileAccessInformation );
ok( status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status );
ok( info.AccessFlags == 0x13019f, "got %08x\n", info.AccessFlags );
CloseHandle( h );
}
static void test_query_volume_information_file(void)
{
NTSTATUS status;
......@@ -4506,6 +4529,7 @@ START_TEST(file)
test_file_disposition_information();
test_file_completion_information();
test_file_id_information();
test_file_access_information();
test_query_volume_information_file();
test_query_attribute_information_file();
test_ioctl();
......
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