Author: hbelusca
Date: Sun Sep 3 16:19:59 2017
New Revision: 75751
URL:
http://svn.reactos.org/svn/reactos?rev=75751&view=rev
Log:
[SETUPLIB][USETUP]: Move the floppy-disk accessibility check into
InstallFatBootcodeToFloppy().
Modified:
branches/setup_improvements/base/setup/lib/bootsup.c
branches/setup_improvements/base/setup/usetup/usetup.c
Modified: branches/setup_improvements/base/setup/lib/bootsup.c
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/l…
==============================================================================
--- branches/setup_improvements/base/setup/lib/bootsup.c [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/lib/bootsup.c [iso-8859-1] Sun Sep 3 16:19:59
2017
@@ -2268,7 +2268,11 @@
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)
{
Modified: branches/setup_improvements/base/setup/usetup/usetup.c
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
==============================================================================
--- branches/setup_improvements/base/setup/usetup/usetup.c [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/usetup.c [iso-8859-1] Sun Sep 3
16:19:59 2017
@@ -4186,16 +4186,14 @@
}
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;
}
@@ -4279,8 +4277,7 @@
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;
}