49{
56 PCHAR TitleStart, TitleEnd;
60 CHAR SettingName[260];
61 CHAR SettingValue[260];
64
65
68
69
71
72
74 if (!Items)
76
77
79
80
82 {
84 SettingName, sizeof(SettingName),
85 SettingValue, sizeof(SettingValue));
86 if (!*SettingName)
87 {
88 ERR(
"Invalid OS entry %lu, skipping.\n",
i);
89 continue;
90 }
91
92
93 TitleStart = SettingValue;
94
95 while (*TitleStart == ' ' || *TitleStart == '\t' || *TitleStart == '"')
96 ++TitleStart;
97 TitleEnd = TitleStart;
98
99 while (*TitleEnd !=
ANSI_NULL && *TitleEnd !=
'"')
100 ++TitleEnd;
101
102
103 if (*TitleEnd)
105
106
107 if (*TitleEnd)
108 {
109
110 while (*TitleEnd == ' ' || *TitleEnd == '\t' || *TitleEnd == '"')
111 ++TitleEnd;
112 }
113 OsLoadOptions = (*TitleEnd ? TitleEnd :
NULL);
114
115
116
117
118
119
120
121
122 if (DefaultOSName &&
_stricmp(DefaultOSName, SettingName) == 0)
123 {
125 DefaultOSName =
NULL;
126 }
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151 SectionId = 0;
153 if (HadSection)
154 {
155
157 }
158 else
159 {
160
162 }
163
164
165 HadNoBootType = (*BootType ==
ANSI_NULL);
166 if (HadNoBootType)
167 {
168#ifdef _M_IX86
171 {
173 strcpy(BootType,
"BootSector");
174 }
175 else
176#endif
177 {
178 strcpy(BootType,
"Windows");
179 }
180 }
181
182
183 if (!HadSection)
184 {
186
187
189
190
192 if (
_stricmp(BootType,
"BootSector") == 0)
193 {
195 "BootSectorFile%u%u%u%u%u%u",
198 }
199 else if (
_stricmp(BootType,
"Windows") == 0)
200 {
202 "Windows%u%u%u%u%u%u",
205 }
206 else
207 {
209 }
210
211
213 {
214 ERR(
"Could not convert legacy OS entry %lu, skipping.\n",
i);
215 continue;
216 }
217
218
219 if (
_stricmp(BootType,
"BootSector") == 0)
220 {
222 {
223 ERR(
"Could not convert legacy OS entry %lu, skipping.\n",
i);
224 continue;
225 }
226 }
227 else if (
_stricmp(BootType,
"Windows") == 0)
228 {
230 {
231 ERR(
"Could not convert legacy OS entry %lu, skipping.\n",
i);
232 continue;
233 }
234 }
235 else
236 {
238 }
239
240
242 {
243 ERR(
"Could not convert legacy OS entry %lu, skipping.\n",
i);
244 continue;
245 }
246 }
247
248
250 {
251 ERR(
"Could not fixup the BootType entry for OS '%s', ignoring.\n", SettingName);
252 }
253
254
255
256
257
258 if (HadSection && OsLoadOptions && *OsLoadOptions)
259 {
260
263 TRACE(
"No 'Options' value found for OS '%s', ignoring.\n", SettingName);
264
265
268
269
271 ERR(
"Could not modify the options for OS '%s', ignoring.\n", SettingName);
272 }
273
274
277
278
279 }
280
281
282 *OperatingSystemCount =
Count;
283 *DefaultOperatingSystem = DefaultOS;
284 return Items;
285}
char * strcpy(char *DstString, const char *SrcString)
TIMEINFO * ArcGetTime(VOID)
ARC_STATUS ArcOpen(CHAR *Path, OPENMODE OpenMode, ULONG *FileId)
ARC_STATUS ArcClose(_In_ ULONG FileId)
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
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
PINI_SECTION IniAddSection(_In_ PINICACHE Cache, _In_ PCWSTR Name)
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)