3 * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 PCSTR OptionsMenuList
[] =
25 "Safe Mode with Networking",
26 "Safe Mode with Command Prompt",
30 "Enable Boot Logging",
32 "Last Known Good Configuration",
33 "Directory Services Restore Mode",
38 #ifdef HAS_OPTION_MENU_CUSTOM_BOOT
41 #ifdef HAS_OPTION_MENU_REBOOT
49 SAFE_MODE_WITH_NETWORKING
= 1,
50 SAFE_MODE_WITH_COMMAND_PROMPT
= 2,
54 ENABLE_BOOT_LOGGING
= 4,
56 LAST_KNOWN_GOOD_CONFIGURATION
= 6,
57 DIRECTORY_SERVICES_RESTORE_MODE
= 7,
62 #ifdef HAS_OPTION_MENU_CUSTOM_BOOT
65 #ifdef HAS_OPTION_MENU_REBOOT
70 ULONG OptionsMenuItemCount
= sizeof(OptionsMenuList
) / sizeof(OptionsMenuList
[0]);
72 BOOLEAN SafeMode
= FALSE
;
73 BOOLEAN SafeModeWithNetworking
= FALSE
;
74 BOOLEAN SafeModeWithCommandPrompt
= FALSE
;
75 BOOLEAN BootLogging
= FALSE
;
76 BOOLEAN VgaMode
= FALSE
;
77 BOOLEAN LastKnownGoodConfiguration
= FALSE
;
78 BOOLEAN DirectoryServicesRepairMode
= FALSE
;
79 BOOLEAN DebuggingMode
= FALSE
;
81 VOID
DoOptionsMenu(VOID
)
83 ULONG SelectedMenuItem
;
85 if (!UiDisplayMenu(OptionsMenuList
, OptionsMenuItemCount
, 0, -1, &SelectedMenuItem
, TRUE
, NULL
))
87 // The user pressed ESC
94 switch (SelectedMenuItem
)
100 case SAFE_MODE_WITH_NETWORKING
:
101 SafeModeWithNetworking
= TRUE
;
104 case SAFE_MODE_WITH_COMMAND_PROMPT
:
105 SafeModeWithCommandPrompt
= TRUE
;
110 case ENABLE_BOOT_LOGGING
:
113 case ENABLE_VGA_MODE
:
116 case LAST_KNOWN_GOOD_CONFIGURATION
:
117 LastKnownGoodConfiguration
= TRUE
;
119 case DIRECTORY_SERVICES_RESTORE_MODE
:
120 DirectoryServicesRepairMode
= TRUE
;
123 DebuggingMode
= TRUE
;
127 #ifdef HAS_OPTION_MENU_CUSTOM_BOOT
129 OptionMenuCustomBoot();
132 #ifdef HAS_OPTION_MENU_REBOOT
140 VOID
AppendBootTimeOptions(PCHAR BootOptions
)
143 strcat(BootOptions
, " /SAFEBOOT:MINIMAL /SOS"); //FIXME: NOGUIBOOT should also be specified
145 if (SafeModeWithNetworking
)
146 strcat(BootOptions
, " /SAFEBOOT:NETWORK /SOS"); //FIXME: NOGUIBOOT should also be specified
148 if (SafeModeWithCommandPrompt
)
149 strcat(BootOptions
, " /SAFEBOOT:MINIMAL(ALTERNATESHELL) /SOS"); //FIXME: NOGUIBOOT should also be specified
152 strcat(BootOptions
, " /BOOTLOG");
155 strcat(BootOptions
, " /BASEVIDEO");
157 if (LastKnownGoodConfiguration
)
158 DbgPrint("Last known good configuration is not supported yet!\n");
160 if (DirectoryServicesRepairMode
)
161 strcat(BootOptions
, " /SAFEBOOT:DSREPAIR /SOS");
164 strcat(BootOptions
, " /DEBUG");