50{
53 CHAR DefaultOSText[80];
54
59 PCHAR TitleStart, TitleEnd;
63 CHAR SettingName[260];
64 CHAR SettingValue[260];
66 CHAR TempBuffer[
sizeof(SettingValue)/
sizeof(
CHAR)];
67
68
71
72
74
75
77 if (!Items)
79
80
82 if (!DefaultOSName || !*DefaultOSName)
83 {
84 if ((FrLdrSectionId != 0) &&
86 {
87 DefaultOSName = DefaultOSText;
88 }
89 }
90
91
93 {
95 SettingName, sizeof(SettingName),
96 SettingValue, sizeof(SettingValue));
97 if (!*SettingName)
98 {
99 ERR(
"Invalid OS entry %lu, skipping.\n",
i);
100 continue;
101 }
102
103
104 TitleStart = SettingValue;
105
106 while (*TitleStart == ' ' || *TitleStart == '\t' || *TitleStart == '"')
107 ++TitleStart;
108 TitleEnd = TitleStart;
109
110 while (*TitleEnd !=
ANSI_NULL && *TitleEnd !=
'"')
111 ++TitleEnd;
112
113
114 if (*TitleEnd)
116
117
118 if (*TitleEnd)
119 {
120
121 while (*TitleEnd == ' ' || *TitleEnd == '\t' || *TitleEnd == '"')
122 ++TitleEnd;
123 }
124 OsLoadOptions = (*TitleEnd ? TitleEnd :
NULL);
125
126
127
128
129
130
131
132
133 if (DefaultOSName &&
_stricmp(DefaultOSName, SettingName) == 0)
134 {
136 DefaultOSName =
NULL;
137 }
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162 SectionId = 0;
164 if (HadSection)
165 {
166
168 }
169 else
170 {
171
173 }
174
175
177 if (HadNoBootType)
178 {
179#ifdef _M_IX86
182 {
185 }
186 else
187#endif
188 {
190 }
191 }
192
193
194 if (!HadSection)
195 {
197
198
200
201
204 {
206 "BootSectorFile%u%u%u%u%u%u",
209 }
211 {
213 "Windows%u%u%u%u%u%u",
216 }
217 else
218 {
220 }
221
222
224 {
225 ERR(
"Could not convert legacy OS entry %lu, skipping.\n",
i);
226 continue;
227 }
228
229
231 {
233 {
234 ERR(
"Could not convert legacy OS entry %lu, skipping.\n",
i);
235 continue;
236 }
237 }
239 {
241 {
242 ERR(
"Could not convert legacy OS entry %lu, skipping.\n",
i);
243 continue;
244 }
245 }
246 else
247 {
249 }
250
251
253 {
254 ERR(
"Could not convert legacy OS entry %lu, skipping.\n",
i);
255 continue;
256 }
257 }
258
259
261 {
262 ERR(
"Could not fixup the BootType entry for OS '%s', ignoring.\n", SettingName);
263 }
264
265
266
267
268
269 if (HadSection && OsLoadOptions && *OsLoadOptions)
270 {
271
274 TRACE(
"No 'Options' value found for OS '%s', ignoring.\n", SettingName);
275
276
279
280
282 ERR(
"Could not modify the options for OS '%s', ignoring.\n", SettingName);
283 }
284
285
288
289
290 }
291
292
293 *OperatingSystemCount =
Count;
294 *DefaultOperatingSystem = DefaultOS;
295 return Items;
296}
char * strcpy(char *DstString, const char *SrcString)
TIMEINFO * ArcGetTime(VOID)
ARC_STATUS ArcClose(ULONG FileId)
ARC_STATUS ArcOpen(CHAR *Path, OPENMODE OpenMode, ULONG *FileId)
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
PCSTR CmdLineGetDefaultOS(VOID)
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
BOOLEAN IniAddSection(PCSTR SectionName, ULONG_PTR *SectionId)
ULONG IniGetNumSectionItems(ULONG_PTR SectionId)
BOOLEAN IniAddSettingValueToSection(ULONG_PTR SectionId, PCSTR SettingName, PCSTR SettingValue)
BOOLEAN IniModifySettingValue(ULONG_PTR SectionId, PCSTR SettingName, PCSTR SettingValue)
BOOLEAN IniReadSettingByNumber(ULONG_PTR SectionId, ULONG SettingNumber, PCHAR SettingName, ULONG NameSize, PCHAR SettingValue, ULONG ValueSize)
BOOLEAN IniReadSettingByName(ULONG_PTR SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize)
BOOLEAN IniOpenSection(PCSTR SectionName, ULONG_PTR *SectionId)
NTSTRSAFEAPI RtlStringCbCatA(_Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
NTSTRSAFEVAPI RtlStringCbPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
NTSTRSAFEAPI RtlStringCbCopyA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
static PCSTR CopyString(PCSTR Source)