From: Dmitry Timoshkov dmitry@baikal.ru
According to the tests this behaviour depends on FILE_FLAG_POSIX_SEMANTICS.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58636 Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/kernel32/tests/file.c | 1 - dlls/kernelbase/file.c | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index d2f20531cb6..381e1c73924 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -1743,7 +1743,6 @@ static void test_CreateFileW(void) ok(hFile != INVALID_HANDLE_VALUE, "CreateFileW error %lu\n", GetLastError()); ret = GetFileInformationByHandle(hFile, &info); ok(ret, "GetFileInformationByHandle error %lu\n", GetLastError()); - todo_wine ok(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY, "created file is not a directory\n"); hFile2 = CreateFileW(filename, 0, 0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_POSIX_SEMANTICS | FILE_ATTRIBUTE_DIRECTORY, NULL); diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c index b34a3bb25b8..6d70b17df21 100644 --- a/dlls/kernelbase/file.c +++ b/dlls/kernelbase/file.c @@ -763,7 +763,11 @@ static UINT get_nt_file_options( DWORD attributes ) UINT options = 0;
if (attributes & FILE_FLAG_BACKUP_SEMANTICS) + { options |= FILE_OPEN_FOR_BACKUP_INTENT; + if (attributes & FILE_FLAG_POSIX_SEMANTICS) + options |= (attributes & FILE_ATTRIBUTE_DIRECTORY) ? FILE_DIRECTORY_FILE : 0; + } else options |= FILE_NON_DIRECTORY_FILE; if (attributes & FILE_FLAG_DELETE_ON_CLOSE)