+#ifdef HAS_OPTION_MENU_EDIT_CMDLINE
+
+VOID EditOperatingSystemEntry(IN OperatingSystemItem* OperatingSystem)
+{
+ ULONG_PTR SectionId;
+ PCSTR SectionName = OperatingSystem->SectionName;
+ ULONG i;
+ CHAR BootType[80];
+
+ /* Try to open the operating system section in the .ini file */
+ if (!IniOpenSection(SectionName, &SectionId))
+ {
+ UiMessageBox("Section [%s] not found in freeldr.ini.", SectionName);
+ return;
+ }
+
+ /* Try to read the boot type */
+ *BootType = ANSI_NULL;
+ IniReadSettingByName(SectionId, "BootType", BootType, sizeof(BootType));
+
+ /* We must have the "BootType" value (it has been possibly added by InitOperatingSystemList()) */
+ ASSERT(*BootType);
+
+ /* Loop through the OS loading method table and find a suitable OS entry editor */
+ for (i = 0; i < sizeof(OSLoadingMethods) / sizeof(OSLoadingMethods[0]); ++i)
+ {
+ if (_stricmp(BootType, OSLoadingMethods[i].BootType) == 0)
+ {
+ OSLoadingMethods[i].EditOsEntry(SectionId);
+ return;
+ }
+ }
+}
+
+#endif // HAS_OPTION_MENU_EDIT_CMDLINE
+