ReactOS 0.4.16-dev-736-g28b802b
settings.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _BOOTMGRINFO
 

Typedefs

typedef struct _BOOTMGRINFO BOOTMGRINFO
 
typedef struct _BOOTMGRINFOPBOOTMGRINFO
 

Functions

PBOOTMGRINFO GetBootMgrInfo (VOID)
 
VOID LoadSettings (_In_opt_ PCSTR CmdLine)
 

Variables

BOOTMGRINFO BootMgrInfo
 

Typedef Documentation

◆ BOOTMGRINFO

◆ PBOOTMGRINFO

Function Documentation

◆ GetBootMgrInfo()

PBOOTMGRINFO GetBootMgrInfo ( VOID  )

Definition at line 191 of file settings.c.

192{
193 return &BootMgrInfo;
194}
BOOTMGRINFO BootMgrInfo
Definition: settings.c:18

Referenced by InitOperatingSystemList(), MainBootMenuKeyPressFilter(), and RunLoader().

◆ LoadSettings()

VOID LoadSettings ( _In_opt_ PCSTR  CmdLine)

Definition at line 113 of file settings.c.

115{
116 /* Pre-initialization: The settings originate from the command-line.
117 * Main initialization: Overwrite them if needed with those from freeldr.ini */
118 if (CmdLine)
119 {
121 return;
122 }
124 {
125 // ERR("LoadSettings() called but no freeldr.ini\n");
126 return;
127 }
128
129 BOOLEAN FoundLoaderSection = FALSE;
130 PCSTR LoaderSections[] = {
131 "FreeLoader",
132 "Boot Loader",
133 "FlexBoot",
134 "MultiBoot",
135 };
136
137 /* Search for the first section in LoaderSections and load the settings,
138 * prioritizing the order in the file.
139 * If a section is already loaded, skip further checks. */
141 {
142 for (ULONG i = 0; i < sizeof(LoaderSections) / sizeof(LoaderSections[0]); i++)
143 {
144 PCSTR Section = LoaderSections[i];
145
147 {
148 FoundLoaderSection = TRUE;
149 break;
150 }
151 }
152
153 if (!FoundLoaderSection)
154 {
155 UiMessageBoxCritical("Bootloader Section not found in freeldr.ini");
156 return;
157 }
158 }
159
160 /* Get the debug string. Always override it with the one from freeldr.ini */
162 DebugString, sizeof(DebugString)))
163 {
165 }
166
167 /* Get the timeout. Keep the existing one if it is valid,
168 * otherwise retrieve it from freeldr.ini */
169 if (BootMgrInfo.TimeOut < 0)
170 {
171 CHAR TimeOutText[20];
172 BootMgrInfo.TimeOut = -1;
174 TimeOutText, sizeof(TimeOutText)))
175 {
176 BootMgrInfo.TimeOut = atoi(TimeOutText);
177 }
178 }
179
180 /* Get the default OS */
182 {
184 DefaultOs, sizeof(DefaultOs)))
185 {
187 }
188 }
189}
unsigned char BOOLEAN
VOID UiMessageBoxCritical(_In_ PCSTR MessageText)
Definition: ui.c:372
static CCHAR DebugString[256]
Definition: settings.c:16
static VOID CmdLineParse(_In_ PCSTR CmdLine)
Definition: settings.c:23
static CCHAR DefaultOs[256]
Definition: settings.c:17
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static const WCHAR CmdLine[]
Definition: install.c:48
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
BOOLEAN IniReadSettingByName(ULONG_PTR SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize)
Definition: inifile.c:154
BOOLEAN IniOpenSection(PCSTR SectionName, ULONG_PTR *SectionId)
Definition: inifile.c:30
PLIST_ENTRY IniGetFileSectionListHead(VOID)
Definition: inifile.c:25
PCSTR DefaultOs
Definition: settings.h:13
LONG TimeOut
Definition: settings.h:14
PCSTR DebugString
Definition: settings.h:12
ULONG_PTR FrLdrSection
Definition: settings.h:15
const char * PCSTR
Definition: typedefs.h:52
uint32_t ULONG
Definition: typedefs.h:59
char CHAR
Definition: xmlstorage.h:175

Variable Documentation

◆ BootMgrInfo

BOOTMGRINFO BootMgrInfo
extern

Definition at line 18 of file settings.c.

Referenced by BootMain(), CmdLineParse(), EfiEntry(), GetBootMgrInfo(), and LoadSettings().