mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 05:22:56 +00:00
[SETUPLIB] Support different boot store file creation/opening and access modes
The support is so far enabled only for INI files (freeldr.ini, boot.ini). May be subject to further improvements in the future. Usage examples: - When finding existing ReactOS or Windows installations, the boot store should exist and is opened in read-only mode. Closing the boot store doesn't store any temporary modifications made to it. - When doing a clean installation, freeldr.ini is created in read-write access. - When installing with an existing freeldr.ini or boot.ini, they are opened as existing files in read-write access.
This commit is contained in:
parent
d1b8feb690
commit
c7295b2cdf
4 changed files with 348 additions and 209 deletions
|
@ -170,7 +170,8 @@ CreateFreeLoaderIniForReactOS(
|
|||
PVOID BootStoreHandle;
|
||||
|
||||
/* Initialize the INI file and create the common FreeLdr sections */
|
||||
Status = OpenBootStore(&BootStoreHandle, IniPath, FreeLdr, TRUE);
|
||||
Status = OpenBootStore(&BootStoreHandle, IniPath, FreeLdr,
|
||||
BS_CreateAlways /* BS_OpenAlways */, BS_ReadWriteAccess);
|
||||
if (!NT_SUCCESS(Status))
|
||||
return Status;
|
||||
|
||||
|
@ -199,7 +200,8 @@ CreateFreeLoaderIniForReactOSAndBootSector(
|
|||
PBOOT_SECTOR_OPTIONS Options = (PBOOT_SECTOR_OPTIONS)&BootEntry->OsOptions;
|
||||
|
||||
/* Initialize the INI file and create the common FreeLdr sections */
|
||||
Status = OpenBootStore(&BootStoreHandle, IniPath, FreeLdr, TRUE);
|
||||
Status = OpenBootStore(&BootStoreHandle, IniPath, FreeLdr,
|
||||
BS_CreateAlways /* BS_OpenAlways */, BS_ReadWriteAccess);
|
||||
if (!NT_SUCCESS(Status))
|
||||
return Status;
|
||||
|
||||
|
@ -337,7 +339,8 @@ UpdateFreeLoaderIni(
|
|||
PNTOS_OPTIONS Options = (PNTOS_OPTIONS)&BootEntry->OsOptions;
|
||||
|
||||
/* Open the INI file */
|
||||
Status = OpenBootStore(&BootStoreHandle, IniPath, FreeLdr, /*TRUE*/ FALSE);
|
||||
Status = OpenBootStore(&BootStoreHandle, IniPath, FreeLdr,
|
||||
BS_OpenExisting /* BS_OpenAlways */, BS_ReadWriteAccess);
|
||||
if (!NT_SUCCESS(Status))
|
||||
return Status;
|
||||
|
||||
|
@ -398,7 +401,8 @@ UpdateBootIni(
|
|||
PNTOS_OPTIONS Options = (PNTOS_OPTIONS)&BootEntry->OsOptions;
|
||||
|
||||
/* Open the INI file */
|
||||
Status = OpenBootStore(&BootStoreHandle, IniPath, NtLdr, FALSE);
|
||||
Status = OpenBootStore(&BootStoreHandle, IniPath, NtLdr,
|
||||
BS_OpenExisting /* BS_OpenAlways */, BS_ReadWriteAccess);
|
||||
if (!NT_SUCCESS(Status))
|
||||
return Status;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue