ad32798deca8d0111fb7e91e993f73cb601f786c
[reactos.git] / reactos / boot / freeldr / freeldr / options.c
1 /*
2 * FreeLoader
3 * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
4 *
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.
9 *
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.
14 *
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.
18 */
19
20 #include <freeldr.h>
21
22 PCSTR OptionsMenuList[] =
23 {
24 "Safe Mode",
25 "Safe Mode with Networking",
26 "Safe Mode with Command Prompt",
27
28 "SEPARATOR",
29
30 "Enable Boot Logging",
31 "Enable VGA Mode",
32 "Last Known Good Configuration",
33 "Directory Services Restore Mode",
34 "Debugging Mode",
35
36 "SEPARATOR",
37
38 "Custom Boot",
39 "Reboot",
40 };
41
42 enum OptionMenuItems
43 {
44 SAFE_MODE = 0,
45 SAFE_MODE_WITH_NETWORKING = 1,
46 SAFE_MODE_WITH_COMMAND_PROMPT = 2,
47
48 SEPARATOR1 = 3,
49
50 ENABLE_BOOT_LOGGING = 4,
51 ENABLE_VGA_MODE = 5,
52 LAST_KNOWN_GOOD_CONFIGURATION = 6,
53 DIRECTORY_SERVICES_RESTORE_MODE = 7,
54 DEBUGGING_MODE = 8,
55
56 SEPARATOR2 = 9,
57
58 CUSTOM_BOOT = 10,
59 REBOOT = 11,
60 };
61
62 ULONG OptionsMenuItemCount = sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]);
63
64 VOID DoOptionsMenu(VOID)
65 {
66 ULONG SelectedMenuItem;
67
68 if (!UiDisplayMenu(OptionsMenuList, OptionsMenuItemCount, 0, -1, &SelectedMenuItem, TRUE, NULL))
69 {
70 // The user pressed ESC
71 return;
72 }
73
74 // Clear the backdrop
75 UiDrawBackdrop();
76
77 switch (SelectedMenuItem)
78 {
79 case SAFE_MODE:
80 break;
81 case SAFE_MODE_WITH_NETWORKING:
82 break;
83 case SAFE_MODE_WITH_COMMAND_PROMPT:
84 break;
85 //case SEPARATOR1:
86 // break;
87 case ENABLE_BOOT_LOGGING:
88 break;
89 case ENABLE_VGA_MODE:
90 break;
91 case LAST_KNOWN_GOOD_CONFIGURATION:
92 break;
93 case DIRECTORY_SERVICES_RESTORE_MODE:
94 break;
95 case DEBUGGING_MODE:
96 break;
97 //case SEPARATOR2:
98 // break;
99 case CUSTOM_BOOT:
100 OptionMenuCustomBoot();
101 break;
102 case REBOOT:
103 OptionMenuReboot();
104 break;
105 }
106 }
107
108 VOID OptionMenuReboot(VOID)
109 {
110 UiMessageBox("The system will now reboot.");
111
112 #ifdef __i386__
113 DiskStopFloppyMotor();
114 SoftReboot();
115 #else
116 #endif
117 }