[FREELDR]
[reactos.git] / reactos / boot / freeldr / freeldr / arch / i386 / custom.c
index a53d423..b9d1c0d 100644 (file)
@@ -40,10 +40,16 @@ VOID OptionMenuCustomBoot(VOID)
                "ReactOS",
                "Linux"
                };
-       ULONG           CustomBootMenuCount = sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0]);
-       ULONG           SelectedMenuItem;
+       ULONG   CustomBootMenuCount = sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0]);
+       ULONG   SelectedMenuItem;
 
-       if (!UiDisplayMenu(CustomBootMenuList, CustomBootMenuCount, 0, -1, &SelectedMenuItem, TRUE, NULL))
+       if (!UiDisplayMenu("Please choose a boot method:",
+                          CustomBootMenuList,
+                          CustomBootMenuCount,
+                          0, -1,
+                          &SelectedMenuItem,
+                          TRUE,
+                          NULL))
        {
                // The user pressed ESC
                return;
@@ -68,10 +74,11 @@ VOID OptionMenuCustomBoot(VOID)
 
 VOID OptionMenuCustomBootDisk(VOID)
 {
-       CHAR    SectionName[100];
-       CHAR    BootDriveString[20];
-       ULONG   SectionId;
+       ULONG_PTR       SectionId;
+       CHAR            SectionName[100];
+       CHAR            BootDriveString[20];
        TIMEINFO*       TimeInfo;
+       OperatingSystemItem     OperatingSystem;
 
        RtlZeroMemory(SectionName, sizeof(SectionName));
        RtlZeroMemory(BootDriveString, sizeof(BootDriveString));
@@ -105,16 +112,21 @@ VOID OptionMenuCustomBootDisk(VOID)
 
        UiMessageBox(CustomBootPrompt);
 
-       LoadAndBootDrive(SectionName);
+       OperatingSystem.SystemPartition = SectionName;
+       OperatingSystem.LoadIdentifier  = NULL;
+       OperatingSystem.OsLoadOptions   = NULL;
+
+       LoadAndBootDrive(&OperatingSystem, 0);
 }
 
 VOID OptionMenuCustomBootPartition(VOID)
 {
-       CHAR    SectionName[100];
-       CHAR    BootDriveString[20];
-       CHAR    BootPartitionString[20];
-       ULONG   SectionId;
+       ULONG_PTR       SectionId;
+       CHAR            SectionName[100];
+       CHAR            BootDriveString[20];
+       CHAR            BootPartitionString[20];
        TIMEINFO*       TimeInfo;
+       OperatingSystemItem     OperatingSystem;
 
        RtlZeroMemory(SectionName, sizeof(SectionName));
        RtlZeroMemory(BootDriveString, sizeof(BootDriveString));
@@ -160,17 +172,22 @@ VOID OptionMenuCustomBootPartition(VOID)
 
        UiMessageBox(CustomBootPrompt);
 
-       LoadAndBootPartition(SectionName);
+       OperatingSystem.SystemPartition = SectionName;
+       OperatingSystem.LoadIdentifier  = NULL;
+       OperatingSystem.OsLoadOptions   = NULL;
+
+       LoadAndBootPartition(&OperatingSystem, 0);
 }
 
 VOID OptionMenuCustomBootBootSectorFile(VOID)
 {
-       CHAR    SectionName[100];
-       CHAR    BootDriveString[20];
-       CHAR    BootPartitionString[20];
-       CHAR    BootSectorFileString[200];
-       ULONG   SectionId;
+       ULONG_PTR       SectionId;
+       CHAR            SectionName[100];
+       CHAR            BootDriveString[20];
+       CHAR            BootPartitionString[20];
+       CHAR            BootSectorFileString[200];
        TIMEINFO*       TimeInfo;
+       OperatingSystemItem     OperatingSystem;
 
        RtlZeroMemory(SectionName, sizeof(SectionName));
        RtlZeroMemory(BootDriveString, sizeof(BootDriveString));
@@ -228,19 +245,24 @@ VOID OptionMenuCustomBootBootSectorFile(VOID)
 
        UiMessageBox(CustomBootPrompt);
 
-       LoadAndBootBootSector(SectionName);
+       OperatingSystem.SystemPartition = SectionName;
+       OperatingSystem.LoadIdentifier  = NULL;
+       OperatingSystem.OsLoadOptions   = NULL;
+
+       LoadAndBootBootSector(&OperatingSystem, 0);
 }
 
 VOID OptionMenuCustomBootLinux(VOID)
 {
-       CHAR    SectionName[100];
-       CHAR    BootDriveString[20];
-       CHAR    BootPartitionString[20];
-       CHAR    LinuxKernelString[200];
-       CHAR    LinuxInitrdString[200];
-       CHAR    LinuxCommandLineString[200];
-       ULONG   SectionId;
+       ULONG_PTR       SectionId;
+       CHAR            SectionName[100];
+       CHAR            BootDriveString[20];
+       CHAR            BootPartitionString[20];
+       CHAR            LinuxKernelString[200];
+       CHAR            LinuxInitrdString[200];
+       CHAR            LinuxCommandLineString[200];
        TIMEINFO*       TimeInfo;
+       OperatingSystemItem     OperatingSystem;
 
        RtlZeroMemory(SectionName, sizeof(SectionName));
        RtlZeroMemory(BootDriveString, sizeof(BootDriveString));
@@ -325,7 +347,11 @@ VOID OptionMenuCustomBootLinux(VOID)
 
        UiMessageBox(CustomBootPrompt);
 
-       LoadAndBootLinux(SectionName, "Custom Linux Setup");
+       OperatingSystem.SystemPartition = SectionName;
+       OperatingSystem.LoadIdentifier  = "Custom Linux Setup";
+       OperatingSystem.OsLoadOptions   = NULL;
+
+       LoadAndBootLinux(&OperatingSystem, 0);
 }
 
 VOID OptionMenuReboot(VOID)
@@ -333,5 +359,5 @@ VOID OptionMenuReboot(VOID)
        UiMessageBox("The system will now reboot.");
 
        DiskStopFloppyMotor();
-       SoftReboot();
+       Reboot();
 }