ReactOS 0.4.16-dev-1109-gd06d9f3
options.c File Reference
#include <freeldr.h>
#include <debug.h>
Include dependency graph for options.c:

Go to the source code of this file.

Enumerations

enum  BootOption {
  NO_OPTION = 0 , SAFE_MODE , SAFE_MODE_WITH_NETWORKING , SAFE_MODE_WITH_COMMAND_PROMPT ,
  LAST_KNOWN_GOOD_CONFIGURATION , DIRECTORY_SERVICES_RESTORE_MODE
}
 

Functions

VOID DoOptionsMenu (IN OperatingSystemItem *OperatingSystem)
 
VOID DisplayBootTimeOptions (VOID)
 
VOID AppendBootTimeOptions (PCHAR BootOptions)
 

Variables

PCSTR OptionsMenuList []
 
const PCSTR FrldrDbgMsg
 
static enum BootOption BootOptionChoice = NO_OPTION
 
static BOOLEAN BootLogging = FALSE
 
static BOOLEAN VgaMode = FALSE
 
static BOOLEAN DebuggingMode = FALSE
 

Enumeration Type Documentation

◆ BootOption

Enumerator
NO_OPTION 
SAFE_MODE 
SAFE_MODE_WITH_NETWORKING 
SAFE_MODE_WITH_COMMAND_PROMPT 
LAST_KNOWN_GOOD_CONFIGURATION 
DIRECTORY_SERVICES_RESTORE_MODE 

Definition at line 73 of file options.c.

74{
75 NO_OPTION = 0,
76
80
83};
@ SAFE_MODE
Definition: options.c:77
@ DIRECTORY_SERVICES_RESTORE_MODE
Definition: options.c:82
@ SAFE_MODE_WITH_COMMAND_PROMPT
Definition: options.c:79
@ LAST_KNOWN_GOOD_CONFIGURATION
Definition: options.c:81
@ NO_OPTION
Definition: options.c:75
@ SAFE_MODE_WITH_NETWORKING
Definition: options.c:78

Function Documentation

◆ AppendBootTimeOptions()

VOID AppendBootTimeOptions ( PCHAR  BootOptions)

Definition at line 244 of file options.c.

245{
246 switch (BootOptionChoice)
247 {
248 case SAFE_MODE:
249 strcat(BootOptions, " /SAFEBOOT:MINIMAL /SOS /NOGUIBOOT");
250 break;
251
253 strcat(BootOptions, " /SAFEBOOT:NETWORK /SOS /NOGUIBOOT");
254 break;
255
257 strcat(BootOptions, " /SAFEBOOT:MINIMAL(ALTERNATESHELL) /SOS /NOGUIBOOT");
258 break;
259
261 DbgPrint("Last known good configuration is not supported yet!\n");
262 break;
263
265 strcat(BootOptions, " /SAFEBOOT:DSREPAIR /SOS");
266 break;
267
268 default:
269 break;
270 }
271
272 if (BootLogging)
273 strcat(BootOptions, " /BOOTLOG");
274
275 if (VgaMode)
276 strcat(BootOptions, " /BASEVIDEO");
277
278 if (DebuggingMode)
279 strcat(BootOptions, " /DEBUG");
280}
@ BootOptions
Definition: bl.h:898
static BOOLEAN DebuggingMode
Definition: options.c:88
static BOOLEAN VgaMode
Definition: options.c:87
static BOOLEAN BootLogging
Definition: options.c:86
static enum BootOption BootOptionChoice
Definition: options.c:85
#define DbgPrint
Definition: hal.h:12
strcat
Definition: string.h:92

Referenced by LoadAndBootWindows().

◆ DisplayBootTimeOptions()

VOID DisplayBootTimeOptions ( VOID  )

Definition at line 180 of file options.c.

