[SETUPLIB][USETUP] Move the floppy-disk accessibility check into InstallFatBootcodeToFloppy().

svn path=/branches/setup_improvements/; revision=75751
This commit is contained in:
Hermès Bélusca-Maïto 2017-09-03 16:19:59 +00:00
parent aab937715b
commit 9d93100afc
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 12 additions and 11 deletions

View file

@ -2303,7 +2303,11 @@ InstallFatBootcodeToFloppy(
WCHAR SrcPath[MAX_PATH];
WCHAR DstPath[MAX_PATH];
/* Format the floppy first */
/* Verify that the floppy disk is accessible */
if (DoesDirExist(NULL, FloppyDevice.Buffer) == FALSE)
return STATUS_DEVICE_NOT_READY;
/* Format the floppy disk */
FatFS = GetFileSystemByName(L"FAT");
if (!FatFS)
{

View file

@ -4532,16 +4532,14 @@ BootLoaderFloppyPage(PINPUT_RECORD Ir)
}
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
if (DoesDirExist(NULL, L"\\Device\\Floppy0\\") == FALSE)
{
MUIDisplayError(ERROR_NO_FLOPPY, Ir, POPUP_WAIT_ENTER);
return BOOT_LOADER_FLOPPY_PAGE;
}
Status = InstallFatBootcodeToFloppy(&USetupData.SourceRootPath, &USetupData.DestinationArcPath);
Status = InstallFatBootcodeToFloppy(&USetupData.SourceRootPath,
&USetupData.DestinationArcPath);
if (!NT_SUCCESS(Status))
{
/* Print error message */
if (Status == STATUS_DEVICE_NOT_READY)
MUIDisplayError(ERROR_NO_FLOPPY, Ir, POPUP_WAIT_ENTER);
/* TODO: Print error message */
return BOOT_LOADER_FLOPPY_PAGE;
}
@ -4625,8 +4623,7 @@ BootLoaderHarddiskMbrPage(PINPUT_RECORD Ir)
DestinationDevicePathBuffer);
if (!NT_SUCCESS(Status))
{
DPRINT1("InstallMbrBootCodeToDisk() failed (Status %lx)\n",
Status);
DPRINT1("InstallMbrBootCodeToDisk() failed (Status %lx)\n", Status);
MUIDisplayError(ERROR_INSTALL_BOOTCODE, Ir, POPUP_WAIT_ENTER);
return QUIT_PAGE;
}