ReactOS 0.4.16-dev-289-g096a551
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 486 of file custom.c.

489{
490 TIMEINFO* TimeInfo;
491 ULONG_PTR SectionId = OperatingSystem->SectionId;
492 CHAR SectionName[100];
493 CHAR BootDriveString[20];
494 CHAR BootPartitionString[20];
495 CHAR ReactOSSystemPath[200];
496 CHAR ReactOSARCPath[200];
497 CHAR ReactOSOptions[200];
498
499 RtlZeroMemory(SectionName, sizeof(SectionName));
500 RtlZeroMemory(BootDriveString, sizeof(BootDriveString));
501 RtlZeroMemory(BootPartitionString, sizeof(BootPartitionString));
502 RtlZeroMemory(ReactOSSystemPath, sizeof(ReactOSSystemPath));
503 RtlZeroMemory(ReactOSARCPath, sizeof(ReactOSARCPath));
504 RtlZeroMemory(ReactOSOptions, sizeof(ReactOSOptions));
505
506 if (SectionId != 0)
507 {
508 /* Load the settings */
509 IniReadSettingByName(SectionId, "SystemPath", ReactOSARCPath, sizeof(ReactOSARCPath));
510 IniReadSettingByName(SectionId, "Options", ReactOSOptions, sizeof(ReactOSOptions));
511 }
512
513 if (SectionId == 0)
514 {
515 if (!UiEditBox(BootDrivePrompt, BootDriveString, sizeof(BootDriveString)))
516 return;
517
518 if (!UiEditBox(BootPartitionPrompt, BootPartitionString, sizeof(BootPartitionString)))
519 return;
520
521 if (!UiEditBox(ReactOSSystemPathPrompt, ReactOSSystemPath, sizeof(ReactOSSystemPath)))
522 return;
523 }
524 else
525 {
526 if (!UiEditBox(ReactOSSystemPathPrompt, ReactOSARCPath, sizeof(ReactOSARCPath)))
527 return;
528 }
529
530 if (!UiEditBox(IsSetup ? ReactOSSetupOptionsPrompt : ReactOSOptionsPrompt, ReactOSOptions, sizeof(ReactOSOptions)))
531 return;
532
533 /* Modify the settings values and return if we were in edit mode */
534 if (SectionId != 0)
535 {
536 IniModifySettingValue(SectionId, "SystemPath", ReactOSARCPath);
537 IniModifySettingValue(SectionId, "Options", ReactOSOptions);
538 return;
539 }
540
541 /* Generate a unique section name */
542 TimeInfo = ArcGetTime();
543 RtlStringCbPrintfA(SectionName, sizeof(SectionName),
544 "CustomReactOS%u%u%u%u%u%u",
545 TimeInfo->Year, TimeInfo->Day, TimeInfo->Month,
546 TimeInfo->Hour, TimeInfo->Minute, TimeInfo->Second);
547
548 /* Add the section */
549 if (!IniAddSection(SectionName, &SectionId))
550 return;
551
552 /* Add the BootType */
553 if (!IniAddSettingValueToSection(SectionId, "BootType", IsSetup ? "ReactOSSetup" : "Windows2003"))
554 return;
555
556 /* Construct the ReactOS ARC system path */
557 ConstructArcPath(ReactOSARCPath, ReactOSSystemPath,
558 DriveMapGetBiosDriveNumber(BootDriveString),
559 atoi(BootPartitionString));
560
561 /* Add the system path */
562 if (!IniAddSettingValueToSection(SectionId, "SystemPath", ReactOSARCPath))
563 return;
564
565 /* Add the CommandLine */
566 if (!IniAddSettingValueToSection(SectionId, "Options", ReactOSOptions))
567 return;
568
569 OperatingSystem->SectionId = SectionId;
570 OperatingSystem->LoadIdentifier = NULL;
571}
TIMEINFO * ArcGetTime(VOID)
Definition: arcemul.c:27
VOID ConstructArcPath(PCHAR ArcPath, PCHAR SystemFolder, UCHAR Disk, ULONG Partition)
Definition: arcname.c:175
static const PCSTR BootPartitionPrompt
Definition: custom.c:69
static const PCSTR ReactOSSetupOptionsPrompt
Definition: custom.c:100
static const PCSTR ReactOSSystemPathPrompt
Definition: custom.c:86
static const PCSTR BootDrivePrompt
Definition: custom.c:56
static const PCSTR ReactOSOptionsPrompt
Definition: custom.c:92
#define DriveMapGetBiosDriveNumber(DeviceName)
Definition: hardware.h:35
BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: ui.c:634
#define NULL
Definition: types.h:112
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
PINI_SECTION IniAddSection(_In_ PINICACHE Cache, _In_ PCWSTR Name)
Definition: inicache.c:838
BOOLEAN IniAddSettingValueToSection(ULONG_PTR SectionId, PCSTR SettingName, PCSTR SettingValue)
Definition: inifile.c:255
BOOLEAN IniModifySettingValue(ULONG_PTR SectionId, PCSTR SettingName, PCSTR SettingValue)
Definition: inifile.c:296
BOOLEAN IniReadSettingByName(ULONG_PTR SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize)
Definition: inifile.c:149
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
Definition: fw.h:10
USHORT Month
Definition: fw.h:12
USHORT Day
Definition: fw.h:13
USHORT Minute
Definition: fw.h:15
USHORT Hour
Definition: fw.h:14
USHORT Second
Definition: fw.h:16
USHORT Year
Definition: fw.h:11
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
char CHAR
Definition: xmlstorage.h:175

Referenced by EditCustomBootNTOS(), and EditCustomBootReactOSSetup().

◆ OptionMenuCustomBoot()

VOID OptionMenuCustomBoot ( VOID  )

Referenced by DoOptionsMenu().

◆ OptionMenuReboot()

VOID OptionMenuReboot ( VOID  )

Referenced by DoOptionsMenu().