mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-24 19:54:25 -04:00
[core] add workaround for Windows 11's locking issue
* Windows 11 appears to be a lot more proactive in locking system partitions (ESPs, MSRs) than previous versions of Windows were, resulting in format or access errors. * Try to work around these by disabling exclusive drive locking as needed.
This commit is contained in:
parent
fba24170e1
commit
df8058b4f3
3 changed files with 12 additions and 6 deletions
|
@ -1807,6 +1807,10 @@ DWORD WINAPI FormatThread(void* param)
|
|||
// too well with Windows. Same with ESPs. Relaxing our locking rules seems to help...
|
||||
if ((extra_partitions & (XP_ESP | XP_CASPER)) || (fs_type >= FS_EXT2))
|
||||
actual_lock_drive = FALSE;
|
||||
// Windows 11 is a lot more proactive in locking ESPs and MSRs than previous versions
|
||||
// were, meaning that we also can't lock the drive without incurring errors...
|
||||
if ((nWindowsVersion >= WINDOWS_11) && extra_partitions)
|
||||
actual_lock_drive = FALSE;
|
||||
|
||||
PrintInfoDebug(0, MSG_225);
|
||||
hPhysicalDrive = GetPhysicalHandle(DriveIndex, actual_lock_drive, FALSE, !actual_lock_drive);
|
||||
|
@ -1841,6 +1845,8 @@ DWORD WINAPI FormatThread(void* param)
|
|||
// If we couldn't delete partitions, Windows give us trouble unless we
|
||||
// request access to the logical drive. Don't ask me why!
|
||||
need_logical = TRUE;
|
||||
// Also, since we couldn't clean the disk, we need to disable drive locking
|
||||
actual_lock_drive = FALSE;
|
||||
}
|
||||
|
||||
// An extra refresh of the (now empty) partition data here appears to be helpful
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue