Skip to content

Conversation

iskiselev
Copy link

Ugly patch that fixed #266 for me

Lastique added a commit that referenced this pull request Dec 2, 2022
Added ERROR_CALL_NOT_IMPLEMENTED to the list of error codes that are used
to permanently downgrade directory querying method. This error code is
returned by Wine, which up until version 7.21 did not support
FileIdExtdDirectoryRestartInfo and FileFullDirectoryRestartInfo.

Further, use non-permanent downgrade on ERROR_INVALID_PARAMETER. Apparently,
some mounted filesystems don't implement even the older info classes,
such as FileFullDirectoryRestartInfo and FileIdBothDirectoryRestartInfo.
These info classes are otherwise supported by the system and work on other
filesystems.

Lastly, if querying FileIdBothDirectoryRestartInfo fails, fall back to
NtQueryDirectoryFile API.

Fixes #255.
Fixes #266.
Closes #267.
Possibly related to #261.
@Lastique Lastique closed this in 8b71cb1 Dec 2, 2022
{
// Fall back to file_directory_information_format
filesystem::detail::atomic_store_relaxed(g_extra_data_format, file_directory_information_format);
return dir_itr_create(imp, dir, opts, params, first_filename, sf, symlink_sf);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attempt to goto into last branch as fallback failed, most probably extra_data / dir_itr_extra_size already has some incorrect data here, have not looked deep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

directory_iterator does not work in some cases
1 participant