[PATCH 2/2] ntdll: Set restart_scan on first call to NtQueryDirectoryFile.

Grazvydas Ignotas notasas at gmail.com
Mon Jul 18 12:37:58 CDT 2011


On Mon, Jul 18, 2011 at 1:41 PM, Alexandre Julliard <julliard at winehq.org> wrote:
> Grazvydas Ignotas <notasas at gmail.com> writes:
>
>> @@ -2004,6 +2004,8 @@ NTSTATUS WINAPI NtQueryDirectoryFile( HANDLE handle, HANDLE event,
>>          fstat( fd, &st );
>>          curdir.dev = st.st_dev;
>>          curdir.ino = st.st_ino;
>> +        if (lseek( fd, 0, SEEK_CUR ) == 0)
>> +            restart_scan = TRUE;
>
> That won't work if we already returned '.' and '..'.

You mean fake '.' and '..'?

Do you have any suggestions how to track state between calls?
I'm thinking about using global structure to track dev_t, ino_t and
off_t (and maybe handle), and if any of those changes since last exit
from the function consider it as a first call for this handle.

It looks like the best way would be to attach state to handle somehow
(that would be dropped automatically on CloseHandle), but I failed to
find a way to do so.

>
> --
> Alexandre Julliard
> julliard at winehq.org
>

-- 
Gražvydas



More information about the wine-devel mailing list