Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47813 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntdll/file.c | 10 ++++++++- dlls/ntdll/tests/file.c | 47 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index cd1775a98cc..35f4fa13b7a 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,14 @@ 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 */ + } 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..880c489c61f 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 ); + 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 ); + 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();
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47813 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/kernelbase/file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c index 3da50d2c95e..b0365f7b2db 100644 --- a/dlls/kernelbase/file.c +++ b/dlls/kernelbase/file.c @@ -1534,7 +1534,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetFileInformationByHandleEx( HANDLE handle, FILE_ { case FileStreamInfo: case FileCompressionInfo: - case FileAttributeTagInfo: case FileRemoteProtocolInfo: case FileFullDirectoryInfo: case FileFullDirectoryRestartInfo: @@ -1546,6 +1545,10 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetFileInformationByHandleEx( HANDLE handle, FILE_ SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); return FALSE;
+ case FileAttributeTagInfo: + status = NtQueryInformationFile( handle, &io, info, size, FileAttributeTagInformation ); + break; + case FileBasicInfo: status = NtQueryInformationFile( handle, &io, info, size, FileBasicInformation ); break;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=56992
Your paranoid android.
=== debian10 (32 bit report) ===
ntdll: file.c:3694: Test failed: got 0xc0000002 file.c:3705: Test failed: got 0xc0000002 file.c:3706: Test failed: got attributes 0x20 file.c:3715: Test failed: got 0xc0000002 file.c:3716: Test failed: got attributes 0x20
=== debian10 (32 bit Chinese:China report) ===
ntdll: file.c:3694: Test failed: got 0xc0000002 file.c:3705: Test failed: got 0xc0000002 file.c:3706: Test failed: got attributes 0x20 file.c:3715: Test failed: got 0xc0000002 file.c:3716: Test failed: got attributes 0x20
=== debian10 (32 bit WoW report) ===
ntdll: file.c:3694: Test failed: got 0xc0000002 file.c:3705: Test failed: got 0xc0000002 file.c:3706: Test failed: got attributes 0x20 file.c:3715: Test failed: got 0xc0000002 file.c:3716: Test failed: got attributes 0x20
=== debian10 (64 bit WoW report) ===
ntdll: file.c:3694: Test failed: got 0xc0000002 file.c:3705: Test failed: got 0xc0000002 file.c:3706: Test failed: got attributes 0x20 file.c:3715: Test failed: got 0xc0000002 file.c:3716: Test failed: got attributes 0x20
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=56991
Your paranoid android.
=== debian10 (32 bit report) ===
ntdll: file.c:3694: Test failed: got 0xc0000002 file.c:3705: Test failed: got 0xc0000002 file.c:3706: Test failed: got attributes 0x20 file.c:3715: Test failed: got 0xc0000002 file.c:3716: Test failed: got attributes 0x20
=== debian10 (32 bit French report) ===
ntdll: file.c:3694: Test failed: got 0xc0000002 file.c:3705: Test failed: got 0xc0000002 file.c:3706: Test failed: got attributes 0x20 file.c:3715: Test failed: got 0xc0000002 file.c:3716: Test failed: got attributes 0x20
=== debian10 (32 bit Japanese:Japan report) ===
ntdll: file.c:3694: Test failed: got 0xc0000002 file.c:3705: Test failed: got 0xc0000002 file.c:3706: Test failed: got attributes 0x20 file.c:3715: Test failed: got 0xc0000002 file.c:3716: Test failed: got attributes 0x20
=== debian10 (32 bit Chinese:China report) ===
ntdll: file.c:3694: Test failed: got 0xc0000002 file.c:3705: Test failed: got 0xc0000002 file.c:3706: Test failed: got attributes 0x20 file.c:3715: Test failed: got 0xc0000002 file.c:3716: Test failed: got attributes 0x20
=== debian10 (32 bit WoW report) ===
ntdll: file.c:3694: Test failed: got 0xc0000002 file.c:3705: Test failed: got 0xc0000002 file.c:3706: Test failed: got attributes 0x20 file.c:3715: Test failed: got 0xc0000002 file.c:3716: Test failed: got attributes 0x20
=== debian10 (64 bit WoW report) ===
ntdll: file.c:3694: Test failed: got 0xc0000002 file.c:3705: Test failed: got 0xc0000002 file.c:3706: Test failed: got attributes 0x20 file.c:3715: Test failed: got 0xc0000002 file.c:3716: Test failed: got attributes 0x20