mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-28 13:44:15 -04:00
[format] added volume unmount and improve logic
* acquire a vomume handle and unmount the volume before anything else * remove the volume access check after partitioning - use a small delay instead
This commit is contained in:
parent
78ad099bf9
commit
df7a0b1fc3
4 changed files with 64 additions and 65 deletions
11
src/drive.c
11
src/drive.c
|
@ -155,3 +155,14 @@ BOOL GetDriveLabel(DWORD DriveIndex, char* letter, char** label)
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL UnmountDrive(HANDLE hDrive)
|
||||
{
|
||||
DWORD size;
|
||||
|
||||
if (!DeviceIoControl(hDrive, FSCTL_DISMOUNT_VOLUME, NULL, 0, NULL, 0, &size, NULL)) {
|
||||
uprintf("Could not ummount drive: %s\n", WindowsErrorString());
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue