ReactOS  0.4.14-dev-114-gc8cbd56
custom.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define HAS_OPTION_MENU_EDIT_CMDLINE
 
#define HAS_OPTION_MENU_CUSTOM_BOOT
 
#define HAS_OPTION_MENU_REBOOT
 

Functions

VOID OptionMenuCustomBoot (VOID)
 
VOID EditCustomBootReactOS (IN OUT OperatingSystemItem *OperatingSystem, IN BOOLEAN IsSetup)
 
VOID OptionMenuReboot (VOID)
 

Macro Definition Documentation

◆ HAS_OPTION_MENU_CUSTOM_BOOT

#define HAS_OPTION_MENU_CUSTOM_BOOT

Definition at line 23 of file custom.h.

◆ HAS_OPTION_MENU_EDIT_CMDLINE

#define HAS_OPTION_MENU_EDIT_CMDLINE

Definition at line 22 of file custom.h.

◆ HAS_OPTION_MENU_REBOOT

#define HAS_OPTION_MENU_REBOOT

Definition at line 24 of file custom.h.

Function Documentation

◆ EditCustomBootReactOS()

VOID EditCustomBootReactOS ( IN OUT OperatingSystemItem OperatingSystem,
IN BOOLEAN  IsSetup 
)

Definition at line 618 of file custom.c.

621 {
622  TIMEINFO* TimeInfo;
623  ULONG_PTR SectionId = OperatingSystem->SectionId;
624  CHAR SectionName[100];
625  CHAR BootDriveString[20];
626  CHAR BootPartitionString[20];
627  CHAR ReactOSSystemPath[200];
628  CHAR ReactOSARCPath[200];
629  CHAR ReactOSOptions[200];
630 
631  RtlZeroMemory(SectionName, sizeof(SectionName));
632  RtlZeroMemory(BootDriveString, sizeof(BootDriveString));
633  RtlZeroMemory(BootPartitionString, sizeof(BootPartitionString));
634  RtlZeroMemory(ReactOSSystemPath, sizeof(ReactOSSystemPath));
635  RtlZeroMemory(ReactOSARCPath, sizeof(ReactOSARCPath));
636  RtlZeroMemory(ReactOSOptions, sizeof(ReactOSOptions));
637 
638  if (SectionId != 0)
639  {
640  /* Load the settings */
641  IniReadSettingByName(SectionId, "SystemPath", ReactOSARCPath, sizeof(ReactOSARCPath));
642  IniReadSettingByName(SectionId, "Options", ReactOSOptions, sizeof(ReactOSOptions));
643  }
644 
645  if (SectionId == 0)
646  {
647  if (!UiEditBox(BootDrivePrompt, BootDriveString, sizeof(BootDriveString)))
648  return;
649 
650  if (!UiEditBox(BootPartitionPrompt, BootPartitionString, sizeof(BootPartitionString)))
651  return;
652 
653  if (!UiEditBox(ReactOSSystemPathPrompt, ReactOSSystemPath, sizeof(ReactOSSystemPath)))
654  return;
655  }
656  else
657  {
658  if (!UiEditBox(ReactOSSystemPathPrompt, ReactOSARCPath, sizeof(ReactOSARCPath)))
659  return;
660  }
661 
662  if (!UiEditBox(ReactOSOptionsPrompt, ReactOSOptions, sizeof(ReactOSOptions)))
663  return;
664 
665  /* Modify the settings values and return if we were in edit mode */
666  if (SectionId != 0)
667  {
668  IniModifySettingValue(SectionId, "SystemPath", ReactOSARCPath);
669  IniModifySettingValue(SectionId, "Options", ReactOSOptions);
670  return;
671  }
672 
673  /* Generate a unique section name */
674  TimeInfo = ArcGetTime();
675  RtlStringCbPrintfA(SectionName, sizeof(SectionName),
676  "CustomReactOS%u%u%u%u%u%u",
677  TimeInfo->Year, TimeInfo->Day, TimeInfo->Month,
678  TimeInfo->Hour, TimeInfo->Minute, TimeInfo->Second);
679 
680  /* Add the section */
681  if (!IniAddSection(SectionName, &SectionId))
682  return;
683 
684  /* Add the BootType */
685  if (!IniAddSettingValueToSection(SectionId, "BootType", IsSetup ? "ReactOSSetup" : "Windows2003"))
686  return;
687 
688  /* Construct the ReactOS ARC system path */
689  ConstructArcPath(ReactOSARCPath, ReactOSSystemPath, DriveMapGetBiosDriveNumber(BootDriveString), atoi(BootPartitionString));
690 
691  /* Add the system path */
692  if (!IniAddSettingValueToSection(SectionId, "SystemPath", ReactOSARCPath))
693  return;
694 
695  /* Add the CommandLine */
696  if (!IniAddSettingValueToSection(SectionId, "Options", ReactOSOptions))
697  return;
698 
699  OperatingSystem->SectionId = SectionId;
700  OperatingSystem->LoadIdentifier = NULL;
701 }
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
USHORT Minute
Definition: fw.h:15
Definition: fw.h:9
BOOLEAN IniModifySettingValue(ULONG_PTR SectionId, PCSTR SettingName, PCSTR SettingValue)
Definition: inifile.c:293
smooth NULL
Definition: ftsmooth.c:416
const CHAR ReactOSSystemPathPrompt[]
Definition: custom.c:38
TIMEINFO * ArcGetTime(VOID)
Definition: arcemul.c:27
VOID ConstructArcPath(PCHAR ArcPath, PCHAR SystemFolder, UCHAR Disk, ULONG Partition)
Definition: arcname.c:175
NTSTRSAFEVAPI RtlStringCbPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
Definition: ntstrsafe.h:1148
BOOLEAN IniReadSettingByName(ULONG_PTR SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize)
Definition: inifile.c:147
BOOLEAN IniAddSettingValueToSection(ULONG_PTR SectionId, PCSTR SettingName, PCSTR SettingValue)
Definition: inifile.c:252
USHORT Year
Definition: fw.h:11
USHORT Hour
Definition: fw.h:14
#define DriveMapGetBiosDriveNumber(DeviceName)
Definition: hardware.h:35
BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: ui.c:492
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
USHORT Day
Definition: fw.h:13
const CHAR BootPartitionPrompt[]
Definition: custom.c:36
const CHAR ReactOSOptionsPrompt[]
Definition: custom.c:39
BOOLEAN IniAddSection(PCSTR SectionName, ULONG_PTR *SectionId)
Definition: inifile.c:179

Referenced by EditCustomBootNTOS(), and EditCustomBootReactOSSetup().

◆ OptionMenuCustomBoot()

VOID OptionMenuCustomBoot ( VOID  )

Referenced by DoOptionsMenu().

◆ OptionMenuReboot()

VOID OptionMenuReboot ( VOID  )

Referenced by DoOptionsMenu().