[core] drive handling improvements

* Use IOCTL_DISK_UPDATE_PROPERTIES after partitioning
* Use IOCTL_DISK_DELETE_DRIVE_LAYOUT to invalidate partitions before formatting
* Fix handling of unpartitioned drives
* Increase delay after partitioning
* All of the above should help with the infamous #122
* Also fix display of error messages in ms-sys' file.c as well as stdio.c
* Also add commandline option -f to list fixed drives
This commit is contained in:
Pete Batard 2013-06-25 02:55:25 +01:00
parent fe3b1eb6f6
commit cd5665881c
7 changed files with 163 additions and 72 deletions

View file

@ -307,6 +307,7 @@ extern HANDLE GetLogicalHandle(DWORD DriveIndex, BOOL bWriteAccess, BOOL bLockDr
extern char GetDriveLetter(DWORD DriveIndex);
extern char GetUnusedDriveLetter(void);
extern BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL mbr_uefi_marker);
extern BOOL DeletePartitions(HANDLE hDrive);
extern const char* GetPartitionType(BYTE Type);
extern BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSystemNameSize);
extern BOOL GetDriveLabel(DWORD DriveIndex, char* letter, char** label);