[FREELDR] Minor fixes.
[reactos.git] / boot / freeldr / freeldr / ntldr / setupldr.c
index 5342a1b..c1836ff 100644 (file)
@@ -1,42 +1,29 @@
 /*
- *  FreeLoader
- *
- *  Copyright (C) 2009       Aleksey Bragin  <aleksey@reactos.org>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * PROJECT:     FreeLoader
+ * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
+ * PURPOSE:     Windows-compatible NT OS Setup Loader.
+ * COPYRIGHT:   Copyright 2009-2019 Aleksey Bragin <aleksey@reactos.org>
  */
 
 #include <freeldr.h>
-#include "winldr.h"
-
 #include <ndk/ldrtypes.h>
 #include <arc/setupblk.h>
+#include "winldr.h"
+#include "inffile.h"
 
 #include <debug.h>
-
 DBG_DEFAULT_CHANNEL(WINDOWS);
+
 #define TAG_BOOT_OPTIONS 'pOtB'
 
 // TODO: Move to .h
 VOID AllocateAndInitLPB(PLOADER_PARAMETER_BLOCK *OutLoaderBlock);
 
 static VOID
-SetupLdrLoadNlsData(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPCSTR SearchPath)
+SetupLdrLoadNlsData(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, PCSTR SearchPath)
 {
     INFCONTEXT InfContext;
-    LPCSTR AnsiName, OemName, LangName;
+    PCSTR AnsiName, OemName, LangName;
 
     /* Get ANSI codepage file */
     if (!InfFindFirstLine(InfHandle, "NLS", "AnsiCodepage", &InfContext))
@@ -79,7 +66,7 @@ SetupLdrLoadNlsData(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPCSTR
     {
         BOOLEAN Success = WinLdrLoadNLSData(LoaderBlock, SearchPath, AnsiName, OemName, LangName);
         TRACE("NLS data loading %s\n", Success ? "successful" : "failed");
-    }    
+    }
 #else
     WinLdrLoadNLSData(LoaderBlock, SearchPath, AnsiName, OemName, LangName);
 #endif
@@ -89,11 +76,11 @@ SetupLdrLoadNlsData(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPCSTR
 }
 
 static VOID
-SetupLdrScanBootDrivers(PLIST_ENTRY BootDriverListHead, HINF InfHandle, LPCSTR SearchPath)
+SetupLdrScanBootDrivers(PLIST_ENTRY BootDriverListHead, HINF InfHandle, PCSTR SearchPath)
 {
     INFCONTEXT InfContext, dirContext;
     BOOLEAN Success;
-    LPCSTR Media, DriverName, dirIndex, ImagePath;
+    PCSTR Media, DriverName, dirIndex, ImagePath;
     WCHAR ServiceName[256];
     WCHAR ImagePathW[256];
 
@@ -152,8 +139,8 @@ LoadReactOSSetup(
     CHAR FileName[512];
     CHAR BootPath[512];
     CHAR BootOptions2[256];
-    LPCSTR LoadOptions;
-    LPSTR BootOptions;
+    PCSTR LoadOptions;
+    PSTR BootOptions;
     BOOLEAN BootFromFloppy;
     BOOLEAN Success;
     ULONG i, ErrorLine;
@@ -161,9 +148,9 @@ LoadReactOSSetup(
     INFCONTEXT InfContext;
     PLOADER_PARAMETER_BLOCK LoaderBlock;
     PSETUP_LOADER_BLOCK SetupBlock;
-    LPCSTR SystemPath;
+    PCSTR SystemPath;
 
-    static LPCSTR SourcePaths[] =
+    static PCSTR SourcePaths[] =
     {
         "", /* Only for floppy boot */
 #if defined(_M_IX86)
@@ -297,7 +284,7 @@ LoadReactOSSetup(
     /* Get debug load options and use them */
     if (InfFindFirstLine(InfHandle, "SetupData", "DbgOsLoadOptions", &InfContext))
     {
-        LPCSTR DbgLoadOptions;
+        PCSTR DbgLoadOptions;
 
         if (InfGetDataField(&InfContext, 1, &DbgLoadOptions))
             LoadOptions = DbgLoadOptions;