[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:
Pete Batard 2011-12-11 02:19:38 +00:00
parent 78ad099bf9
commit df7a0b1fc3
4 changed files with 64 additions and 65 deletions

View file

@ -159,6 +159,7 @@ extern void __cdecl FormatThread(void* param);
extern BOOL CreatePartition(HANDLE hDrive);
extern HANDLE GetDriveHandle(DWORD DriveIndex, char* DriveLetter, BOOL bWriteAccess, BOOL bLockDrive);
extern BOOL GetDriveLabel(DWORD DriveIndex, char* letter, char** label);
extern BOOL UnmountDrive(HANDLE hDrive);
__inline static BOOL UnlockDrive(HANDLE hDrive)
{