https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a28461124bbaa1bd12fb927ae4787033ea3872c5

commit a28461124bbaa1bd12fb927ae4787033ea3872c5
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Thu Jun 8 17:30:23 2017 +0000
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Sun Oct 14 23:46:52 2018 +0200

    [SETUPLIB][USETUP] Minor code refactoring, consisting in renaming the "ntos 
boot loader" stuff into "boot store", since this happens to be functionality 
that is a bit more general than previously thought.
    
    - Fix the usage of the BootEntry's "Version" member.
    - Don't surround with too many quotation marks the "friendly" boot entry 
name in AddBootStoreEntry().
    
    svn path=/branches/setup_improvements/; revision=74964
---
 base/setup/lib/bldrsup.c    | 134 ++++++++++++++++++++++++--------------------
 base/setup/lib/bldrsup.h    |  83 ++++++++++++++-------------
 base/setup/lib/osdetect.c   |  20 ++++---
 base/setup/usetup/bootsup.c |  94 ++++++++++++++++---------------
 4 files changed, 174 insertions(+), 157 deletions(-)

diff --git a/base/setup/lib/bldrsup.c b/base/setup/lib/bldrsup.c
index 80a951a6e1..5714cec837 100644
--- a/base/setup/lib/bldrsup.c
+++ b/base/setup/lib/bldrsup.c
@@ -1,8 +1,8 @@
 /*
  * PROJECT:     ReactOS Setup Library
  * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
- * PURPOSE:     NT 5.x family (MS Windows <= 2003, and ReactOS)
- *              boot loaders management.
+ * PURPOSE:     Boot Stores Management functionality, with support for
+ *              NT 5.x family (MS Windows <= 2003, and ReactOS) bootloaders.
  * COPYRIGHT:   Copyright 2017-2018 Hermes Belusca-Maito
  */
 
@@ -26,7 +26,7 @@ typedef NTSTATUS
 (*POPEN_BOOT_STORE)(
     OUT PVOID* Handle,
     IN HANDLE PartitionDirectoryHandle, // OPTIONAL
-    IN NTOS_BOOT_LOADER_TYPE Type,
+    IN BOOT_STORE_TYPE Type,
     IN BOOLEAN CreateNew);
 
 typedef NTSTATUS
