mirror of
https://github.com/boostorg/filesystem.git
synced 2026-01-19 04:12:09 +00:00
Use synchronous IO on file handles created in remove_all NT6 implementation.
This eliminates spinning while iterating over directory contents as by default file handles created by NtCreateFile are non-blocking. Because of this NtQueryDirectoryFile didn't block and returned STATUS_PENDING without actually updating the iteration state. Eventually this would cause directory iteration to fail with a hard error.
This commit is contained in:
@@ -2004,7 +2004,7 @@ uintmax_t remove_all_nt6_by_handle(HANDLE h, path const& p, error_code* ec)
|
||||
FILE_LIST_DIRECTORY | DELETE | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
|
||||
FILE_OPEN,
|
||||
FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_REPARSE_POINT
|
||||
FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_REPARSE_POINT
|
||||
);
|
||||
|
||||
if (!NT_SUCCESS(status))
|
||||
|
||||
@@ -156,6 +156,9 @@ struct object_attributes
|
||||
#ifndef FILE_DIRECTORY_FILE
|
||||
#define FILE_DIRECTORY_FILE 0x00000001
|
||||
#endif
|
||||
#ifndef FILE_SYNCHRONOUS_IO_NONALERT
|
||||
#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
|
||||
#endif
|
||||
#ifndef FILE_OPEN_FOR_BACKUP_INTENT
|
||||
#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user