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

Grazvydas Ignotas notasas at gmail.com
Wed Jul 20 08:56:28 CDT 2011

Here is another idea:

It seems getdents64 is indeed returning "." and "..", but not
necessarily first, like Windows does. I think we could swap first 2
entries returned, whatever they are, with "." and "..". It would work
like this:

- read the 2 first entries to advance file pointer, but ignore them,
return "." or ".." instead
- return other entries normally
- after "." or ".." is encountered, save current file offset and seek
to first or second entry (respectively) and return that instead. For a
corner case where that spot has ".." or ".", return the other one of
first 2.
- seek back where we were

I think this would also fix fake_dot_dot + single_entry case. What do you think?


More information about the wine-devel mailing list