[FREELDR] Use NOGUIBOOT when booting in Safe-Mode.
[reactos.git] / boot / freeldr / freeldr / options.c
index 2211230..78338f2 100644 (file)
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+/* INCLUDES *******************************************************************/
+
 #include <freeldr.h>
 #include <debug.h>
 
+/* GLOBALS ********************************************************************/
+
 PCSTR OptionsMenuList[] =
 {
     "Safe Mode",
@@ -46,10 +50,11 @@ PCSTR OptionsMenuList[] =
 #endif
 };
 
+const
 PCSTR FrldrDbgMsg = "Enable FreeLdr debug channels\n"
                     "Acceptable syntax: [level1]#channel1[,[level2]#channel2]\n"
                     "level can be one of: trace,warn,fixme,err\n"
-                    "  if the level is ommited all levels\n"
+                    "  if the level is omitted all levels\n"
                     "  are enabled for the specified channel\n"
                     "# can be either + or -\n"
                     "channel can be one of the following:\n"
@@ -61,9 +66,7 @@ PCSTR FrldrDbgMsg = "Enable FreeLdr debug channels\n"
                     "  +peloader\n"
                     "NOTE: all letters must be lowercase, no spaces allowed.";
 
-//
-// The boot options are mutually exclusive.
-//
+/* The boot options are mutually exclusive */
 enum BootOption
 {
     NO_OPTION = 0,
@@ -76,13 +79,13 @@ enum BootOption
     DIRECTORY_SERVICES_RESTORE_MODE,
 };
 
-ULONG OptionsMenuItemCount = sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]);
-
 static enum BootOption BootOptionChoice = NO_OPTION;
 static BOOLEAN BootLogging = FALSE;
 static BOOLEAN VgaMode = FALSE;
 static BOOLEAN DebuggingMode = FALSE;
 
+/* FUNCTIONS ******************************************************************/
+
 VOID DoOptionsMenu(VOID)
 {
     ULONG SelectedMenuItem;
@@ -91,17 +94,18 @@ VOID DoOptionsMenu(VOID)
     if (!UiDisplayMenu("Select an option:", "",
                        TRUE,
                        OptionsMenuList,
-                       OptionsMenuItemCount,
-                       0, -1,
+                       sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]),
+                       11, // Use "Start ReactOS normally" as default; see the switch below.
+                       -1,
                        &SelectedMenuItem,
                        TRUE,
                        NULL))
     {
-        // The user pressed ESC
+        /* The user pressed ESC */
         return;
     }
 
-    // Clear the backdrop
+    /* Clear the backdrop */
     UiDrawBackdrop();
 
     switch (SelectedMenuItem)
@@ -242,15 +246,15 @@ VOID AppendBootTimeOptions(PCHAR BootOptions)
     switch (BootOptionChoice)
     {
         case SAFE_MODE:
-            strcat(BootOptions, " /SAFEBOOT:MINIMAL /SOS"); //FIXME: NOGUIBOOT should also be specified
+            strcat(BootOptions, " /SAFEBOOT:MINIMAL /SOS /NOGUIBOOT");
             break;
 
         case SAFE_MODE_WITH_NETWORKING:
-            strcat(BootOptions, " /SAFEBOOT:NETWORK /SOS"); //FIXME: NOGUIBOOT should also be specified
+            strcat(BootOptions, " /SAFEBOOT:NETWORK /SOS /NOGUIBOOT");
             break;
 
         case SAFE_MODE_WITH_COMMAND_PROMPT:
-            strcat(BootOptions, " /SAFEBOOT:MINIMAL(ALTERNATESHELL) /SOS"); //FIXME: NOGUIBOOT should also be specified
+            strcat(BootOptions, " /SAFEBOOT:MINIMAL(ALTERNATESHELL) /SOS /NOGUIBOOT");
             break;
 
         case LAST_KNOWN_GOOD_CONFIGURATION: