diff --git a/Application/Bootstrap/Bootstrap.c b/Application/Bootstrap/Bootstrap.c index 7f4648c4..fb308aa4 100644 --- a/Application/Bootstrap/Bootstrap.c +++ b/Application/Bootstrap/Bootstrap.c @@ -65,10 +65,10 @@ LoadOpenCore ( && UnicodeGetParentDirectory (LoaderPath)) { DEBUG ((DEBUG_INFO, "BS: Relative path - %s\n", LoaderPath)); PrefixPathSize = StrSize (LoaderPath); - if (LoaderPathSize - PrefixPathSize >= L_STR_SIZE (OPEN_CORE_DRIVER_PATH)) { + if (LoaderPathSize - PrefixPathSize >= L_STR_SIZE (OPEN_CORE_APP_PATH)) { RootPathLength = PrefixPathSize / sizeof (CHAR16) - 1; LoaderPath[RootPathLength] = '\\'; - CopyMem (&LoaderPath[RootPathLength + 1], OPEN_CORE_DRIVER_PATH, L_STR_SIZE (OPEN_CORE_DRIVER_PATH)); + CopyMem (&LoaderPath[RootPathLength + 1], OPEN_CORE_APP_PATH, L_STR_SIZE (OPEN_CORE_APP_PATH)); Buffer = ReadFile (FileSystem, LoaderPath, &BufferSize, BASE_16MB); DEBUG ((DEBUG_INFO, "BS: Startup path - %s (%p)\n", LoaderPath, Buffer)); @@ -93,12 +93,12 @@ LoadOpenCore ( DEBUG (( DEBUG_INFO, "BS: Fallback to absolute path - %s\n", - OPEN_CORE_ROOT_PATH L"\\" OPEN_CORE_DRIVER_PATH + OPEN_CORE_ROOT_PATH L"\\" OPEN_CORE_APP_PATH )); Buffer = ReadFile ( FileSystem, - OPEN_CORE_ROOT_PATH L"\\" OPEN_CORE_DRIVER_PATH, + OPEN_CORE_ROOT_PATH L"\\" OPEN_CORE_APP_PATH, &BufferSize, BASE_16MB ); @@ -107,7 +107,7 @@ LoadOpenCore ( // Failure to allocate this one is not too critical, as we will still be able // to choose it as a default path. // - ImagePath = FileDevicePath (DeviceHandle, OPEN_CORE_ROOT_PATH L"\\" OPEN_CORE_DRIVER_PATH); + ImagePath = FileDevicePath (DeviceHandle, OPEN_CORE_ROOT_PATH L"\\" OPEN_CORE_APP_PATH); } } @@ -152,7 +152,7 @@ UefiMain ( // // We have just started at EFI/BOOT/BOOTx64.efi. // We need to run OpenCore on this partition as it failed automatically. - // The image is optionally located at OPEN_CORE_DRIVER_PATH file. + // The image is optionally located at OPEN_CORE_APP_PATH file. // LoadedImage = NULL; diff --git a/Include/Acidanthera/Library/OcBootManagementLib.h b/Include/Acidanthera/Library/OcBootManagementLib.h index de6fad5c..b246387d 100755 --- a/Include/Acidanthera/Library/OcBootManagementLib.h +++ b/Include/Acidanthera/Library/OcBootManagementLib.h @@ -1392,9 +1392,7 @@ OcRegisterBootstrapBootOption ( IN CONST CHAR16 *OptionName, IN EFI_HANDLE DeviceHandle, IN CONST CHAR16 *FilePath, - IN BOOLEAN ShortForm, - IN CHAR16 *MatchSuffix, - IN UINTN MatchSuffixLen + IN BOOLEAN ShortForm ); /** diff --git a/Include/Acidanthera/Library/OcDevicePathLib.h b/Include/Acidanthera/Library/OcDevicePathLib.h index 27616d0f..622632f0 100755 --- a/Include/Acidanthera/Library/OcDevicePathLib.h +++ b/Include/Acidanthera/Library/OcDevicePathLib.h @@ -404,7 +404,7 @@ OcGetNextLoadOptionDevicePath ( BOOLEAN OcDevicePathHasFilePathSuffix ( IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, - IN CHAR16 *Suffix, + IN CONST CHAR16 *Suffix, IN UINTN SuffixLen ); diff --git a/Include/Acidanthera/Library/OcMainLib.h b/Include/Acidanthera/Library/OcMainLib.h index 941917ed..7d8fe748 100644 --- a/Include/Acidanthera/Library/OcMainLib.h +++ b/Include/Acidanthera/Library/OcMainLib.h @@ -48,7 +48,7 @@ #define OPEN_CORE_ROOT_PATH L"EFI\\OC" -#define OPEN_CORE_DRIVER_PATH L"OpenCore.efi" +#define OPEN_CORE_APP_PATH L"OpenCore.efi" #define OPEN_CORE_CONFIG_PATH L"config.plist" diff --git a/Include/Acidanthera/Library/OcStringLib.h b/Include/Acidanthera/Library/OcStringLib.h index 4afae3cf..c6b322b0 100755 --- a/Include/Acidanthera/Library/OcStringLib.h +++ b/Include/Acidanthera/Library/OcStringLib.h @@ -240,8 +240,8 @@ OcAsciiEndsWith ( INTN EFIAPI OcStriCmp ( - IN CHAR16 *FirstString, - IN CHAR16 *SecondString + IN CONST CHAR16 *FirstString, + IN CONST CHAR16 *SecondString ); /** diff --git a/Library/OcBootManagementLib/DefaultEntryChoice.c b/Library/OcBootManagementLib/DefaultEntryChoice.c index c15a58d2..392a9082 100644 --- a/Library/OcBootManagementLib/DefaultEntryChoice.c +++ b/Library/OcBootManagementLib/DefaultEntryChoice.c @@ -903,7 +903,7 @@ InternalGetBoostrapOptionData ( OUT EFI_DEVICE_PATH_PROTOCOL **LoadPath, IN UINT16 *BootOptions, IN UINTN NumBootOptions, - IN CHAR16 *MatchSuffix, + IN CONST CHAR16 *MatchSuffix, IN UINTN MatchSuffixLen ) { @@ -960,9 +960,7 @@ InternalRegisterBootstrapBootOption ( IN CONST CHAR16 *OptionName, IN EFI_HANDLE DeviceHandle, IN CONST CHAR16 *FilePath, - IN BOOLEAN ShortForm, - IN CHAR16 *MatchSuffix, - IN UINTN MatchSuffixLen + IN BOOLEAN ShortForm ) { EFI_STATUS Status; @@ -1061,8 +1059,8 @@ InternalRegisterBootstrapBootOption ( &CurrDevicePath, &BootOrder[1], BootOrderSize / sizeof (*BootOrder), - MatchSuffix, - MatchSuffixLen + FilePath, + StrLen (FilePath) ); CurrOptionExists = Option != NULL; if (CurrOptionExists) { @@ -1210,9 +1208,7 @@ OcRegisterBootstrapBootOption ( IN CONST CHAR16 *OptionName, IN EFI_HANDLE DeviceHandle, IN CONST CHAR16 *FilePath, - IN BOOLEAN ShortForm, - IN CHAR16 *MatchSuffix, - IN UINTN MatchSuffixLen + IN BOOLEAN ShortForm ) { EFI_STATUS Status; @@ -1238,9 +1234,7 @@ OcRegisterBootstrapBootOption ( OptionName, DeviceHandle, FilePath, - ShortForm, - MatchSuffix, - MatchSuffixLen + ShortForm ); if (FwRuntime != NULL) { diff --git a/Library/OcDevicePathLib/OcDevicePathLib.c b/Library/OcDevicePathLib/OcDevicePathLib.c index 04ee6ae1..b6da51b7 100755 --- a/Library/OcDevicePathLib/OcDevicePathLib.c +++ b/Library/OcDevicePathLib/OcDevicePathLib.c @@ -1254,7 +1254,7 @@ OcGetNumDevicePathInstances ( BOOLEAN OcDevicePathHasFilePathSuffix ( IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, - IN CHAR16 *Suffix, + IN CONST CHAR16 *Suffix, IN UINTN SuffixLen ) { diff --git a/Library/OcMainLib/OpenCoreMisc.c b/Library/OcMainLib/OpenCoreMisc.c index 5c4b0a39..003fae47 100644 --- a/Library/OcMainLib/OpenCoreMisc.c +++ b/Library/OcMainLib/OpenCoreMisc.c @@ -623,12 +623,12 @@ RegisterLauncherOption ( UINTN BootstrapSize; if (AsciiStrCmp (LauncherPath, "Default") == 0) { - BootstrapSize = StrSize (RootPath) + StrSize (OPEN_CORE_DRIVER_PATH); + BootstrapSize = StrSize (RootPath) + StrSize (OPEN_CORE_APP_PATH); BootstrapPath = AllocatePool (BootstrapSize); if (BootstrapPath == NULL) { return 0; } - UnicodeSPrint (BootstrapPath, BootstrapSize, L"%s\\%s", RootPath, OPEN_CORE_DRIVER_PATH); + UnicodeSPrint (BootstrapPath, BootstrapSize, L"%s\\%s", RootPath, OPEN_CORE_APP_PATH); } else { BootstrapPath = AsciiStrCopyToUnicode (LauncherPath, 0); if (BootstrapPath == NULL) { @@ -640,9 +640,7 @@ RegisterLauncherOption ( L"OpenCore", LoadHandle, BootstrapPath, - ShortForm, - BootstrapPath, - StrLen (BootstrapPath) + ShortForm ); FreePool (BootstrapPath); diff --git a/Library/OcStringLib/OcUnicodeLib.c b/Library/OcStringLib/OcUnicodeLib.c index 1a612152..be39321e 100755 --- a/Library/OcStringLib/OcUnicodeLib.c +++ b/Library/OcStringLib/OcUnicodeLib.c @@ -25,8 +25,8 @@ INTN EFIAPI OcStriCmp ( - IN CHAR16 *FirstString, - IN CHAR16 *SecondString + IN CONST CHAR16 *FirstString, + IN CONST CHAR16 *SecondString ) { CHAR16 UpperFirstString;