Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1320 .
Checklist
Changes proposed in this pull request:
If the FindFiles/WithPattern callback function returns STATUS_MORE_ENTRIES to DispatchDirectoryInformation,
it stores this information into the new BOOLEAN member MoreItems within the DOKAN_OPEN_INFO structure.
Within the next call to DispatchDirectoryInformation, if WriteDirectoryResults returns STATUS_NO_MORE_FILES to signal the end of the list,
and if MoreItems is TRUE, the FindFiles/WithPattern callback function is called again to deliver more items.
Depending on the result of this call, MoreItems is again set to TRUE (STATUS_MORE_ENTRIES) or FALSE (STATUS_SUCCESS).
The WriteDirectoryResults is called again to work on the new items that may have been added to the openInfo->DirList.
This continues until there're no more items in the list, even after the callback.
I also added the BOOLEAN member ForceScan to structure DOKAN_FILE_INFO, that I use to indicate to the callback, that the IRP requests a new scan instead of continuing a former one.
I'm not absolutely sure, if this is really necessary, but since it seems to be a possible situation, I decided to support it.
I'm not absolutely happy with this solution, since it make it necessary to change an exported structure, but I didn't find another way without changing the FindFiles/WithPattern callback or adding a new one.
With this solution, it is not necessary to make any changes to the callback functions, and existing implementations still work without any changes.
For now, I raised the DOKAN_VERSION to 238 in order to be able to check for the new functionality in our callbacks, but of course it would be much better to have it available in an official release.