ReactOS 0.4.16-dev-2613-g9533ad7
options.c
Go to the documentation of this file.
1/*
2 * PROJECT: FreeLoader
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: FreeLoader Setup and Configuration F2 menu.
5 * COPYRIGHT: Copyright 1998-2003 Brian Palmer <brianp@sginet.com>
6 * Copyright 2012 Giannis Adamopoulos <gadamopoulos@reactos.org>
7 * Copyright 2022-2026 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
8 */
9
10/* INCLUDES *******************************************************************/
11
12#include <freeldr.h>
13#include <debug.h> // For DbgParseDebugChannels()
14
15/* GLOBALS ********************************************************************/
16
18{
19 "FreeLdr debugging",
20
21 NULL,
22
23#ifdef HAS_OPTION_MENU_EDIT_CMDLINE
24 "Edit Boot Command Line (F10)",
25#endif
26#ifdef HAS_OPTION_MENU_CUSTOM_BOOT
27 "Custom Boot",
28#endif
29#ifdef HAS_OPTION_MENU_REBOOT
30 "Reboot",
31#endif
32};
33
35 "Enable FreeLdr debug channels\n"
36 "Acceptable syntax: [level1]#channel1[,[level2]#channel2]\n"
37 "level can be one of: trace,warn,fixme,err\n"
38 " if the level is omitted all levels\n"
39 " are enabled for the specified channel\n"
40 "# can be either + or -\n"
41 "channel can be one of the following:\n"
42 " all,warning,memory,filesystem,inifile,ui,disk,cache,registry,\n"
43 " reactos,linux,hwdetect,windows,peloader,scsiport,heap\n"
44 "Examples:\n"
45 " trace+windows,trace+reactos\n"
46 " +hwdetect,err-disk\n"
47 " +peloader\n"
48 "NOTE: all letters must be lowercase, no spaces allowed.";
49
50/* FUNCTIONS ******************************************************************/
51
52VOID
54 _In_opt_ OperatingSystemItem* OperatingSystem)
55{
56 ULONG SelectedMenuItem = 0;
57
58doMenu:
59 /* Clear the backdrop */
61
62 if (!UiDisplayMenu(VERSION " Setup and Configuration",
63 OperatingSystem ? NULL : "Press ESC to reboot.",
66 SelectedMenuItem, -1,
67 &SelectedMenuItem,
68 TRUE,
69 NULL, NULL))
70 {
71 /* The user pressed ESC */
72 return;
73 }
74
75 switch (SelectedMenuItem)
76 {
77 case 0: // FreeLdr debugging
78 {
79 CHAR DebugChannelString[100] = "";
80 // DebugChannelString[0] = ANSI_NULL;
82 DebugChannelString,
83 RTL_NUMBER_OF(DebugChannelString)))
84 {
85 DbgParseDebugChannels(DebugChannelString);
86 }
87 break;
88 }
89 // case 1: // Separator
90 // break;
91#ifdef HAS_OPTION_MENU_EDIT_CMDLINE
92 case 2: // Edit command line
93 if (OperatingSystem)
94 EditOperatingSystemEntry(OperatingSystem);
95 break;
96#endif
97#ifdef HAS_OPTION_MENU_CUSTOM_BOOT
98 case 3: // Custom Boot
100 break;
101#endif
102#ifdef HAS_OPTION_MENU_REBOOT
103 case 4: // Reboot
105 break;
106#endif
107 }
108 goto doMenu;
109}
110
111/*
112 * Display selected human-readable boot-option descriptions at the bottom of the screen.
113 */
114VOID
116 _In_ OperatingSystemItem* OperatingSystem)
117{
118 if (!OperatingSystem->AdvBootOptsDesc[0])
119 return;
120
121 /* Display the chosen boot options */
122 UiDrawText(0,
123 UiGetScreenHeight() - 2,
124 OperatingSystem->AdvBootOptsDesc,
126}
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define VERSION
Definition: rdesktop.h:45
#define DbgParseDebugChannels(val)
Definition: debug.h:124
BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: ui.c:633
#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
VOID UiDrawBackdrop(ULONG DrawHeight)
Definition: ui.c:233
#define ATTR(cFore, cBack)
Definition: ui.h:323
UCHAR UiGetMenuBgColor(VOID)
Definition: ui.c:661
ULONG UiGetScreenHeight(VOID)
Definition: ui.c:655
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
VOID FreeLdrSetupMenu(_In_opt_ OperatingSystemItem *OperatingSystem)
Definition: options.c:53
static PCSTR FrldrDbgMsg
Definition: options.c:34
static PCSTR OptionsMenuList[]
Definition: options.c:17
VOID DisplayBootTimeOptions(_In_ OperatingSystemItem *OperatingSystem)
Definition: options.c:115
VOID OptionMenuCustomBoot(VOID)
VOID OptionMenuReboot(VOID)
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
char CHAR
Definition: pedump.c:57
const char * PCSTR
Definition: typedefs.h:52
uint32_t ULONG
Definition: typedefs.h:59