181{
182 CHAR BootOptions[260];
183
184 switch (BootOptionChoice)
185 {
186 case SAFE_MODE:
188 break;
189
192 break;
193
196 break;
197
200 break;
201
204 break;
205
206 default:
208 break;
209 }
210
211 if (BootLogging)
212 {
213 if ( (BootOptionChoice != SAFE_MODE) &&
216 {
217 if (BootOptions[0] != ANSI_NULL)
218 strcat(BootOptions, ", ");
220 }
221 }
222
223 if (VgaMode)
224 {
225 if (BootOptions[0] != ANSI_NULL)
226 strcat(BootOptions, ", ");
228 }
229
230 if (DebuggingMode)
231 {
232 if (BootOptions[0] != ANSI_NULL)
233 strcat(BootOptions, ", ");
235 }
236
237 /* Display the chosen boot options */
238 UiDrawText(0,
239 UiGetScreenHeight() - 2,
242}
#define COLOR_LIGHTBLUE
Definition: ui.h:338
VOID UiDrawText(_In_ ULONG X, _In_ ULONG Y, _In_ PCSTR Text, _In_ UCHAR Attr)
Definition: ui.c:254
#define ATTR(cFore, cBack)
Definition: ui.h:323
UCHAR UiGetMenuBgColor(VOID)
Definition: ui.c:661
ULONG UiGetScreenHeight(VOID)
Definition: ui.c:655
PCSTR OptionsMenuList[]
Definition: options.c:27
#define ANSI_NULL
strcpy
Definition: string.h:131
char CHAR
Definition: xmlstorage.h:175

Referenced by MainBootMenuKeyPressFilter().

◆ DoOptionsMenu()

VOID DoOptionsMenu ( IN OperatingSystemItem OperatingSystem)

Definition at line 92 of file options.c.

93{
94 ULONG SelectedMenuItem;
95 CHAR DebugChannelString[100];
96
97 if (!UiDisplayMenu("Select an option:", NULL,
99 sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]),
100 11, // Use "Start ReactOS normally" as default; see the switch below.
101 -1,
102 &SelectedMenuItem,
103 TRUE,
104 NULL, NULL))
105 {
106 /* The user pressed ESC */
107 return;
108 }
109
110 /* Clear the backdrop */
112
113 switch (SelectedMenuItem)
114 {
115 case 0: // Safe Mode
118 break;
119 case 1: // Safe Mode with Networking
122 break;
123 case 2: // Safe Mode with Command Prompt
126 break;
127 // case 3: // Separator
128 // break;
129 case 4: // Enable Boot Logging
131 break;
132 case 5: // Enable VGA Mode
133 VgaMode = TRUE;
134 break;
135 case 6: // Last Known Good Configuration
137 break;
138 case 7: // Directory Services Restore Mode
140 break;
141 case 8: // Debugging Mode
143 break;
144 case 9: // FreeLdr debugging
145 DebugChannelString[0] = 0;
147 DebugChannelString,
148 sizeof(DebugChannelString) / sizeof(DebugChannelString[0])))
149 {
150 DbgParseDebugChannels(DebugChannelString);
151 }
152 break;
153 // case 10: // Separator
154 // break;
155 case 11: // Start ReactOS normally
156 // Reset all the parameters to their default values.
159 VgaMode = FALSE;
161 break;
162#ifdef HAS_OPTION_MENU_EDIT_CMDLINE
163 case 12: // Edit command line
164 EditOperatingSystemEntry(OperatingSystem);
165 break;
166#endif
167#ifdef HAS_OPTION_MENU_CUSTOM_BOOT
168 case 13: // Custom Boot
170 break;
171#endif
172#ifdef HAS_OPTION_MENU_REBOOT
173 case 14: // Reboot
175 break;
176#endif
177 }
178}
#define DbgParseDebugChannels(val)
Definition: debug.h:124
BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: ui.c:633
VOID UiDrawBackdrop(ULONG DrawHeight)
Definition: ui.c:233
BOOLEAN UiDisplayMenu(IN PCSTR MenuHeader, IN PCSTR MenuFooter OPTIONAL, IN PCSTR MenuItemList[], IN ULONG MenuItemCount, IN ULONG DefaultMenuItem, IN LONG MenuTimeOut, OUT PULONG SelectedMenuItem, IN BOOLEAN CanEscape, IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL, IN PVOID Context OPTIONAL)
Definition: ui.c:605
const PCSTR FrldrDbgMsg
Definition: options.c:57
VOID OptionMenuCustomBoot(VOID)
VOID OptionMenuReboot(VOID)
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
uint32_t ULONG
Definition: typedefs.h:59

Referenced by MainBootMenuKeyPressFilter().

Variable Documentation

◆ BootLogging

BOOLEAN BootLogging = FALSE
static

Definition at line 86 of file options.c.

Referenced by AppendBootTimeOptions(), DisplayBootTimeOptions(), and DoOptionsMenu().

◆ BootOptionChoice

enum BootOption BootOptionChoice = NO_OPTION
static

Definition at line 85 of file options.c.

Referenced by AppendBootTimeOptions(), DisplayBootTimeOptions(), and DoOptionsMenu().

◆ DebuggingMode

BOOLEAN DebuggingMode = FALSE
static

Definition at line 88 of file options.c.

Referenced by AppendBootTimeOptions(), DisplayBootTimeOptions(), and DoOptionsMenu().

◆ FrldrDbgMsg

const PCSTR FrldrDbgMsg
Initial value:
= "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 omitted all levels\n"
" are enabled for the specified channel\n"
"# can be either + or -\n"
"channel can be one of the following:\n"
" all,warning,memory,filesystem,inifile,ui,disk,cache,registry,\n"
" reactos,linux,hwdetect,windows,peloader,scsiport,heap\n"
"Examples:\n"
" trace+windows,trace+reactos\n"
" +hwdetect,err-disk\n"
" +peloader\n"
"NOTE: all letters must be lowercase, no spaces allowed."

Definition at line 57 of file options.c.

Referenced by DoOptionsMenu().

◆ OptionsMenuList

PCSTR OptionsMenuList[]
Initial value:
=
{
"Safe Mode",
"Safe Mode with Networking",
"Safe Mode with Command Prompt",
"Enable Boot Logging",
"Enable VGA Mode",
"Last Known Good Configuration",
"Directory Services Restore Mode",
"Debugging Mode",
"FreeLdr debugging",
"Start ReactOS normally",
}

Definition at line 27 of file options.c.

Referenced by DisplayBootTimeOptions(), and DoOptionsMenu().

◆ VgaMode