Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47813 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntdll/file.c | 11 +++++++++- dlls/ntdll/tests/file.c | 47 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index cd1775a98cc..655dcb2eafe 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -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; diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 31fc7ae7b01..539ce44e0a4 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -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();