From 5c98448aa3acb9bac40a0afa28ffbee3001081d0 Mon Sep 17 00:00:00 2001
From: Ken Thomases <ken@codeweavers.com>
Date: Wed, 20 May 2015 14:59:11 -0500
Subject: [PATCH] ntdll: If read_directory_getattrlist() finds that the file
 doesn't exist, return successful "no file" result to stop search.

---
 dlls/ntdll/directory.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index 0e5af8a0cf1..267f0191220 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -2185,6 +2185,11 @@ static int read_directory_getattrlist( int fd, IO_STATUS_BLOCK *io, void *buffer
             }
             else io->u.Status = STATUS_NO_MORE_FILES;
         }
+        else if ((errno == ENOENT || errno == ENOTDIR) && !get_dir_case_sensitivity("."))
+        {
+            io->u.Status = STATUS_NO_MORE_FILES;
+            ret = 0;
+        }
     }
     else ret = -1;
 
-- 
GitLab