Reduce permission to avoid to spin up disks in Windows

This commit is contained in:
Andrea Mazzoleni 2026-06-23 10:57:21 +02:00
parent 99a5a78570
commit 6602bebd5b

View file

@ -2977,7 +2977,7 @@ static int devup(uint64_t device, const char* name, const char* wfile)
snprintf(file, sizeof(file), "/dev/pd%" PRIu64, device);
/* open the volume */
h = CreateFileW(convert(conv_buf, wfile), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH, 0);
h = CreateFileW(convert(conv_buf, wfile), 0, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
if (h == INVALID_HANDLE_VALUE) {
DWORD error = GetLastError();
windows_errno(error);