ReactOS 0.4.16-dev-816-g135a9a9
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 485 of file custom.c.

488{
489 TIMEINFO* TimeInfo;
490 ULONG_PTR SectionId = OperatingSystem->SectionId;
491 CHAR SectionName[100];
492 CHAR BootDriveString[20];
493 CHAR BootPartitionString[20];
494 CHAR ReactOSSystemPath[200];
495 CHAR ReactOSARCPath[200];
496 CHAR ReactOSOptions[200];
497
498 RtlZeroMemory(SectionName, sizeof(SectionName));
499 RtlZeroMemory(BootDriveString, sizeof(BootDriveString));
500 RtlZeroMemory(BootPartitionString, sizeof(BootPartitionString));
501 RtlZeroMemory(ReactOSSystemPath, sizeof(ReactOSSystemPath));
502 RtlZeroMemory(ReactOSARCPath, sizeof(ReactOSARCPath));
503 RtlZeroMemory(ReactOSOptions, sizeof(ReactOSOptions));
504
505 if (SectionId != 0)
506 {
507 /* Load the settings */
508 IniReadSettingByName(SectionId, "SystemPath", ReactOSARCPath, sizeof(ReactOSARCPath));
509 IniReadSettingByName(SectionId, "Options", ReactOSOptions, sizeof(ReactOSOptions));
510 }
511
512 if (SectionId == 0)
513 {
514 if (!UiEditBox(BootDrivePrompt, BootDriveString, sizeof(BootDriveString)))
515 return;
516
517 if (!UiEditBox(BootPartitionPrompt, BootPartitionString, sizeof(BootPartitionString)))
518 return;
519
520 if (!UiEditBox(ReactOSSystemPathPrompt, ReactOSSystemPath, sizeof(ReactOSSystemPath)))
521 return;
522 }
523 else
524 {
525 if (!UiEditBox(ReactOSSystemPathPrompt, ReactOSARCPath, sizeof(ReactOSARCPath)))
526 return;
527 }
528
529 if (!UiEditBox(IsSetup ? ReactOSSetupOptionsPrompt : ReactOSOptionsPrompt, ReactOSOptions, sizeof(ReactOSOptions)))
530 return;
531
532 /* Modify the settings values and return if we were in edit mode */
533 if (SectionId != 0)
534 {
535 IniModifySettingValue(SectionId, "SystemPath", ReactOSARCPath);
536 IniModifySettingValue(SectionId, "Options", ReactOSOptions);
537 return;
538 }
539
540 /* Generate a unique section name */
541 TimeInfo = ArcGetTime();
542 RtlStringCbPrintfA(SectionName, sizeof(SectionName),
543 "CustomReactOS%u%u%u%u%u%u",
544 TimeInfo->Year, TimeInfo->Day, TimeInfo->Month,
545 TimeInfo->Hour, TimeInfo->Minute, TimeInfo->Second);
546
547 /* Add the section */
548 if (!IniAddSection(SectionName, &SectionId))
549 return;
550
551 /* Add the BootType */
552 if (!IniAddSettingValueToSection(SectionId, "BootType", IsSetup ? "ReactOSSetup" : "Windows2003"))
553 return;
554
555 /* Construct the ReactOS ARC system path */
556 ConstructArcPath(ReactOSARCPath, ReactOSSystemPath,
557 DriveMapGetBiosDriveNumber(BootDriveString),
558 atoi(BootPartitionString));
559
560 /* Add the system path */
561 if (!IniAddSettingValueToSection(SectionId, "SystemPath", ReactOSARCPath))
562 return;
563
564 /* Add the CommandLine */
565 if (!IniAddSettingValueToSection(SectionId, "Options", ReactOSOptions))
566 return;
567
568 OperatingSystem->SectionId = SectionId;
569 OperatingSystem->LoadIdentifier = NULL;
570}
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:633
#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:260
BOOLEAN IniModifySettingValue(ULONG_PTR SectionId, PCSTR SettingName, PCSTR SettingValue)
Definition: inifile.c:301
BOOLEAN IniReadSettingByName(ULONG_PTR SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize)
Definition: inifile.c:154
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().