@@ -42,7 +42,7 @@ typedef NTSTATUS
 
 typedef struct _NTOS_BOOT_LOADER_FILES
 {
-    NTOS_BOOT_LOADER_TYPE Type;
+    BOOT_STORE_TYPE Type;
     PCZZWSTR LoaderExecutables;
     PCWSTR LoaderConfigurationFile;
     POPEN_BOOT_STORE OpenBootStore;
@@ -56,7 +56,7 @@ typedef struct _NTOS_BOOT_LOADER_FILES
  */
 typedef struct _BOOT_STORE_CONTEXT
 {
-    NTOS_BOOT_LOADER_TYPE Type;
+    BOOT_STORE_TYPE Type;
 //  PNTOS_BOOT_LOADER_FILES ??
 /*
     PVOID PrivateData;
@@ -95,7 +95,7 @@ static NTSTATUS
 OpenIniBootLoaderStore(
     OUT PVOID* Handle,
     IN HANDLE PartitionDirectoryHandle, // OPTIONAL
-    IN NTOS_BOOT_LOADER_TYPE Type,
+    IN BOOT_STORE_TYPE Type,
     IN BOOLEAN CreateNew);
 
 static NTSTATUS
@@ -134,10 +134,10 @@ C_ASSERT(_countof(NtosBootLoaders) == BldrTypeMax);
 /* FUNCTIONS ****************************************************************/
 
 NTSTATUS
-FindNTOSBootLoader( // By handle
+FindBootStore( // By handle
     IN HANDLE PartitionDirectoryHandle, // OPTIONAL
-    IN NTOS_BOOT_LOADER_TYPE Type,
-    OUT PULONG Version OPTIONAL)
+    IN BOOT_STORE_TYPE Type,
+    OUT PULONG VersionNumber OPTIONAL)
 // OUT PHANDLE ConfigFileHande OPTIONAL ????
 {
     PCWSTR LoaderExecutable;
@@ -146,8 +146,8 @@ FindNTOSBootLoader( // By handle
     if (Type >= BldrTypeMax)
         return STATUS_INVALID_PARAMETER;
 
-    if (Version)
-        *Version = 0;
+    if (VersionNumber)
+        *VersionNumber = 0;
 
     /* Check whether any of the loader executables exist */
     LoaderExecutable = NtosBootLoaders[Type].LoaderExecutables;
@@ -172,10 +172,10 @@ FindNTOSBootLoader( // By handle
     }
 
     /* Check for loader version if needed */
-    if (Version)
+    if (VersionNumber)
     {
-        *Version = 0;
-        // TODO: Check for BLDR version ONLY if Version != NULL
+        *VersionNumber = 0;
+        // TODO: Check for BLDR version!
     }
 
     /* Check whether the loader configuration file exists */
@@ -340,7 +340,7 @@ static NTSTATUS
 OpenIniBootLoaderStore(
     OUT PVOID* Handle,
     IN HANDLE PartitionDirectoryHandle, // OPTIONAL
-    IN NTOS_BOOT_LOADER_TYPE Type,
+    IN BOOT_STORE_TYPE Type,
     IN BOOLEAN CreateNew)
 {
     NTSTATUS Status;
@@ -733,10 +733,10 @@ Quit:
 
 
 NTSTATUS
-OpenNTOSBootLoaderStoreByHandle(
+OpenBootStoreByHandle(
     OUT PVOID* Handle,
     IN HANDLE PartitionDirectoryHandle, // OPTIONAL
-    IN NTOS_BOOT_LOADER_TYPE Type,
+    IN BOOT_STORE_TYPE Type,
     IN BOOLEAN CreateNew)
 {
     /*
@@ -760,10 +760,10 @@ OpenNTOSBootLoaderStoreByHandle(
 }
 
 NTSTATUS
-OpenNTOSBootLoaderStore_UStr(
+OpenBootStore_UStr(
     OUT PVOID* Handle,
     IN PUNICODE_STRING SystemPartitionPath,
-    IN NTOS_BOOT_LOADER_TYPE Type,
+    IN BOOT_STORE_TYPE Type,
     IN BOOLEAN CreateNew)
 {
     NTSTATUS Status;
@@ -803,7 +803,7 @@ OpenNTOSBootLoaderStore_UStr(
         return Status;
     }
 
-    Status = OpenNTOSBootLoaderStoreByHandle(Handle, PartitionDirectoryHandle, 
Type, CreateNew);
+    Status = OpenBootStoreByHandle(Handle, PartitionDirectoryHandle, Type, 
CreateNew);
 
     /* Done! */
     NtClose(PartitionDirectoryHandle);
@@ -811,19 +811,19 @@ OpenNTOSBootLoaderStore_UStr(
 }
 
 NTSTATUS
-OpenNTOSBootLoaderStore(
+OpenBootStore(
     OUT PVOID* Handle,
     IN PCWSTR SystemPartition,
-    IN NTOS_BOOT_LOADER_TYPE Type,
+    IN BOOT_STORE_TYPE Type,
     IN BOOLEAN CreateNew)
 {
     UNICODE_STRING SystemPartitionPath;
     RtlInitUnicodeString(&SystemPartitionPath, SystemPartition);
-    return OpenNTOSBootLoaderStore_UStr(Handle, &SystemPartitionPath, Type, 
CreateNew);
+    return OpenBootStore_UStr(Handle, &SystemPartitionPath, Type, CreateNew);
 }
 
 NTSTATUS
-CloseNTOSBootLoaderStore(
+CloseBootStore(
     IN PVOID Handle)
 {
     PBOOT_STORE_CONTEXT BootStore = (PBOOT_STORE_CONTEXT)Handle;
@@ -855,7 +855,7 @@ NTSTATUS
 CreateNTOSEntry(
     IN PBOOT_STORE_INI_CONTEXT BootStore,
     IN ULONG_PTR BootEntryKey,
-    IN PNTOS_BOOT_ENTRY BootEntry)
+    IN PBOOT_STORE_ENTRY BootEntry)
 {
     PINICACHESECTION IniSection;
     PWCHAR Section = (PWCHAR)BootEntryKey;
@@ -867,7 +867,6 @@ CreateNTOSEntry(
     /* Create a new section */
     IniSection = IniCacheAppendSection(BootStore->IniCache, Section);
 
-    // if (_wcsicmp(BootEntry->Version, L"Windows2003") == 0)
     if (BootEntry->OsOptionsLength >= sizeof(NTOS_OPTIONS) &&
         RtlCompareMemory(&BootEntry->OsOptions /* Signature */,
                          NTOS_OPTIONS_SIGNATURE,
@@ -889,7 +888,6 @@ CreateNTOSEntry(
                           L"Options", (PWSTR)Options->OsLoadOptions);
     }
     else
-    // if (_wcsicmp(BootEntry->Version, L"BootSector") == 0)
     if (BootEntry->OsOptionsLength >= sizeof(BOOT_SECTOR_OPTIONS) &&
         RtlCompareMemory(&BootEntry->OsOptions /* Signature */,
                          BOOT_SECTOR_OPTIONS_SIGNATURE,
@@ -916,16 +914,18 @@ CreateNTOSEntry(
     }
     else
     {
-        DPRINT1("Unsupported BootType '%S'\n", BootEntry->Version);
+        // DPRINT1("Unsupported BootType %lu/'%*.s'\n",
+                // BootEntry->OsOptionsLength, 8, &BootEntry->OsOptions);
+        DPRINT1("Unsupported BootType %lu\n", BootEntry->OsOptionsLength);
     }
 
     return STATUS_SUCCESS;
 }
 
 NTSTATUS
-AddNTOSBootEntry(
+AddBootStoreEntry(
     IN PVOID Handle,
-    IN PNTOS_BOOT_ENTRY BootEntry,
+    IN PBOOT_STORE_ENTRY BootEntry,
     IN ULONG_PTR BootEntryKey)
 {
     PBOOT_STORE_CONTEXT BootStore = (PBOOT_STORE_CONTEXT)Handle;
@@ -949,6 +949,9 @@ AddNTOSBootEntry(
 
     if (BootStore->Type == FreeLdr)
     {
+        if (BootEntry->Version != FreeLdr)
+            return STATUS_INVALID_PARAMETER;
+
         return CreateNTOSEntry((PBOOT_STORE_INI_CONTEXT)BootStore,
                                BootEntryKey, BootEntry);
     }
@@ -960,15 +963,19 @@ AddNTOSBootEntry(
         ULONG BufferLength;
         PCWSTR InstallName, OsOptions;
         // ULONG InstallNameLength, OsOptionsLength;
+        BOOLEAN IsNameNotQuoted;
+
+        if (BootEntry->Version != NtLdr)
+            return STATUS_INVALID_PARAMETER;
 
-        // if (_wcsicmp(BootEntry->Version, L"Windows2003") != 0)
         if (BootEntry->OsOptionsLength < sizeof(NTOS_OPTIONS) ||
             RtlCompareMemory(&BootEntry->OsOptions /* Signature */,
                              NTOS_OPTIONS_SIGNATURE,
                              RTL_FIELD_SIZE(NTOS_OPTIONS, Signature)) !=
                              RTL_FIELD_SIZE(NTOS_OPTIONS, Signature))
         {
-            DPRINT1("Unsupported BootType '%S'\n", BootEntry->Version);
+            // DPRINT1("Unsupported BootType '%S'\n", BootEntry->Version);
+            DPRINT1("Unsupported BootType %lu\n", BootEntry->OsOptionsLength);
             return STATUS_SUCCESS; // STATUS_NOT_SUPPORTED;
         }
 
@@ -978,7 +985,9 @@ AddNTOSBootEntry(
         // if (InstallNameLength == 0) InstallName = NULL;
         // if (OsOptionsLength == 0) OsOptions = NULL;
 
-        BufferLength = 2 /* Quotes for FriendlyName*/ + wcslen(InstallName);
+        IsNameNotQuoted = (InstallName[0] != L'\"' || 
InstallName[wcslen(InstallName)-1] != L'\"');
+
+        BufferLength = (IsNameNotQuoted ? 2 /* Quotes for FriendlyName*/ : 0) 
+ wcslen(InstallName);
         if (OsOptions)
             BufferLength += 1 /* Space between FriendlyName and options */ + 
wcslen(OsOptions);
         BufferLength++; /* NULL-termination */
@@ -987,13 +996,14 @@ AddNTOSBootEntry(
         if (!Buffer)
             return STATUS_INSUFFICIENT_RESOURCES;
 
-        wcscpy(Buffer, L"\"");
-        wcscat(Buffer, InstallName);
-        wcscat(Buffer, L"\"");
+        *Buffer = UNICODE_NULL;
+        if (IsNameNotQuoted) RtlStringCchCatW(Buffer, BufferLength, L"\"");
+        RtlStringCchCatW(Buffer, BufferLength, InstallName);
+        if (IsNameNotQuoted) RtlStringCchCatW(Buffer, BufferLength, L"\"");
         if (OsOptions)
         {
-            wcscat(Buffer, L" ");
-            wcscat(Buffer, OsOptions);
+            RtlStringCchCatW(Buffer, BufferLength, L" ");
+            RtlStringCchCatW(Buffer, BufferLength, OsOptions);
         }
 
         /* Insert the entry into the "Operating Systems" section */
@@ -1011,7 +1021,7 @@ AddNTOSBootEntry(
 }
 
 NTSTATUS
-DeleteNTOSBootEntry(
+DeleteBootStoreEntry(
     IN PVOID Handle,
     IN ULONG_PTR BootEntryKey)
 {
@@ -1045,9 +1055,9 @@ DeleteNTOSBootEntry(
 }
 
 NTSTATUS
-ModifyNTOSBootEntry(
+ModifyBootStoreEntry(
     IN PVOID Handle,
-    IN PNTOS_BOOT_ENTRY BootEntry)
+    IN PBOOT_STORE_ENTRY BootEntry)
 {
     PBOOT_STORE_CONTEXT BootStore = (PBOOT_STORE_CONTEXT)Handle;
 
@@ -1079,10 +1089,10 @@ ModifyNTOSBootEntry(
 }
 
 NTSTATUS
-QueryNTOSBootEntry(
+QueryBootStoreEntry(
     IN PVOID Handle,
     IN ULONG_PTR BootEntryKey,
-    OUT PNTOS_BOOT_ENTRY BootEntry) // Technically this should be 
PNTOS_BOOT_ENTRY*
+    OUT PBOOT_STORE_ENTRY BootEntry) // Technically this should be 
PBOOT_STORE_ENTRY*
 {
     PBOOT_STORE_CONTEXT BootStore = (PBOOT_STORE_CONTEXT)Handle;
 
@@ -1114,9 +1124,9 @@ QueryNTOSBootEntry(
 }
 
 NTSTATUS
-QueryNTOSBootOptions(
+QueryBootStoreOptions(
     IN PVOID Handle,
-    IN OUT PNTOS_BOOT_OPTIONS BootOptions
+    IN OUT PBOOT_STORE_OPTIONS BootOptions
 /* , IN PULONG BootOptionsLength */ )
 {
     NTSTATUS Status = STATUS_SUCCESS;
@@ -1147,6 +1157,8 @@ QueryNTOSBootOptions(
 
     if (BootStore->Type == FreeLdr)
     {
+        BootOptions->Version = FreeLdr;
+
         Status = 
IniCacheGetKey(((PBOOT_STORE_INI_CONTEXT)BootStore)->OptionsIniSection,
                                 L"DefaultOS", 
(PWCHAR*)&BootOptions->CurrentBootEntryKey);
         if (!NT_SUCCESS(Status))
@@ -1161,6 +1173,8 @@ QueryNTOSBootOptions(
     }
     else if (BootStore->Type == NtLdr)
     {
+        BootOptions->Version = NtLdr;
+
         Status = 
IniCacheGetKey(((PBOOT_STORE_INI_CONTEXT)BootStore)->OptionsIniSection,
                                 L"default", 
(PWCHAR*)&BootOptions->CurrentBootEntryKey);
         if (!NT_SUCCESS(Status))
@@ -1178,9 +1192,9 @@ QueryNTOSBootOptions(
 }
 
 NTSTATUS
-SetNTOSBootOptions(
+SetBootStoreOptions(
     IN PVOID Handle,
-    IN PNTOS_BOOT_OPTIONS BootOptions,
+    IN PBOOT_STORE_OPTIONS BootOptions,
     IN ULONG FieldsToChange)
 {
     PBOOT_STORE_CONTEXT BootStore = (PBOOT_STORE_CONTEXT)Handle;
@@ -1208,6 +1222,9 @@ SetNTOSBootOptions(
         return STATUS_NOT_SUPPORTED;
     }
 
+    if (BootOptions->Version != FreeLdr)
+        return STATUS_INVALID_PARAMETER;
+
     //
     // TODO: Depending on the flags set in 'FieldsToChange',
     // change either one or both these bootloader options.
@@ -1216,7 +1233,7 @@ SetNTOSBootOptions(
                       NULL, INSERT_LAST,
                       L"DefaultOS", (PWCHAR)BootOptions->CurrentBootEntryKey);
 
-    StringCchPrintfW(TimeoutStr, ARRAYSIZE(TimeoutStr), L"%d", 
BootOptions->Timeout);
+    RtlStringCchPrintfW(TimeoutStr, ARRAYSIZE(TimeoutStr), L"%d", 
BootOptions->Timeout);
     IniCacheInsertKey(((PBOOT_STORE_INI_CONTEXT)BootStore)->OptionsIniSection,
                       NULL, INSERT_LAST,
                       L"TimeOut", TimeoutStr);
@@ -1237,9 +1254,9 @@ FreeLdrEnumerateBootEntries(
     PINICACHEITERATOR Iterator;
     PINICACHESECTION OsIniSection;
     PWCHAR SectionName, KeyData;
-    UCHAR xxBootEntry[FIELD_OFFSET(NTOS_BOOT_ENTRY, OsOptions) +
+    UCHAR xxBootEntry[FIELD_OFFSET(BOOT_STORE_ENTRY, OsOptions) +
                       max(sizeof(NTOS_OPTIONS), sizeof(BOOT_SECTOR_OPTIONS))];
-    PNTOS_BOOT_ENTRY BootEntry = (PNTOS_BOOT_ENTRY)&xxBootEntry;
+    PBOOT_STORE_ENTRY BootEntry = (PBOOT_STORE_ENTRY)&xxBootEntry;
     PWCHAR Buffer;
 
     /* Enumerate all the valid installations listed in the "Operating Systems" 
section */
@@ -1291,7 +1308,7 @@ FreeLdrEnumerateBootEntries(
 
         DPRINT1("Boot entry '%S' in OS section '%S'\n", InstallName, 
SectionName);
 
-        BootEntry->Version = NULL;
+        BootEntry->Version = FreeLdr;
         BootEntry->BootEntryKey = MAKESTRKEY(SectionName);
         BootEntry->FriendlyName = InstallName;
         BootEntry->BootFilePath = NULL;
@@ -1318,8 +1335,7 @@ FreeLdrEnumerateBootEntries(
             /* BootType is Windows2003 */
             PNTOS_OPTIONS Options = (PNTOS_OPTIONS)&BootEntry->OsOptions;
 
-            BootEntry->Version = L"Windows2003";
-            DPRINT1("This is a '%S' boot entry\n", BootEntry->Version);
+            DPRINT1("This is a '%S' boot entry\n", KeyData);
 
             BootEntry->OsOptionsLength = sizeof(NTOS_OPTIONS);
             RtlCopyMemory(Options->Signature,
@@ -1350,8 +1366,7 @@ FreeLdrEnumerateBootEntries(
             /* BootType is BootSector */
             PBOOT_SECTOR_OPTIONS Options = 
(PBOOT_SECTOR_OPTIONS)&BootEntry->OsOptions;
 
-            BootEntry->Version = L"BootSector";
-            DPRINT1("This is a '%S' boot entry\n", BootEntry->Version);
+            DPRINT1("This is a '%S' boot entry\n", KeyData);
 
             BootEntry->OsOptionsLength = sizeof(BOOT_SECTOR_OPTIONS);
             RtlCopyMemory(Options->Signature,
@@ -1384,7 +1399,6 @@ FreeLdrEnumerateBootEntries(
         else
         {
             DPRINT1("Unrecognized BootType value '%S'\n", KeyData);
-            // BootEntry->Version = KeyData;
             // goto DoEnum;
         }
 
@@ -1416,8 +1430,8 @@ NtLdrEnumerateBootEntries(
     NTSTATUS Status = STATUS_SUCCESS;
     PINICACHEITERATOR Iterator;
     PWCHAR SectionName, KeyData;
-    UCHAR xxBootEntry[FIELD_OFFSET(NTOS_BOOT_ENTRY, OsOptions) + 
sizeof(NTOS_OPTIONS)];
-    PNTOS_BOOT_ENTRY BootEntry = (PNTOS_BOOT_ENTRY)&xxBootEntry;
+    UCHAR xxBootEntry[FIELD_OFFSET(BOOT_STORE_ENTRY, OsOptions) + 
sizeof(NTOS_OPTIONS)];
+    PBOOT_STORE_ENTRY BootEntry = (PBOOT_STORE_ENTRY)&xxBootEntry;
     PNTOS_OPTIONS Options = (PNTOS_OPTIONS)&BootEntry->OsOptions;
     PWCHAR Buffer;
     ULONG BufferLength;
@@ -1510,7 +1524,7 @@ NtLdrEnumerateBootEntries(
         DPRINT1("Boot entry '%S' in OS section (path) '%S'\n", InstallName, 
SectionName);
         // SectionName == SystemRoot;
 
-        BootEntry->Version = L"Windows2003";
+        BootEntry->Version = NtLdr;
         BootEntry->BootEntryKey = 0; // FIXME??
         BootEntry->FriendlyName = InstallName;
         BootEntry->BootFilePath = NULL;
@@ -1541,7 +1555,7 @@ NtLdrEnumerateBootEntries(
 }
 
 NTSTATUS
-EnumerateNTOSBootEntries(
+EnumerateBootStoreEntries(
     IN PVOID Handle,
 //  IN ULONG Flags, // Determine which data to retrieve
     IN PENUM_BOOT_ENTRIES_ROUTINE EnumBootEntriesRoutine,
diff --git a/base/setup/lib/bldrsup.h b/base/setup/lib/bldrsup.h
index 1c34be7e62..41cc1bb11b 100644
--- a/base/setup/lib/bldrsup.h
+++ b/base/setup/lib/bldrsup.h
@@ -1,8 +1,8 @@
 /*
  * PROJECT:     ReactOS Setup Library
  * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
- * PURPOSE:     NT 5.x family (MS Windows <= 2003, and ReactOS)
- *              boot loaders management.
+ * PURPOSE:     Boot Stores Management functionality, with support for
+ *              NT 5.x family (MS Windows <= 2003, and ReactOS) bootloaders.
  * COPYRIGHT:   Copyright 2017-2018 Hermes Belusca-Maito
  */
 
@@ -10,13 +10,13 @@
 
 #pragma once
 
-typedef enum _NTOS_BOOT_LOADER_TYPE     // _BOOT_STORE_TYPE
+typedef enum _BOOT_STORE_TYPE
 {
     FreeLdr,    // ReactOS' FreeLoader
     NtLdr,      // Windows <= 2k3 NT "FlexBoot" OS Loader NTLDR
 //  BootMgr,    // Vista+ BCD-oriented BOOTMGR
     BldrTypeMax
-} NTOS_BOOT_LOADER_TYPE;
+} BOOT_STORE_TYPE;
 
 /*
  * Some references about EFI boot entries:
@@ -28,25 +28,25 @@ typedef enum _NTOS_BOOT_LOADER_TYPE     // _BOOT_STORE_TYPE
  * This structure is inspired from the EFI boot entry structure
  * BOOT_OPTIONS that is defined in ndk/iotypes.h .
  */
-typedef struct _NTOS_BOOT_OPTIONS       // _BOOT_STORE_OPTIONS
+typedef struct _BOOT_STORE_OPTIONS
 {
-    // ULONG Version;
+    ULONG Version;          // BOOT_STORE_TYPE value
     // ULONG Length;
     ULONG Timeout;
     ULONG_PTR CurrentBootEntryKey;
     // ULONG_PTR NextBootEntryKey;
     // WCHAR HeadlessRedirection[1];
-} NTOS_BOOT_OPTIONS, *PNTOS_BOOT_OPTIONS;
+} BOOT_STORE_OPTIONS, *PBOOT_STORE_OPTIONS;
 
 /*
  * These macros are used to set a value for the BootEntryKey member of a
- * NTOS_BOOT_ENTRY structure, much in the same idea as MAKEINTRESOURCE and
+ * BOOT_STORE_ENTRY structure, much in the same idea as MAKEINTRESOURCE and
  * IS_INTRESOURCE macros for Win32 resources.
  *
- * A key consists of either a boot ID number,
- * comprised between 0 and MAX_USHORT == 0xFFFF == 65535, or can be a pointer
- * to a human-readable string (section name), as in the case of FreeLDR, or
- * to a GUID, as in the case of BOOTMGR.
+ * A key consists of either a boot ID number, comprised between 0 and
+ * MAX_USHORT == 0xFFFF == 65535, or can be a pointer to a human-readable
+ * string (section name), as in the case of FreeLDR, or to a GUID, as in the
+ * case of BOOTMGR.
  *
  * If IS_INTKEY(BootEntryKey) == TRUE, i.e. the key is <= 65535, this means
  * the key is a boot ID number, otherwise it is typically a pointer to a 
string.
@@ -59,10 +59,9 @@ typedef struct _NTOS_BOOT_OPTIONS       // 
_BOOT_STORE_OPTIONS
  * This structure is inspired from the EFI boot entry structures
  * BOOT_ENTRY and FILE_PATH that are defined in ndk/iotypes.h .
  */
-typedef struct _NTOS_BOOT_ENTRY         // _BOOT_STORE_ENTRY
+typedef struct _BOOT_STORE_ENTRY
 {
-    // ULONG Version; // Equivalent of the "BootType" in FreeLdr
-    PWCHAR Version; // HACK!!!
+    ULONG Version;          // BOOT_STORE_TYPE value
     // ULONG Length;
     ULONG_PTR BootEntryKey; // Boot entry "key"
     PCWSTR FriendlyName;    // Human-readable boot entry description        // 
LoadIdentifier
@@ -77,7 +76,7 @@ typedef struct _NTOS_BOOT_ENTRY         // _BOOT_STORE_ENTRY
  *  WCHAR FriendlyName[ANYSIZE_ARRAY];
  *  FILE_PATH BootFilePath;
  */
-} NTOS_BOOT_ENTRY, *PNTOS_BOOT_ENTRY;
+} BOOT_STORE_ENTRY, *PBOOT_STORE_ENTRY;
 
 /* "NTOS" (aka. ReactOS or MS Windows NT) <= 5.x options */
 typedef struct _NTOS_OPTIONS
@@ -85,8 +84,8 @@ typedef struct _NTOS_OPTIONS
     UCHAR Signature[8];     // "NTOS_5\0\0"
     // ULONG Version;
     // ULONG Length;
-    PCWSTR OsLoadPath;      // The OS SystemRoot path                       // 
OsLoaderFilePath // OsFilePath
-    PCWSTR OsLoadOptions;                                                   // 
OsLoadOptions
+    PCWSTR OsLoadPath;      // The OS SystemRoot path   // OsLoaderFilePath // 
OsFilePath
+    PCWSTR OsLoadOptions;                               // OsLoadOptions
 /*
  * In packed form, this structure would contain an offset to the 'OsLoadPath'
  * string, and the 'OsLoadOptions' member would be:
@@ -114,79 +113,79 @@ typedef struct _BOOT_SECTOR_OPTIONS
 
 typedef NTSTATUS
 (NTAPI *PENUM_BOOT_ENTRIES_ROUTINE)(
-    IN NTOS_BOOT_LOADER_TYPE Type,
-    IN PNTOS_BOOT_ENTRY BootEntry,
+    IN BOOT_STORE_TYPE Type,
+    IN PBOOT_STORE_ENTRY BootEntry,
     IN PVOID Parameter OPTIONAL);
 
 
 NTSTATUS
-FindNTOSBootLoader( // By handle
+FindBootStore( // By handle
     IN HANDLE PartitionDirectoryHandle, // OPTIONAL
-    IN NTOS_BOOT_LOADER_TYPE Type,
-    OUT PULONG Version);
+    IN BOOT_STORE_TYPE Type,
+    OUT PULONG VersionNumber OPTIONAL);
 
 
 NTSTATUS
-OpenNTOSBootLoaderStoreByHandle(
+OpenBootStoreByHandle(
     OUT PVOID* Handle,
     IN HANDLE PartitionDirectoryHandle, // OPTIONAL
-    IN NTOS_BOOT_LOADER_TYPE Type,
+    IN BOOT_STORE_TYPE Type,
     IN BOOLEAN CreateNew);
 
 NTSTATUS
-OpenNTOSBootLoaderStore_UStr(
+OpenBootStore_UStr(
     OUT PVOID* Handle,
     IN PUNICODE_STRING SystemPartitionPath,
-    IN NTOS_BOOT_LOADER_TYPE Type,
+    IN BOOT_STORE_TYPE Type,
     IN BOOLEAN CreateNew);
 
 NTSTATUS
-OpenNTOSBootLoaderStore(
+OpenBootStore(
     OUT PVOID* Handle,
     IN PCWSTR SystemPartition,
-    IN NTOS_BOOT_LOADER_TYPE Type,
+    IN BOOT_STORE_TYPE Type,
     IN BOOLEAN CreateNew);
 
 NTSTATUS
-CloseNTOSBootLoaderStore(
+CloseBootStore(
     IN PVOID Handle);
 
 NTSTATUS
-AddNTOSBootEntry(
+AddBootStoreEntry(
     IN PVOID Handle,
-    IN PNTOS_BOOT_ENTRY BootEntry,
+    IN PBOOT_STORE_ENTRY BootEntry,
     IN ULONG_PTR BootEntryKey);
 
 NTSTATUS
-DeleteNTOSBootEntry(
+DeleteBootStoreEntry(
     IN PVOID Handle,
     IN ULONG_PTR BootEntryKey);
 
 NTSTATUS
-ModifyNTOSBootEntry(
+ModifyBootStoreEntry(
     IN PVOID Handle,
-    IN PNTOS_BOOT_ENTRY BootEntry);
+    IN PBOOT_STORE_ENTRY BootEntry);
 
 NTSTATUS
-QueryNTOSBootEntry(
+QueryBootStoreEntry(
     IN PVOID Handle,
     IN ULONG_PTR BootEntryKey,
-    OUT PNTOS_BOOT_ENTRY BootEntry); // Technically this should be 
PNTOS_BOOT_ENTRY*
+    OUT PBOOT_STORE_ENTRY BootEntry); // Technically this should be 
PBOOT_STORE_ENTRY*
 
 NTSTATUS
-QueryNTOSBootOptions(
+QueryBootStoreOptions(
     IN PVOID Handle,
-    IN OUT PNTOS_BOOT_OPTIONS BootOptions
+    IN OUT PBOOT_STORE_OPTIONS BootOptions
 /* , IN PULONG BootOptionsLength */ );
 
 NTSTATUS
-SetNTOSBootOptions(
+SetBootStoreOptions(
     IN PVOID Handle,
-    IN PNTOS_BOOT_OPTIONS BootOptions,
+    IN PBOOT_STORE_OPTIONS BootOptions,
     IN ULONG FieldsToChange);
 
 NTSTATUS
-EnumerateNTOSBootEntries(
+EnumerateBootStoreEntries(
     IN PVOID Handle,
 //  IN ULONG Flags, // Determine which data to retrieve
     IN PENUM_BOOT_ENTRIES_ROUTINE EnumBootEntriesRoutine,
diff --git a/base/setup/lib/osdetect.c b/base/setup/lib/osdetect.c
index daa98c7ab1..ce71007cb6 100644
--- a/base/setup/lib/osdetect.c
+++ b/base/setup/lib/osdetect.c
@@ -68,8 +68,8 @@ typedef struct _ENUM_INSTALLS_DATA
 static NTSTATUS
 NTAPI
 EnumerateInstallations(
-    IN NTOS_BOOT_LOADER_TYPE Type,
-    IN PNTOS_BOOT_ENTRY BootEntry,
+    IN BOOT_STORE_TYPE Type,
+    IN PBOOT_STORE_ENTRY BootEntry,
     IN PVOID Parameter OPTIONAL)
 {
     PENUM_INSTALLS_DATA Data = (PENUM_INSTALLS_DATA)Parameter;
@@ -95,8 +95,10 @@ EnumerateInstallations(
                          RTL_FIELD_SIZE(NTOS_OPTIONS, Signature))
     {
         /* This is not a ReactOS entry */
-        DPRINT1("    An installation '%S' of unsupported type '%S'\n",
-                BootEntry->FriendlyName, BootEntry->Version ? 
BootEntry->Version : L"n/a");
+        // DPRINT1("    An installation '%S' of unsupported type '%S'\n",
+                // BootEntry->FriendlyName, BootEntry->Version ? 
BootEntry->Version : L"n/a");
+        DPRINT1("    An installation '%S' of unsupported type %lu\n",
+                BootEntry->FriendlyName, BootEntry->OsOptionsLength);
         /* Continue the enumeration */
         return STATUS_SUCCESS;
     }
@@ -641,7 +643,7 @@ FindNTOSInstallations(
     OBJECT_ATTRIBUTES ObjectAttributes;
     IO_STATUS_BLOCK IoStatusBlock;
     UNICODE_STRING PartitionRootPath;
-    NTOS_BOOT_LOADER_TYPE Type;
+    BOOT_STORE_TYPE Type;
     PVOID BootStoreHandle;
     ENUM_INSTALLS_DATA Data;
     ULONG Version;
@@ -678,7 +680,7 @@ FindNTOSInstallations(
     /* Try to see whether we recognize some NT boot loaders */
     for (Type = FreeLdr; Type < BldrTypeMax; ++Type)
     {
-        Status = FindNTOSBootLoader(PartitionDirectoryHandle, Type, &Version);
+        Status = FindBootStore(PartitionDirectoryHandle, Type, &Version);
         if (!NT_SUCCESS(Status))
         {
             /* The loader does not exist, continue with another one */
@@ -691,15 +693,15 @@ FindNTOSInstallations(
         DPRINT1("Analyse the OS installations for loader type '%d' in disk 
#%d, partition #%d\n",
                 Type, DiskNumber, PartitionNumber);
 
-        Status = OpenNTOSBootLoaderStoreByHandle(&BootStoreHandle, 
PartitionDirectoryHandle, Type, FALSE);
+        Status = OpenBootStoreByHandle(&BootStoreHandle, 
PartitionDirectoryHandle, Type, FALSE);
         if (!NT_SUCCESS(Status))
         {
             DPRINT1("Could not open the NTOS boot store of type '%d' (Status 
0x%08lx), continue with another one...\n",
                     Type, Status);
             continue;
         }
-        EnumerateNTOSBootEntries(BootStoreHandle, EnumerateInstallations, 
&Data);
-        CloseNTOSBootLoaderStore(BootStoreHandle);
+        EnumerateBootStoreEntries(BootStoreHandle, EnumerateInstallations, 
&Data);
+        CloseBootStore(BootStoreHandle);
     }
 
     /* Close the partition */
diff --git a/base/setup/usetup/bootsup.c b/base/setup/usetup/bootsup.c
index 2d978b6364..7969e8bae9 100644
--- a/base/setup/usetup/bootsup.c
+++ b/base/setup/usetup/bootsup.c
@@ -131,12 +131,12 @@ CreateFreeLoaderReactOSEntries(
     IN PVOID BootStoreHandle,
     IN PCWSTR ArcPath)
 {
-    UCHAR xxBootEntry[FIELD_OFFSET(NTOS_BOOT_ENTRY, OsOptions) + 
sizeof(NTOS_OPTIONS)];
-    PNTOS_BOOT_ENTRY BootEntry = (PNTOS_BOOT_ENTRY)&xxBootEntry;
+    UCHAR xxBootEntry[FIELD_OFFSET(BOOT_STORE_ENTRY, OsOptions) + 
sizeof(NTOS_OPTIONS)];
+    PBOOT_STORE_ENTRY BootEntry = (PBOOT_STORE_ENTRY)&xxBootEntry;
     PNTOS_OPTIONS Options = (PNTOS_OPTIONS)&BootEntry->OsOptions;
-    NTOS_BOOT_OPTIONS BootOptions;
+    BOOT_STORE_OPTIONS BootOptions;
 
-    BootEntry->Version = L"Windows2003";
+    BootEntry->Version = FreeLdr;
     BootEntry->BootFilePath = NULL;
 
     BootEntry->OsOptionsLength = sizeof(NTOS_OPTIONS);
@@ -150,20 +150,20 @@ CreateFreeLoaderReactOSEntries(
     // BootEntry->BootEntryKey = MAKESTRKEY(L"ReactOS");
     BootEntry->FriendlyName = L"\"ReactOS\"";
     Options->OsLoadOptions  = NULL; // L"";
-    AddNTOSBootEntry(BootStoreHandle, BootEntry, MAKESTRKEY(L"ReactOS"));
+    AddBootStoreEntry(BootStoreHandle, BootEntry, MAKESTRKEY(L"ReactOS"));
 
     /* ReactOS_Debug */
     // BootEntry->BootEntryKey = MAKESTRKEY(L"ReactOS_Debug");
     BootEntry->FriendlyName = L"\"ReactOS (Debug)\"";
     Options->OsLoadOptions  = L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS";
-    AddNTOSBootEntry(BootStoreHandle, BootEntry, MAKESTRKEY(L"ReactOS_Debug"));
+    AddBootStoreEntry(BootStoreHandle, BootEntry, 
MAKESTRKEY(L"ReactOS_Debug"));
 
 #ifdef _WINKD_
     /* ReactOS_VBoxDebug */
     // BootEntry->BootEntryKey = MAKESTRKEY(L"ReactOS_VBoxDebug");
     BootEntry->FriendlyName = L"\"ReactOS (VBoxDebug)\"";
     Options->OsLoadOptions  = L"/DEBUG /DEBUGPORT=VBOX /SOS";
-    AddNTOSBootEntry(BootStoreHandle, BootEntry, 
MAKESTRKEY(L"ReactOS_VBoxDebug"));
+    AddBootStoreEntry(BootStoreHandle, BootEntry, 
MAKESTRKEY(L"ReactOS_VBoxDebug"));
 #endif
 #if DBG
 #ifndef _WINKD_
@@ -171,34 +171,34 @@ CreateFreeLoaderReactOSEntries(
     // BootEntry->BootEntryKey = MAKESTRKEY(L"ReactOS_KdSerial");
     BootEntry->FriendlyName = L"\"ReactOS (RosDbg)\"";
     Options->OsLoadOptions  = L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS 
/KDSERIAL";
-    AddNTOSBootEntry(BootStoreHandle, BootEntry, 
MAKESTRKEY(L"ReactOS_KdSerial"));
+    AddBootStoreEntry(BootStoreHandle, BootEntry, 
MAKESTRKEY(L"ReactOS_KdSerial"));
 #endif
 
     /* ReactOS_Screen */
     // BootEntry->BootEntryKey = MAKESTRKEY(L"ReactOS_Screen");
     BootEntry->FriendlyName = L"\"ReactOS (Screen)\"";
     Options->OsLoadOptions  = L"/DEBUG /DEBUGPORT=SCREEN /SOS";
-    AddNTOSBootEntry(BootStoreHandle, BootEntry, 
MAKESTRKEY(L"ReactOS_Screen"));
+    AddBootStoreEntry(BootStoreHandle, BootEntry, 
MAKESTRKEY(L"ReactOS_Screen"));
 
     /* ReactOS_LogFile */
     // BootEntry->BootEntryKey = MAKESTRKEY(L"ReactOS_LogFile");
     BootEntry->FriendlyName = L"\"ReactOS (Log file)\"";
     Options->OsLoadOptions  = L"/DEBUG /DEBUGPORT=FILE /SOS";
-    AddNTOSBootEntry(BootStoreHandle, BootEntry, 
MAKESTRKEY(L"ReactOS_LogFile"));
+    AddBootStoreEntry(BootStoreHandle, BootEntry, 
MAKESTRKEY(L"ReactOS_LogFile"));
 
     /* ReactOS_Ram */
     // BootEntry->BootEntryKey = MAKESTRKEY(L"ReactOS_Ram");
     BootEntry->FriendlyName = L"\"ReactOS (RAM Disk)\"";
     Options->OsLoadPath     = L"ramdisk(0)\\ReactOS";
     Options->OsLoadOptions  = L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS 
/RDPATH=reactos.img /RDIMAGEOFFSET=32256";
-    AddNTOSBootEntry(BootStoreHandle, BootEntry, MAKESTRKEY(L"ReactOS_Ram"));
+    AddBootStoreEntry(BootStoreHandle, BootEntry, MAKESTRKEY(L"ReactOS_Ram"));
 
     /* ReactOS_EMS */
     // BootEntry->BootEntryKey = MAKESTRKEY(L"ReactOS_EMS");
     BootEntry->FriendlyName = L"\"ReactOS (Emergency Management Services)\"";
     Options->OsLoadPath     = ArcPath;
     Options->OsLoadOptions  = L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS 
/redirect=com2 /redirectbaudrate=115200";
-    AddNTOSBootEntry(BootStoreHandle, BootEntry, MAKESTRKEY(L"ReactOS_EMS"));
+    AddBootStoreEntry(BootStoreHandle, BootEntry, MAKESTRKEY(L"ReactOS_EMS"));
 #endif
 
 
@@ -234,7 +234,8 @@ CreateFreeLoaderReactOSEntries(
     }
 #endif
 
-    SetNTOSBootOptions(BootStoreHandle, &BootOptions, 2 | 1);
+    BootOptions.Version = FreeLdr;
+    SetBootStoreOptions(BootStoreHandle, &BootOptions, 2 | 1);
 }
 
 static NTSTATUS
@@ -246,7 +247,7 @@ CreateFreeLoaderIniForReactOS(
     PVOID BootStoreHandle;
 
     /* Initialize the INI file and create the common FreeLdr sections */
-    Status = OpenNTOSBootLoaderStore(&BootStoreHandle, IniPath, FreeLdr, TRUE);
+    Status = OpenBootStore(&BootStoreHandle, IniPath, FreeLdr, TRUE);
     if (!NT_SUCCESS(Status))
         return Status;
 
@@ -254,7 +255,7 @@ CreateFreeLoaderIniForReactOS(
     CreateFreeLoaderReactOSEntries(BootStoreHandle, ArcPath);
 
     /* Close the INI file */
-    CloseNTOSBootLoaderStore(BootStoreHandle);
+    CloseBootStore(BootStoreHandle);
     return STATUS_SUCCESS;
 }
 
@@ -270,19 +271,19 @@ CreateFreeLoaderIniForReactOSAndBootSector(
 {
     NTSTATUS Status;
     PVOID BootStoreHandle;
-    UCHAR xxBootEntry[FIELD_OFFSET(NTOS_BOOT_ENTRY, OsOptions) + 
sizeof(BOOT_SECTOR_OPTIONS)];
-    PNTOS_BOOT_ENTRY BootEntry = (PNTOS_BOOT_ENTRY)&xxBootEntry;
+    UCHAR xxBootEntry[FIELD_OFFSET(BOOT_STORE_ENTRY, OsOptions) + 
sizeof(BOOT_SECTOR_OPTIONS)];
+    PBOOT_STORE_ENTRY BootEntry = (PBOOT_STORE_ENTRY)&xxBootEntry;
     PBOOT_SECTOR_OPTIONS Options = (PBOOT_SECTOR_OPTIONS)&BootEntry->OsOptions;
 
     /* Initialize the INI file and create the common FreeLdr sections */
-    Status = OpenNTOSBootLoaderStore(&BootStoreHandle, IniPath, FreeLdr, TRUE);
+    Status = OpenBootStore(&BootStoreHandle, IniPath, FreeLdr, TRUE);
     if (!NT_SUCCESS(Status))
         return Status;
 
     /* Add the ReactOS entries */
     CreateFreeLoaderReactOSEntries(BootStoreHandle, ArcPath);
 
-    /**/BootEntry->Version = L"BootSector";/**/
+    BootEntry->Version = FreeLdr;
     BootEntry->BootFilePath = NULL;
 
     BootEntry->OsOptionsLength = sizeof(BOOT_SECTOR_OPTIONS);
@@ -296,10 +297,10 @@ CreateFreeLoaderIniForReactOSAndBootSector(
 
     // BootEntry->BootEntryKey = MAKESTRKEY(Section);
     BootEntry->FriendlyName = Description;
-    AddNTOSBootEntry(BootStoreHandle, BootEntry, MAKESTRKEY(Section));
+    AddBootStoreEntry(BootStoreHandle, BootEntry, MAKESTRKEY(Section));
 
     /* Close the INI file */
-    CloseNTOSBootLoaderStore(BootStoreHandle);
+    CloseBootStore(BootStoreHandle);
     return STATUS_SUCCESS;
 }
 
@@ -322,8 +323,8 @@ typedef struct _ENUM_REACTOS_ENTRIES_DATA
 static NTSTATUS
 NTAPI
 EnumerateReactOSEntries(
-    IN NTOS_BOOT_LOADER_TYPE Type,
-    IN PNTOS_BOOT_ENTRY BootEntry,
+    IN BOOT_STORE_TYPE Type,
+    IN PBOOT_STORE_ENTRY BootEntry,
     IN PVOID Parameter OPTIONAL)
 {
     PENUM_REACTOS_ENTRIES_DATA Data = (PENUM_REACTOS_ENTRIES_DATA)Parameter;
@@ -340,9 +341,10 @@ EnumerateReactOSEntries(
                          RTL_FIELD_SIZE(NTOS_OPTIONS, Signature))
     {
         /* This is not a ReactOS entry */
-        DPRINT1("    An installation '%S' of unsupported type '%S'\n",
-                BootEntry->FriendlyName,
-                BootEntry->Version ? BootEntry->Version : L"n/a");
+        // DPRINT1("    An installation '%S' of unsupported type '%S'\n",
+                // BootEntry->FriendlyName, BootEntry->Version ? 
BootEntry->Version : L"n/a");
+        DPRINT1("    An installation '%S' of unsupported type %lu\n",
+                BootEntry->FriendlyName, BootEntry->OsOptionsLength);
         /* Continue the enumeration */
         goto SkipThisEntry;
     }
@@ -403,12 +405,12 @@ UpdateFreeLoaderIni(
     NTSTATUS Status;
     PVOID BootStoreHandle;
     ENUM_REACTOS_ENTRIES_DATA Data;
-    UCHAR xxBootEntry[FIELD_OFFSET(NTOS_BOOT_ENTRY, OsOptions) + 
sizeof(NTOS_OPTIONS)];
-    PNTOS_BOOT_ENTRY BootEntry = (PNTOS_BOOT_ENTRY)&xxBootEntry;
+    UCHAR xxBootEntry[FIELD_OFFSET(BOOT_STORE_ENTRY, OsOptions) + 
sizeof(NTOS_OPTIONS)];
+    PBOOT_STORE_ENTRY BootEntry = (PBOOT_STORE_ENTRY)&xxBootEntry;
     PNTOS_OPTIONS Options = (PNTOS_OPTIONS)&BootEntry->OsOptions;
 
     /* Open the INI file */
-    Status = OpenNTOSBootLoaderStore(&BootStoreHandle, IniPath, FreeLdr, 
/*TRUE*/ FALSE);
+    Status = OpenBootStore(&BootStoreHandle, IniPath, FreeLdr, /*TRUE*/ FALSE);
     if (!NT_SUCCESS(Status))
         return Status;
 
@@ -420,10 +422,10 @@ UpdateFreeLoaderIni(
     RtlStringCchCopyW(Data.OsName, ARRAYSIZE(Data.OsName), L"\"ReactOS\"");
 
     //
-    // FIXME: We temporarily use EnumerateNTOSBootEntries, until
-    // both QueryNTOSBootEntry and ModifyNTOSBootEntry get implemented.
+    // FIXME: We temporarily use EnumerateBootStoreEntries, until
+    // both QueryBootStoreEntry and ModifyBootStoreEntry get implemented.
     //
-    Status = EnumerateNTOSBootEntries(BootStoreHandle, 
EnumerateReactOSEntries, &Data);
+    Status = EnumerateBootStoreEntries(BootStoreHandle, 
EnumerateReactOSEntries, &Data);
 
     /* Create a new "ReactOS" entry if there is none already existing that 
suits us */
     if (!Data.UseExistingEntry)
@@ -431,7 +433,7 @@ UpdateFreeLoaderIni(
         // RtlStringCchPrintfW(Data.SectionName, ARRAYSIZE(Data.SectionName), 
L"ReactOS_%lu", Data.i);
         // RtlStringCchPrintfW(Data.OsName, ARRAYSIZE(Data.OsName), 
L"\"ReactOS %lu\"", Data.i);
 
-        BootEntry->Version = L"Windows2003";
+        BootEntry->Version = FreeLdr;
         BootEntry->BootFilePath = NULL;
 
         BootEntry->OsOptionsLength = sizeof(NTOS_OPTIONS);
@@ -444,11 +446,11 @@ UpdateFreeLoaderIni(
         // BootEntry->BootEntryKey = MAKESTRKEY(Data.SectionName);
         BootEntry->FriendlyName = Data.OsName;
         Options->OsLoadOptions  = NULL; // L"";
-        AddNTOSBootEntry(BootStoreHandle, BootEntry, 
MAKESTRKEY(Data.SectionName));
+        AddBootStoreEntry(BootStoreHandle, BootEntry, 
MAKESTRKEY(Data.SectionName));
     }
 
     /* Close the INI file */
-    CloseNTOSBootLoaderStore(BootStoreHandle);
+    CloseBootStore(BootStoreHandle);
     return STATUS_SUCCESS;
 }
 
@@ -464,12 +466,12 @@ UpdateBootIni(
     ENUM_REACTOS_ENTRIES_DATA Data;
 
     // NOTE: Technically it would be "BootSector"...
-    UCHAR xxBootEntry[FIELD_OFFSET(NTOS_BOOT_ENTRY, OsOptions) + 
sizeof(NTOS_OPTIONS)];
-    PNTOS_BOOT_ENTRY BootEntry = (PNTOS_BOOT_ENTRY)&xxBootEntry;
+    UCHAR xxBootEntry[FIELD_OFFSET(BOOT_STORE_ENTRY, OsOptions) + 
sizeof(NTOS_OPTIONS)];
+    PBOOT_STORE_ENTRY BootEntry = (PBOOT_STORE_ENTRY)&xxBootEntry;
     PNTOS_OPTIONS Options = (PNTOS_OPTIONS)&BootEntry->OsOptions;
 
     /* Open the INI file */
-    Status = OpenNTOSBootLoaderStore(&BootStoreHandle, IniPath, NtLdr, FALSE);
+    Status = OpenBootStore(&BootStoreHandle, IniPath, NtLdr, FALSE);
     if (!NT_SUCCESS(Status))
         return Status;
 
@@ -481,16 +483,16 @@ UpdateBootIni(
     RtlStringCchCopyW(Data.OsName, ARRAYSIZE(Data.OsName), L"\"ReactOS\"");
 
     //
-    // FIXME: We temporarily use EnumerateNTOSBootEntries, until
-    // both QueryNTOSBootEntry and ModifyNTOSBootEntry get implemented.
+    // FIXME: We temporarily use EnumerateBootStoreEntries, until
+    // both QueryBootStoreEntry and ModifyBootStoreEntry get implemented.
     //
-    Status = EnumerateNTOSBootEntries(BootStoreHandle, 
EnumerateReactOSEntries, &Data);
+    Status = EnumerateBootStoreEntries(BootStoreHandle, 
EnumerateReactOSEntries, &Data);
 
     /* If either the key was not found, or contains something else, add a new 
one */
     if (!Data.UseExistingEntry /* ||
         ( (Status == STATUS_NO_MORE_ENTRIES) && wcscmp(Data.OsName, 
EntryValue) ) */)
     {
-        BootEntry->Version = L"Windows2003";    // NOTE: See remark above
+        BootEntry->Version = NtLdr;
         BootEntry->BootFilePath = NULL;
 
         BootEntry->OsOptionsLength = sizeof(NTOS_OPTIONS);
@@ -504,11 +506,11 @@ UpdateBootIni(
         // BootEntry->FriendlyName = Data.OsName;
         BootEntry->FriendlyName = EntryValue;
         Options->OsLoadOptions  = NULL; // L"";
-        AddNTOSBootEntry(BootStoreHandle, BootEntry, MAKESTRKEY(0 
/*Data.SectionName*/));
+        AddBootStoreEntry(BootStoreHandle, BootEntry, MAKESTRKEY(0 
/*Data.SectionName*/));
     }
 
     /* Close the INI file */
-    CloseNTOSBootLoaderStore(BootStoreHandle);
+    CloseBootStore(BootStoreHandle);
     return STATUS_SUCCESS; // Status;
 }
 
@@ -1804,8 +1806,8 @@ InstallFatBootcodeToPartition(
     /* Check for NT and other bootloaders */
 
     // FIXME: Check for Vista+ bootloader!
-    /*** Status = FindNTOSBootLoader(PartitionHandle, NtLdr, &Version); ***/
-    /*** Status = FindNTOSBootLoader(PartitionHandle, BootMgr, &Version); ***/
+    /*** Status = FindBootStore(PartitionHandle, NtLdr, &Version); ***/
+    /*** Status = FindBootStore(PartitionHandle, BootMgr, &Version); ***/
     if (DoesFileExist_2(SystemRootPath->Buffer, L"NTLDR") == TRUE ||
         DoesFileExist_2(SystemRootPath->Buffer, L"BOOT.INI") == TRUE)
     {

Reply via email to