[PATCH 2/4] ntdll: If read_directory_getattrlist() finds that the file doesn't exist, return successful "no file" result to stop search.

Ken Thomases ken at codeweavers.com
Wed May 20 14:44:50 CDT 2015


On May 20, 2015, at 2:38 PM, Matteo Bruni <matteo.mystral at gmail.com> wrote:

> ----
> diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
> index 0e5af8a..42e1842 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)
> +        {
> +            io->u.Status = STATUS_NO_MORE_FILES;
> +            ret = 0;
> +        }
>     }
>     else ret = -1;
> ----
> 
> Actually that's how my patch originally looked like
> (http://source.winehq.org/patches/data/111375) but then I realized
> that would break if the filesystem is case-sensitive, since it would
> return the file as missing while it might be present with a different
> name casing. I haven't actually tested it though.

Good point.  I can add a check for the case-sensitivity of the file system.

-Ken




More information about the wine-devel mailing list