Commit d1a259d1 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ntdll: Implement NtQueryInformationFile(FileAttributeTagInformation).

parent fea609c0
......@@ -2253,7 +2253,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
0, /* FileQuotaInformation */
0, /* FileReparsePointInformation */
sizeof(FILE_NETWORK_OPEN_INFORMATION), /* FileNetworkOpenInformation */
0, /* FileAttributeTagInformation */
sizeof(FILE_ATTRIBUTE_TAG_INFORMATION), /* FileAttributeTagInformation */
0, /* FileTrackingInformation */
0, /* FileIdBothDirectoryInformation */
0, /* FileIdFullDirectoryInformation */
......@@ -2471,6 +2471,15 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
*(ULONGLONG *)&info->FileId = st.st_ino;
}
break;
case FileAttributeTagInformation:
if (fd_get_file_info( fd, &st, &attr ) == -1) io->u.Status = FILE_GetNtStatus();
else
{
FILE_ATTRIBUTE_TAG_INFORMATION *info = ptr;
info->FileAttributes = attr;
info->ReparseTag = 0; /* FIXME */
}
break;
default:
FIXME("Unsupported class (%d)\n", class);
io->u.Status = STATUS_NOT_IMPLEMENTED;
......
......@@ -3673,6 +3673,52 @@ static void test_file_access_information(void)
CloseHandle( h );
}
static void test_file_attribute_tag_information(void)
{
FILE_ATTRIBUTE_TAG_INFORMATION info;
FILE_BASIC_INFORMATION fbi = {};
IO_STATUS_BLOCK io;
NTSTATUS status;
HANDLE h;
if (!(h = create_temp_file(0))) return;
status = pNtQueryInformationFile( h, &io, &info, sizeof(info) - 1, FileAttributeTagInformation );
ok( status == STATUS_INFO_LENGTH_MISMATCH, "got %#x\n", status );
status = pNtQueryInformationFile( (HANDLE)0xdeadbeef, &io, &info, sizeof(info), FileAttributeTagInformation );
ok( status == STATUS_INVALID_HANDLE, "got %#x\n", status );
memset(&info, 0x11, sizeof(info));
status = pNtQueryInformationFile( h, &io, &info, sizeof(info), FileAttributeTagInformation );
ok( status == STATUS_SUCCESS, "got %#x\n", status );
info.FileAttributes &= ~FILE_ATTRIBUTE_NOT_CONTENT_INDEXED;
ok( info.FileAttributes == FILE_ATTRIBUTE_ARCHIVE, "got attributes %#x\n", info.FileAttributes );
ok( !info.ReparseTag, "got reparse tag %#x\n", info.ReparseTag );
fbi.FileAttributes = FILE_ATTRIBUTE_SYSTEM;
status = pNtSetInformationFile(h, &io, &fbi, sizeof(fbi), FileBasicInformation);
ok( status == STATUS_SUCCESS, "got %#x\n", status );
memset(&info, 0x11, sizeof(info));
status = pNtQueryInformationFile( h, &io, &info, sizeof(info), FileAttributeTagInformation );
ok( status == STATUS_SUCCESS, "got %#x\n", status );
todo_wine ok( info.FileAttributes == FILE_ATTRIBUTE_SYSTEM, "got attributes %#x\n", info.FileAttributes );
ok( !info.ReparseTag, "got reparse tag %#x\n", info.ReparseTag );
fbi.FileAttributes = FILE_ATTRIBUTE_HIDDEN;
status = pNtSetInformationFile(h, &io, &fbi, sizeof fbi, FileBasicInformation);
ok( status == STATUS_SUCCESS, "got %#x\n", status );
memset(&info, 0x11, sizeof(info));
status = pNtQueryInformationFile( h, &io, &info, sizeof(info), FileAttributeTagInformation );
ok( status == STATUS_SUCCESS, "got %#x\n", status );
todo_wine ok( info.FileAttributes == FILE_ATTRIBUTE_HIDDEN, "got attributes %#x\n", info.FileAttributes );
ok( !info.ReparseTag, "got reparse tag %#x\n", info.ReparseTag );
CloseHandle( h );
}
static void test_file_mode(void)
{
UNICODE_STRING file_name, pipe_dev_name, mountmgr_dev_name, mailslot_dev_name;
......@@ -4917,6 +4963,7 @@ START_TEST(file)
test_file_completion_information();
test_file_id_information();
test_file_access_information();
test_file_attribute_tag_information();
test_file_mode();
test_file_readonly_access();
test_query_volume_information_file();
......
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