[FREELDR] Add ReactOS Setup as a custom boot type. (#1763)

CORE-9023 CORE-16260

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
This commit is contained in:
Yaroslav Kibysh 2019-07-29 00:17:03 +03:00 committed by Hermès Bélusca-Maïto
parent b34d516e81
commit bc7c689448
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
3 changed files with 42 additions and 13 deletions

View file

@ -31,6 +31,20 @@ VOID
(*EDIT_OS_ENTRY_PROC)(
IN ULONG_PTR SectionId OPTIONAL);
static VOID
EditCustomBootReactOSSetup(
IN ULONG_PTR SectionId OPTIONAL)
{
EditCustomBootReactOS(SectionId, TRUE);
}
static VOID
EditCustomBootNTOS(
IN ULONG_PTR SectionId OPTIONAL)
{
EditCustomBootReactOS(SectionId, FALSE);
}
static const struct
{
PCSTR BootType;
@ -38,18 +52,18 @@ static const struct
ARC_ENTRY_POINT OsLoader;
} OSLoadingMethods[] =
{
{"ReactOSSetup", EditCustomBootReactOS, LoadReactOSSetup},
{"ReactOSSetup", EditCustomBootReactOSSetup, LoadReactOSSetup},
#ifdef _M_IX86
{"Drive" , EditCustomBootDisk , LoadAndBootDrive },
{"Partition" , EditCustomBootPartition , LoadAndBootPartition },
{"BootSector" , EditCustomBootSectorFile, LoadAndBootBootSector},
{"Linux" , EditCustomBootLinux , LoadAndBootLinux },
{"WindowsNT40" , EditCustomBootReactOS, LoadAndBootWindows},
{"Linux" , EditCustomBootLinux, LoadAndBootLinux },
{"WindowsNT40" , EditCustomBootNTOS , LoadAndBootWindows},
#endif
{"Windows" , EditCustomBootReactOS, LoadAndBootWindows},
{"Windows2003" , EditCustomBootReactOS, LoadAndBootWindows},
{"Windows" , EditCustomBootNTOS , LoadAndBootWindows},
{"Windows2003" , EditCustomBootNTOS , LoadAndBootWindows},
};
/* FUNCTIONS ******************************************************************/

View file

@ -51,7 +51,8 @@ VOID OptionMenuCustomBoot(VOID)
"Boot Sector File",
"Linux",
#endif
"ReactOS"
"ReactOS",
"ReactOS Setup"
};
ULONG SelectedMenuItem;
@ -84,11 +85,19 @@ VOID OptionMenuCustomBoot(VOID)
EditCustomBootLinux(0);
break;
case 4: // ReactOS
#else
case 0:
#endif
EditCustomBootReactOS(0);
EditCustomBootReactOS(0, FALSE);
break;
case 5: // ReactOS Setup
EditCustomBootReactOS(0, TRUE);
break;
#else
case 0: // ReactOS
EditCustomBootReactOS(0, FALSE);
break;
case 1: // ReactOS Setup
EditCustomBootReactOS(0, TRUE);
break;
#endif
}
}
@ -386,7 +395,10 @@ VOID EditCustomBootLinux(IN ULONG_PTR SectionId OPTIONAL)
#endif // _M_IX86
VOID EditCustomBootReactOS(IN ULONG_PTR SectionId OPTIONAL)
VOID
EditCustomBootReactOS(
IN ULONG_PTR SectionId OPTIONAL,
IN BOOLEAN IsSetup)
{
TIMEINFO* TimeInfo;
OperatingSystemItem OperatingSystem;
@ -452,7 +464,7 @@ VOID EditCustomBootReactOS(IN ULONG_PTR SectionId OPTIONAL)
return;
/* Add the BootType */
if (!IniAddSettingValueToSection(SectionId, "BootType", "Windows2003"))
if (!IniAddSettingValueToSection(SectionId, "BootType", IsSetup ? "ReactOSSetup" : "Windows2003"))
return;
/* Construct the ReactOS ARC system path */

View file

@ -36,7 +36,10 @@ VOID EditCustomBootLinux(IN ULONG_PTR SectionId OPTIONAL);
VOID OptionMenuCustomBoot(VOID);
#endif
VOID EditCustomBootReactOS(IN ULONG_PTR SectionId OPTIONAL);
VOID
EditCustomBootReactOS(
IN ULONG_PTR SectionId OPTIONAL,
IN BOOLEAN IsSetup);
#ifdef HAS_OPTION_MENU_REBOOT
VOID OptionMenuReboot(VOID);