[PATCH v3 3/4] kernelbase: Translate FILE_FLAG_SEQUENTIAL_SCAN

Luke Deller luke at deller.id.au
Tue Aug 3 09:57:24 CDT 2021


Translate FILE_FLAG_SEQUENTIAL_SCAN into the corresponding flag for
NtCreateFile options

Signed-off-by: Luke Deller <luke at deller.id.au>
---
 dlls/kernelbase/file.c   | 3 +++
 dlls/msvcrt/tests/file.c | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
index e0a75c2ad08..d21ad299d1f 100644
--- a/dlls/kernelbase/file.c
+++ b/dlls/kernelbase/file.c
@@ -723,6 +723,8 @@ static UINT get_nt_file_options( DWORD attributes )
         options |= FILE_SYNCHRONOUS_IO_NONALERT;
     if (attributes & FILE_FLAG_RANDOM_ACCESS)
         options |= FILE_RANDOM_ACCESS;
+    if (attributes & FILE_FLAG_SEQUENTIAL_SCAN)
+        options |= FILE_SEQUENTIAL_ONLY;
     if (attributes & FILE_FLAG_WRITE_THROUGH)
         options |= FILE_WRITE_THROUGH;
     return options;
@@ -3227,6 +3229,7 @@ HANDLE WINAPI DECLSPEC_HOTPATCH OpenFileById( HANDLE handle, LPFILE_ID_DESCRIPTO
     if (flags & FILE_FLAG_NO_BUFFERING) options |= FILE_NO_INTERMEDIATE_BUFFERING;
     if (!(flags & FILE_FLAG_OVERLAPPED)) options |= FILE_SYNCHRONOUS_IO_NONALERT;
     if (flags & FILE_FLAG_RANDOM_ACCESS) options |= FILE_RANDOM_ACCESS;
+    if (flags & FILE_FLAG_SEQUENTIAL_SCAN) options |= FILE_SEQUENTIAL_ONLY;
     flags &= FILE_ATTRIBUTE_VALID_FLAGS;
 
     objectName.Length             = sizeof(ULONGLONG);
diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c
index 1cabc163a93..a866df515be 100644
--- a/dlls/msvcrt/tests/file.c
+++ b/dlls/msvcrt/tests/file.c
@@ -2785,7 +2785,7 @@ static void test_fopen_hints(void)
         ok(fp != NULL, "unable to fopen test file with mode \"%s\"\n", mode);
 
         has_sequential = has_sequential_hint(_fileno(fp));
-        todo_wine_if(expect_sequential) ok(has_sequential == expect_sequential,
+        ok(has_sequential == expect_sequential,
             "unexpected sequential hint %d for fopen mode \"%s\"\n",
             has_sequential, mode);
 
@@ -2839,7 +2839,7 @@ static void test_open_hints(void)
         ok(fd != -1, "unable to _open test file with flags %x\n", flags);
 
         has_sequential = has_sequential_hint(fd);
-        todo_wine_if(expect_sequential) ok(has_sequential == expect_sequential,
+        ok(has_sequential == expect_sequential,
             "unexpected sequential hint %d for _open flags %x\n",
             has_sequential, flags);
 
-- 
2.25.1




More information about the wine-devel mailing list