[core] revert to having the ESP as the last partition

* This is to avoid Microsoft's appalling refresh of the partition layout,
  which can result in partitions not being assigned a volume GUID.
* Mostly reverts a change that was applied in 1c39a80d72.
* Also add some more enum output and bail if we can't get a logical drive.
* Closes #1351
This commit is contained in:
Pete Batard 2019-08-13 09:04:31 +01:00
parent f0c843fcdc
commit 936bd9beb0
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
3 changed files with 48 additions and 53 deletions

View file

@ -2679,8 +2679,11 @@ DWORD WINAPI FormatThread(void* param)
// Wait for the logical drive we just created to appear
uprintf("Waiting for logical drive to reappear...");
Sleep(200);
if (!WaitForLogical(DriveIndex, partition_index[PI_MAIN]))
uprintf("Logical drive was not found!"); // We try to continue even if this fails, just in case
if (!WaitForLogical(DriveIndex, partition_index[PI_MAIN])) {
uprintf("Logical drive was not found - aborting");
FormatStatus = ERROR_SEVERITY_ERROR | FAC(FACILITY_STORAGE) | ERROR_NO_VOLUME_ID;
goto out;
}
CHECK_FOR_USER_CANCEL;
// Format Casper partition if required. Do it before we format anything with