ntdll: Implement FileAccessInformation class in NtQueryInformationFile.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b53957df2a
commit
2c733057e9
|
@ -2446,6 +2446,19 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
|
||||||
info->EaSize = 0;
|
info->EaSize = 0;
|
||||||
}
|
}
|
||||||
break;
|
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:
|
case FileEndOfFileInformation:
|
||||||
if (fd_get_file_info( fd, &st, &attr ) == -1) io->u.Status = FILE_GetNtStatus();
|
if (fd_get_file_info( fd, &st, &attr ) == -1) io->u.Status = FILE_GetNtStatus();
|
||||||
else fill_file_info( &st, attr, ptr, class );
|
else fill_file_info( &st, attr, ptr, class );
|
||||||
|
|
|
@ -3433,6 +3433,29 @@ static void test_file_id_information(void)
|
||||||
CloseHandle( h );
|
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)
|
static void test_query_volume_information_file(void)
|
||||||
{
|
{
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
@ -4506,6 +4529,7 @@ START_TEST(file)
|
||||||
test_file_disposition_information();
|
test_file_disposition_information();
|
||||||
test_file_completion_information();
|
test_file_completion_information();
|
||||||
test_file_id_information();
|
test_file_id_information();
|
||||||
|
test_file_access_information();
|
||||||
test_query_volume_information_file();
|
test_query_volume_information_file();
|
||||||
test_query_attribute_information_file();
|
test_query_attribute_information_file();
|
||||||
test_ioctl();
|
test_ioctl();
|
||||||
|
|
Loading…
Reference in New Issue