mirror of
https://github.com/morluto/rea.git
synced 2026-10-26 17:35:11 +00:00
fix(windows): admit volume roots with existing write handles
This commit is contained in:
1 parent
bb49252523
commit
709e99d781
4 files changed
+151
-1
No files matched your search
@@ -67,7 +67,10 @@ std::unique_ptr<File> openFile(const std::wstring& requested, DWORD access, bool
|
||||
result->requestedPath = requested;
|
||||
const auto& path = result->path;
|
||||
require(directory || path.size() > 3, "Target is not a regular file", requested, ERROR_DIRECTORY);
|
||||
result->handles.push_back(openComponent(path.substr(0, 3), 0, true));
|
||||
// The volume root cannot be replaced or deleted. Match the later root
|
||||
// reopen's write sharing here so a root writer cannot block admission.
|
||||
result->handles.push_back(openComponent(path.substr(0, 3), 0, true,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE));
|
||||
wchar_t filesystem[64]{};
|
||||
DWORD flags = 0;
|
||||
require(GetVolumeInformationByHandleW(result->handles.front().get(), nullptr, 0, nullptr, nullptr,
|
||||
|
||||
Reference in new issue
Block a user