Sync trunk.
[reactos.git] / boot / freeldr / freeldr / options.c
index 4dabc89..5b64b46 100644 (file)
@@ -69,6 +69,15 @@ enum OptionMenuItems
 
 ULONG          OptionsMenuItemCount = sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]);
 
+BOOLEAN SafeMode = FALSE;
+BOOLEAN SafeModeWithNetworking = FALSE;
+BOOLEAN SafeModeWithCommandPrompt = FALSE;
+BOOLEAN BootLogging = FALSE;
+BOOLEAN VgaMode = FALSE;
+BOOLEAN LastKnownGoodConfiguration = FALSE;
+BOOLEAN DirectoryServicesRepairMode = FALSE;
+BOOLEAN DebuggingMode = FALSE;
+
 VOID DoOptionsMenu(VOID)
 {
        ULONG           SelectedMenuItem;
@@ -85,22 +94,33 @@ VOID DoOptionsMenu(VOID)
        switch (SelectedMenuItem)
        {
        case SAFE_MODE:
+               SafeMode = TRUE;
+               BootLogging = TRUE;
                break;
        case SAFE_MODE_WITH_NETWORKING:
+               SafeModeWithNetworking = TRUE;
+               BootLogging = TRUE;
                break;
        case SAFE_MODE_WITH_COMMAND_PROMPT:
+               SafeModeWithCommandPrompt = TRUE;
+               BootLogging = TRUE;
                break;
        //case SEPARATOR1:
        //      break;
        case ENABLE_BOOT_LOGGING:
+               BootLogging = TRUE;
                break;
        case ENABLE_VGA_MODE:
+               VgaMode = TRUE;
                break;
        case LAST_KNOWN_GOOD_CONFIGURATION:
+               LastKnownGoodConfiguration = TRUE;
                break;
        case DIRECTORY_SERVICES_RESTORE_MODE:
+               DirectoryServicesRepairMode = TRUE;
                break;
        case DEBUGGING_MODE:
+               DebuggingMode = TRUE;
                break;
        //case SEPARATOR2:
        //      break;
@@ -117,3 +137,29 @@ VOID DoOptionsMenu(VOID)
        }
 }
 
+VOID AppendBootTimeOptions(PCHAR BootOptions)
+{
+       if (SafeMode)
+               strcat(BootOptions, " /SAFEBOOT:MINIMAL /SOS"); //FIXME: NOGUIBOOT should also be specified
+
+       if (SafeModeWithNetworking)
+               strcat(BootOptions, " /SAFEBOOT:NETWORK /SOS"); //FIXME: NOGUIBOOT should also be specified
+
+       if (SafeModeWithCommandPrompt)
+               strcat(BootOptions, " /SAFEBOOT:MINIMAL(ALTERNATESHELL) /SOS"); //FIXME: NOGUIBOOT should also be specified
+
+       if (BootLogging)
+               strcat(BootOptions, " /BOOTLOG");
+
+       if (VgaMode)
+               strcat(BootOptions, " /BASEVIDEO");
+
+       if (LastKnownGoodConfiguration)
+               DbgPrint("Last known good configuration is not supported yet!\n");
+
+       if (DirectoryServicesRepairMode)
+               strcat(BootOptions, " /SAFEBOOT:DSREPAIR /SOS");
+
+       if (DebuggingMode)
+               strcat(BootOptions, " /DEBUG");
+}