ReactOS  0.4.13-dev-39-g8b6696f
custom.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

VOID OptionMenuCustomBootReactOS (VOID)
 

Function Documentation

◆ OptionMenuCustomBootReactOS()

VOID OptionMenuCustomBootReactOS ( VOID  )

Definition at line 323 of file custom.c.

324 {
325  ULONG_PTR SectionId;
326  CHAR SectionName[100];
327  CHAR BootDriveString[20];
328  CHAR BootPartitionString[20];
329  CHAR ReactOSSystemPath[200];
330  CHAR ReactOSARCPath[200];
331  CHAR ReactOSOptions[200];
332  TIMEINFO* TimeInfo;
333  OperatingSystemItem OperatingSystem;
334 
335  RtlZeroMemory(SectionName, sizeof(SectionName));
336  RtlZeroMemory(BootDriveString, sizeof(BootDriveString));
337  RtlZeroMemory(BootPartitionString, sizeof(BootPartitionString));
338  RtlZeroMemory(ReactOSSystemPath, sizeof(ReactOSSystemPath));
339  RtlZeroMemory(ReactOSOptions, sizeof(ReactOSOptions));
340 
341  if (!UiEditBox(BootDrivePrompt, BootDriveString, 20))
342  return;
343 
344  if (!UiEditBox(BootPartitionPrompt, BootPartitionString, 20))
345  return;
346 
347  if (!UiEditBox(ReactOSSystemPathPrompt, ReactOSSystemPath, 200))
348  return;
349 
350  if (!UiEditBox(ReactOSOptionsPrompt, ReactOSOptions, 200))
351  return;
352 
353  /* Generate a unique section name */
354  TimeInfo = ArcGetTime();
355  sprintf(SectionName, "CustomReactOS%u%u%u%u%u%u", TimeInfo->Year, TimeInfo->Day, TimeInfo->Month, TimeInfo->Hour, TimeInfo->Minute, TimeInfo->Second);
356 
357  /* Add the section */
358  if (!IniAddSection(SectionName, &SectionId))
359  return;
360 
361  /* Add the BootType */
362  if (!IniAddSettingValueToSection(SectionId, "BootType", "Windows2003"))
363  return;
364 
365  /* Construct the ReactOS ARC system path */
366  ConstructArcPath(ReactOSARCPath, ReactOSSystemPath, DriveMapGetBiosDriveNumber(BootDriveString), atoi(BootPartitionString));
367 
368  /* Add the system path */
369  if (!IniAddSettingValueToSection(SectionId, "SystemPath", ReactOSARCPath))
370  return;
371 
372  /* Add the CommandLine */
373  if (!IniAddSettingValueToSection(SectionId, "Options", ReactOSOptions))
374  return;
375 
377 
378  OperatingSystem.SystemPartition = SectionName;
379  OperatingSystem.LoadIdentifier = NULL;
380  OperatingSystem.OsLoadOptions = NULL; // ReactOSOptions
381 
382  // LoadAndBootWindows(&OperatingSystem, _WIN32_WINNT_WS03);
383  LoadOperatingSystem(&OperatingSystem);
384 }
char CHAR
Definition: xmlstorage.h:175
const CHAR BootDrivePrompt[]
Definition: custom.c:35
USHORT Second
Definition: fw.h:16
USHORT Month
Definition: fw.h:12
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define sprintf(buf, format,...)
Definition: sprintf.c:55
USHORT Minute
Definition: fw.h:15
Definition: fw.h:9
VOID UiMessageBox(PCSTR Format,...)
Definition: ui.c:347
smooth NULL
Definition: ftsmooth.c:416
const CHAR ReactOSSystemPathPrompt[]
Definition: custom.c:37
VOID ConstructArcPath(PCHAR ArcPath, PCHAR SystemFolder, UCHAR Disk, ULONG Partition)
Definition: arcname.c:157
BOOLEAN IniAddSettingValueToSection(ULONG_PTR SectionId, PCSTR SettingName, PCSTR SettingValue)
Definition: inifile.c:252
USHORT Year
Definition: fw.h:11
TIMEINFO * ArcGetTime(VOID)
Definition: machine.c:27
const CHAR CustomBootPrompt[]
Definition: custom.c:39
USHORT Hour
Definition: fw.h:14
#define DriveMapGetBiosDriveNumber(DeviceName)
Definition: hardware.h:35
BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: ui.c:474
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
VOID LoadOperatingSystem(IN OperatingSystemItem *OperatingSystem)
Definition: bootmgr.c:56
USHORT Day
Definition: fw.h:13
const CHAR BootPartitionPrompt[]
Definition: custom.c:36
const CHAR ReactOSOptionsPrompt[]
Definition: custom.c:38
BOOLEAN IniAddSection(PCSTR SectionName, ULONG_PTR *SectionId)
Definition: inifile.c:179

Referenced by OptionMenuCustomBoot().