From: Joel Holdsworth <joel@airwebreathe.org.uk> Real NTFS volumes on Windows report FILE_SUPPORTS_OPEN_BY_FILE_ID in their filesystem attribute flags. MSYS2/Cygwin checks for this flag to decide whether to use FileRenameInformationEx with FILE_RENAME_POSIX_SEMANTICS. Without it, Cygwin falls back to legacy rename behavior which fails with STATUS_ACCESS_DENIED when the target file is still open. --- dlls/ntdll/tests/file.c | 2 +- dlls/ntdll/unix/file.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 7aae71b02d5..5ac513a6dc0 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -4873,7 +4873,7 @@ static void test_query_attribute_information_file(void) ok(ffai->FileSystemAttributes != 0, "Missing FileSystemAttributes\n"); ok(ffai->MaximumComponentNameLength != 0, "Missing MaximumComponentNameLength\n"); ok(ffai->FileSystemNameLength != 0, "Missing FileSystemNameLength\n"); - todo_wine ok(ffai->FileSystemAttributes & FILE_SUPPORTS_OPEN_BY_FILE_ID, + ok(ffai->FileSystemAttributes & FILE_SUPPORTS_OPEN_BY_FILE_ID, "expected FILE_SUPPORTS_OPEN_BY_FILE_ID to be set, got %#lx\n", ffai->FileSystemAttributes); trace("FileSystemAttributes: %lx MaximumComponentNameLength: %lx FileSystemName: %s\n", diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index b5add7aa501..c9faf5b5e75 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -7535,7 +7535,8 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, IO_STATUS_BLOCK *io memcpy(info->FileSystemName, fat32W, info->FileSystemNameLength); break; default: - info->FileSystemAttributes = FILE_CASE_PRESERVED_NAMES | FILE_PERSISTENT_ACLS; + info->FileSystemAttributes = FILE_CASE_PRESERVED_NAMES | FILE_PERSISTENT_ACLS + | FILE_SUPPORTS_OPEN_BY_FILE_ID; info->MaximumComponentNameLength = 255; info->FileSystemNameLength = min( sizeof(ntfsW), length - offsetof( FILE_FS_ATTRIBUTE_INFORMATION, FileSystemName ) ); memcpy(info->FileSystemName, ntfsW, info->FileSystemNameLength); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10866