[SETUPLIB] Improve a bit the management of boot-store options

- QueryBootStoreOptions(): De-duplicate code.
- SetBootStoreOpt(): Respect the FieldsToChange flag.
- BOOT_STORE_OPTIONS: Remove unused Version field and distinguish
  between "Current" and "Next" BootEntryKey.
This commit is contained in:
Hermès Bélusca-Maïto 2024-05-04 12:47:13 +02:00
parent 68c2a28973
commit 9b563d32d2
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
3 changed files with 68 additions and 54 deletions

View file

@ -130,15 +130,15 @@ CreateFreeLoaderReactOSEntries(
#if DBG && !defined(_WINKD_)
if (IsUnattendedSetup)
{
BootOptions.CurrentBootEntryKey = MAKESTRKEY(L"ReactOS_KdSerial");
BootOptions.NextBootEntryKey = MAKESTRKEY(L"ReactOS_KdSerial");
}
else
#endif
{
#if DBG
BootOptions.CurrentBootEntryKey = MAKESTRKEY(L"ReactOS_Debug");
BootOptions.NextBootEntryKey = MAKESTRKEY(L"ReactOS_Debug");
#else
BootOptions.CurrentBootEntryKey = MAKESTRKEY(L"ReactOS");
BootOptions.NextBootEntryKey = MAKESTRKEY(L"ReactOS");
#endif
}
@ -157,8 +157,8 @@ CreateFreeLoaderReactOSEntries(
}
#endif
BootOptions.Version = FreeLdr;
SetBootStoreOptions(BootStoreHandle, &BootOptions, 2 | 1);
SetBootStoreOptions(BootStoreHandle, &BootOptions,
BOOT_OPTIONS_TIMEOUT | BOOT_OPTIONS_NEXT_BOOTENTRY_KEY);
}
static NTSTATUS