diff --git a/.gitignore b/.gitignore index 324cffda0..7e97f1d49 100644 --- a/.gitignore +++ b/.gitignore @@ -122,8 +122,6 @@ CloverPackage/revision CloverPackage/version tools -#VC project -/VC #Eclipse build folder /DEBUG_*/ diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule.template index c288ae814..1c22352e5 100644 --- a/BaseTools/Conf/build_rule.template +++ b/BaseTools/Conf/build_rule.template @@ -409,8 +409,8 @@ $(AT)"$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS) $(AT)$(CP) ${dst} $(DEBUG_DIR) $(AT)$(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi - $(AT)-$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR) - $(AT)-$(CP) $(DEBUG_DIR)(+)*.pdb $(OUTPUT_DIR) + -$(AT)$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR) + -$(AT)$(CP) $(DEBUG_DIR)(+)*.pdb $(OUTPUT_DIR) @"echo" [GENFW] $(MODULE_NAME) @@ -421,14 +421,14 @@ # #The below 2 lines are only needed for UNIXGCC tool chain, which generates PE image directly # - $(AT)-$(OBJCOPY) $(OBJCOPY_ADDDEBUGFLAG) ${src} + -$(AT)$(OBJCOPY) $(OBJCOPY_ADDDEBUGFLAG) ${src} $(AT)$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).debug $(BIN_DIR)(+)$(MODULE_NAME_GUID).debug @"echo" [OBJCOPY] $(MODULE_NAME) $(AT)"$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS) $(AT)$(CP) ${dst} $(DEBUG_DIR) $(AT)$(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi - $(AT)-$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR) + -$(AT)$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR) @"echo" [GENFW] $(MODULE_NAME) @@ -437,11 +437,11 @@ $(AT)"$(MTOC)" -subsystem $(MODULE_TYPE) $(MTOC_FLAGS) ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).pecoff @"echo" [MTOC] $(MODULE_NAME) # create symbol file for GDB debug - $(AT)-$(DSYMUTIL) ${src} + -$(AT)$(DSYMUTIL) ${src} $(AT)"$(GENFW)" -e $(MODULE_TYPE) -o ${dst} $(DEBUG_DIR)(+)$(MODULE_NAME).pecoff $(GENFW_FLAGS) $(AT)$(CP) ${dst} $(DEBUG_DIR) $(AT)$(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi - $(AT)-$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR) + -$(AT)$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR) @"echo" [GENFW] $(MODULE_NAME) [Dependency-Expression-File] @@ -614,7 +614,7 @@ $(AT)"$(GENFW)" -o ${dst} -j $(MICROCODE_BINARY_FILES) $(GENFW_FLAGS) - $(AT)-$(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).bin + -$(AT)$(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).bin [EFI-Image-File] diff --git a/Clover.dsc b/Clover.dsc index 6e80667ca..48177b08e 100644 --- a/Clover.dsc +++ b/Clover.dsc @@ -119,6 +119,7 @@ # # Misc # + CppMemLib|Library/CppMemLib/CppMemLib.inf PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf @@ -284,212 +285,213 @@ ################################################################################################### [Components] +!if $(FAMILY) == "MSFT" + DEFINE OC_INCLUDE_FLAG = /FI OpenCoreFromClover.h +!else + DEFINE OC_INCLUDE_FLAG = -include OpenCoreFromClover.h +!endif + OpenCorePkg/Platform/OpenCore/OpenCoreLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcGuardLib/OcGuardLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcAfterBootCompatLib/OcAfterBootCompatLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcAppleBootPolicyLib/OcAppleBootPolicyLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcAppleChunklistLib/OcAppleChunklistLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcAppleDiskImageLib/OcAppleDiskImageLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcAppleKeyMapLib/OcAppleKeyMapLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcAppleKeysLib/OcAppleKeysLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcAppleRamDiskLib/OcAppleRamDiskLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcBootManagementLib/OcBootManagementLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcCompressionLib/OcCompressionLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcConsoleLib/OcConsoleLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcCpuLib/OcCpuLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcCryptoLib/OcCryptoLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcDevicePathLib/OcDevicePathLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcFileLib/OcFileLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcMemoryLib/OcMemoryLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcMiscLib/OcMiscLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcOSInfoLib/OcOSInfoLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcRngLib/OcRngLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcRtcLib/OcRtcLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcSerializeLib/OcSerializeLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcStringLib/OcStringLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcStorageLib/OcStorageLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcTemplateLib/OcTemplateLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcXmlLib/OcXmlLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcDeviceTreeLib/OcDeviceTreeLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcDataHubLib/OcDataHubLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcAppleImg4Lib/OcAppleImg4Lib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcAppleKernelLib/OcAppleKernelLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcMachoLib/OcMachoLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcVirtualFsLib/OcVirtualFsLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcMacInfoLib/OcMacInfoLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcApfsLib/OcApfsLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcAppleSecureBootLib/OcAppleSecureBootLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcAppleImageVerificationLib/OcAppleImageVerificationLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcDriverConnectionLib/OcDriverConnectionLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } #OcDebugLogLib|OpenCorePkg/Library/OcDebugLogLib/OcDebugLogLib.inf OpenCorePkg/Library/OcAcpiLib/OcAcpiLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcAppleEventLib/OcAppleEventLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } #OcAppleImageConversionLib|OpenCorePkg/Library/OcAppleImageConversionLib/OcAppleImageConversionLib.inf OpenCorePkg/Library/OcAudioLib/OcAudioLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcInputLib/OcInputLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcAppleUserInterfaceThemeLib/OcAppleUserInterfaceThemeLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcConfigurationLib/OcConfigurationLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcDevicePropertyLib/OcDevicePropertyLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcFirmwareVolumeLib/OcFirmwareVolumeLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcHashServicesLib/OcHashServicesLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcSmbiosLib/OcSmbiosLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcSmcLib/OcSmcLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcUnicodeCollationEngLib/OcUnicodeCollationEngGenericLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } OpenCorePkg/Library/OcPeCoffLib/OcPeCoffLib.inf { - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h - } - #OcPngLib|OpenCorePkg/Library/OcPngLib/OcPngLib.inf - OpenCorePkg/Platform/OpenCore/OpenCoreLib.inf { - - *_*_*_CC_FLAGS = -include OpenCoreFromClover.h + *_*_*_CC_FLAGS = $(OC_INCLUDE_FLAG) } @@ -863,29 +865,30 @@ [Components.X64] + Library/CppMemLib/CppMemLib.inf # MemoryFix/OsxAptioFixDrv/OsxAptioFix2Drv.inf - MemoryFix/OsxAptioFixDrv/OsxAptioFix3Drv.inf - MemoryFix/OsxLowMemFixDrv/OsxLowMemFixDrv.inf - MemoryFix/AptioMemoryFix/AptioMemoryFix.inf +# MemoryFix/OsxAptioFixDrv/OsxAptioFix3Drv.inf +# MemoryFix/OsxLowMemFixDrv/OsxLowMemFixDrv.inf +# MemoryFix/AptioMemoryFix/AptioMemoryFix.inf OpenCorePkg/Platform/OpenRuntime/OpenRuntime.inf -!ifdef DEBUG_ON_SERIAL_PORT - MemoryFix/OsxAptioFixDrv/OsxAptioFixDrv.inf { +#!ifdef DEBUG_ON_SERIAL_PORT +# MemoryFix/OsxAptioFixDrv/OsxAptioFixDrv.inf { # # Enable debug output. # - - gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x07 - gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xFFFFFFFF - - SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf - DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf - DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf - } - !else - MemoryFix/OsxAptioFixDrv/OsxAptioFixDrv.inf - !endif +# +# gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x07 +# gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xFFFFFFFF +# +# SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf +# DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf +# DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf +# } +# !else +# MemoryFix/OsxAptioFixDrv/OsxAptioFixDrv.inf +# !endif ################################################################################################### # diff --git a/Library/CppMemLib/CppMemLib.inf b/Library/CppMemLib/CppMemLib.inf new file mode 100644 index 000000000..1c52b3abf --- /dev/null +++ b/Library/CppMemLib/CppMemLib.inf @@ -0,0 +1,48 @@ +## @file +# Timer Library implementation for Boot Timer moudles that require timer services. +# +# Timer Library that uses CPU resources to provide calibrated +# delays on IA-32 and x64, and uses ITC on IPF. Note: Because CpuLocalApci +# and ITC could be programmed by OS, it cannot be used by SMM drivers +# and runtime drivers, ACPI timer is recommended for SMM drivers and RUNTIME +# drivers. +# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = CppMemLib + FILE_GUID = 36EE1675-86FF-4059-99D6-405CEB03196D + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = CppMemLib + + +# +# VALID_ARCHITECTURES = IA32 X64 +# + +[Sources] + memory.cpp + +[Packages] + MdePkg/MdePkg.dec + +[LibraryClasses] + BaseLib + DebugLib + HobLib + IoLib + + +[BuildOptions] + MSFT:*_*_*_CC_FLAGS = /GL- diff --git a/Library/CppMemLib/memory.cpp b/Library/CppMemLib/memory.cpp new file mode 100755 index 000000000..b3f2c0217 --- /dev/null +++ b/Library/CppMemLib/memory.cpp @@ -0,0 +1,40 @@ +// +// memory.cpp +// +// Created by Jief on 30/10/2020. +// + + +extern "C" { + +#include + +/* + * memset and memcpy has to be provided for clang + */ + + +#ifdef __GNUC__ + void* memset(void* dst, int ch, UINTN count) __attribute__ ((used)); + //void* memcpy(void* dst, const void* src, UINT64 count) __attribute__ ((used)); +#else +// void* memset(void* dst, int ch, UINT64 count); + //void* memcpy(void* dst, const void* src, UINT64 count); +#endif + +void* memset(void* dst, int ch, UINTN count) +{ + SetMem(dst, count, (UINT8)(ch)); + return dst; +} + +void* memcpy(void* dst, const void* src, UINTN count) +{ + CopyMem(dst, src, count); + return dst; +} + + + +} // extern "C" + diff --git a/Library/CppMemLib/memory.h b/Library/CppMemLib/memory.h new file mode 100644 index 000000000..eba95b83e --- /dev/null +++ b/Library/CppMemLib/memory.h @@ -0,0 +1,8 @@ +// +// memory.cpp +// +// Created by Jief on 30/10/2020. +// + + + diff --git a/Library/MemLogLibDefault/printf_lite.c b/Library/MemLogLibDefault/printf_lite.c index f1e7178a8..d63fb502a 100644 --- a/Library/MemLogLibDefault/printf_lite.c +++ b/Library/MemLogLibDefault/printf_lite.c @@ -579,6 +579,12 @@ uint32_t getUptimeInMilliseconds() time /= 1000; return (uint32_t)(time); } + +#elif _MSC_VER + +#include +//#include + #endif #endif //PRINTF_LITE_TIMESTAMP_SUPPORT @@ -602,24 +608,33 @@ static void print_longlong(INT_BIGGEST_TYPE v, unsigned int base, PrintfParams* #if PRINTF_LITE_TIMESTAMP_SUPPORT == 1 && PRINTF_LITE_TIMESTAMP_CUSTOM_FUNCTION == 0 static void print_timestamp(PrintfParams* printfParams) { - #ifdef USE_HAL_DRIVER - uint32_t ms = HAL_GetTick(); + #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(__NT__) + SYSTEMTIME systime; + GetSystemTime(&systime); + uint32_t ms = systime.wMilliseconds; + uint32_t s = systime.wSecond; + uint32_t m = systime.wMinute; + uint32_t h = systime.wHour; + #else + #ifdef USE_HAL_DRIVER + uint32_t ms = HAL_GetTick(); + #endif + #ifdef ARDUINO + uint32_t ms = millis(); + #endif + #ifdef NRF51 + uint32_t p_ticks; + uint32_t error_code = app_timer_cnt_get(&p_ticks); + APP_ERROR_CHECK(error_code); + uint32_t ms = p_ticks * ((NRF_RTC1->PRESCALER + 1) * 1000) / APP_TIMER_CLOCK_FREQ; + #endif + #ifdef __APPLE__ + uint32_t ms = getUptimeInMilliseconds(); + #endif + uint32_t s = ms / 1000; + uint32_t m = s / 60; + uint32_t h = m / 60; #endif - #ifdef ARDUINO - uint32_t ms = millis(); - #endif - #ifdef NRF51 - uint32_t p_ticks; - uint32_t error_code = app_timer_cnt_get(&p_ticks); - APP_ERROR_CHECK(error_code); - uint32_t ms = p_ticks * ( ( NRF_RTC1->PRESCALER + 1 ) * 1000 ) / APP_TIMER_CLOCK_FREQ; - #endif - #ifdef __APPLE__ - uint32_t ms = getUptimeInMilliseconds(); - #endif - uint32_t s = ms/1000; - uint32_t m = s/60; - uint32_t h = m/60; m %= 60; s %= 60; ms %= 1000; diff --git a/OpenCorePkg b/OpenCorePkg index 1ee382fc4..b7bf17e32 160000 --- a/OpenCorePkg +++ b/OpenCorePkg @@ -1 +1 @@ -Subproject commit 1ee382fc422ab49e219a00a39a25e4f9b4ce8325 +Subproject commit b7bf17e323c91043ef4838369df0717af6f347a9 diff --git a/VC/Clover/.gitignore b/VC/Clover/.gitignore new file mode 100644 index 000000000..51b113743 --- /dev/null +++ b/VC/Clover/.gitignore @@ -0,0 +1,2 @@ +.vs +x64 \ No newline at end of file diff --git a/VC/Clover/Clover.props b/VC/Clover/Clover.props new file mode 100755 index 000000000..92096a4f3 --- /dev/null +++ b/VC/Clover/Clover.props @@ -0,0 +1,44 @@ + + + + + + $(ProjectDir)..\..\rEFIt_UEFI\Platform\Posix;$(ProjectDir)..\..\rEFIt_UEFI\include;$(ProjectDir)..\..\rEFIt_UEFI\libeg;$(ProjectDir)..\..\rEFIt_UEFI\entry_scan;$(ProjectDir)..\..\rEFIt_UEFI\refit;$(ProjectDir)..\..\rEFIt_UEFI\fv2;$(ProjectDir)..\..\rEFIt_UEFI\fv2\rijndael;$(ProjectDir)..\..\rEFIt_UEFI\Platform;$(ProjectDir)..\..\rEFIt_UEFI\cpp_unit_test;$(ProjectDir)..\..\rEFIt_UEFI;$(ProjectDir)..\..\Include;$(ProjectDir)..\..\UefiCpuPkg\Include;$(ProjectDir)..\..\Include\Library;$(ProjectDir)..\..\MdePkg;$(ProjectDir)..\..\MdePkg/Include;$(ProjectDir)..\..\MdePkg/Include/X64;$(ProjectDir)..\..\MdeModulePkg;$(ProjectDir)..\..\MdeModulePkg/Include;$(ProjectDir)..\..\IntelFrameworkPkg;$(ProjectDir)..\..\IntelFrameworkPkg/Include;$(ProjectDir)..\..\IntelFrameworkModulePkg;$(ProjectDir)..\..\IntelFrameworkModulePkg/Include;$(ProjectDir)..\..\EdkCompatibilityPkg;$(ProjectDir)..\..\EdkCompatibilityPkg/Compatibility/Include;$(ProjectDir)..\..\StdLib;$(ProjectDir)..\..\StdLib/Include;$(ProjectDir)..\..\StdLib/Include/X64;$(ProjectDir)..\..\OpenCorePkg;$(ProjectDir)..\..\OpenCorePkg\Include\Acidanthera;$(ProjectDir)..\..\OpenCorePkg\User\Include;$(ProjectDir)..\..\OpenCorePkg\Include\Apple;$(ProjectDir)..\..\OpenCorePkg\Include\VMWare;$(ProjectDir)..\..\OpenCorePkg\Include\Intel;$(ProjectDir)..\..\Library\OpensslLib\Include;$(IncludePath) + + + + ProgramDatabase + + + + + false + + + + + Level4 + _UNICODE;UNICODE;%(PreprocessorDefinitions);CLOVER_DEBUG;_LIB;JCONST=const;STRING_ARRAY_NAME=CLOVERStrings;EFIAPI=;MDEPKG_NDEBUG;CLOVER_BUILD;AMD_SUPPORT;LODEPNG;ANDX86;DEBUG_ON_SERIAL_PORT;JIEF_DEBUG + false + Default + + false + false + $(ProjectDir)..\..\Build/Clover/RELEASE_VS2017/X64/rEFIt_UEFI/refit/DEBUG/AutoGen.h + true + $(ProjectDir)..\..\rEFIt_UEFI\Platform\Posix;$(ProjectDir)..\..\rEFIt_UEFI;$(ProjectDir)..\..\rEFIt_UEFI\libeg;$(ProjectDir)..\..\rEFIt_UEFI\entry_scan;$(ProjectDir)..\..\rEFIt_UEFI\refit;$(ProjectDir)..\..\rEFIt_UEFI\fv2;$(ProjectDir)..\..\rEFIt_UEFI\fv2\rijndael;$(ProjectDir)..\..\rEFIt_UEFI\Platform;$(ProjectDir)..\..\Include;$(ProjectDir)..\..\MdePkg;$(ProjectDir)..\..\MdePkg/Include;$(ProjectDir)..\..\MdePkg/Include/X64;$(ProjectDir)..\..\MdeModulePkg;$(ProjectDir)..\..\MdeModulePkg/Include;$(ProjectDir)..\..\IntelFrameworkPkg;$(ProjectDir)..\..\IntelFrameworkPkg/Include;$(ProjectDir)..\..\IntelFrameworkModulePkg;$(ProjectDir)..\..\IntelFrameworkModulePkg/Include;$(ProjectDir)..\..\EdkCompatibilityPkg;$(ProjectDir)..\..\EdkCompatibilityPkg/Compatibility/Include;$(ProjectDir)..\..\StdLib;$(ProjectDir)..\..\StdLib/Include;$(ProjectDir)..\..\StdLib/Include/X64;$(IncludePath) + false + /Gs32768 %(AdditionalOptions) + + + cmd /c echo %cd% + + + $(ProjectDir)\LinkCmd.bat $(TargetDir) $(TargetFileName) + + + Generate EFI + + + + \ No newline at end of file diff --git a/VC/Clover/Clover.sln b/VC/Clover/Clover.sln new file mode 100755 index 000000000..aaf6e3ded --- /dev/null +++ b/VC/Clover/Clover.sln @@ -0,0 +1,29 @@ +ο»Ώ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.572 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CloverX64", "Clover.vcxproj", "{28BACFE9-9CB5-4518-A18F-C83F4F2CEAD3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28BACFE9-9CB5-4518-A18F-C83F4F2CEAD3}.Debug|x64.ActiveCfg = Debug|x64 + {28BACFE9-9CB5-4518-A18F-C83F4F2CEAD3}.Debug|x64.Build.0 = Debug|x64 + {28BACFE9-9CB5-4518-A18F-C83F4F2CEAD3}.Debug|x86.ActiveCfg = Debug|x64 + {28BACFE9-9CB5-4518-A18F-C83F4F2CEAD3}.Release|x64.ActiveCfg = Release|x64 + {28BACFE9-9CB5-4518-A18F-C83F4F2CEAD3}.Release|x64.Build.0 = Release|x64 + {28BACFE9-9CB5-4518-A18F-C83F4F2CEAD3}.Release|x86.ActiveCfg = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6B685F59-139E-43D5-A24C-0A24F5E6EE87} + EndGlobalSection +EndGlobal diff --git a/VC/Clover/Clover.vcxproj b/VC/Clover/Clover.vcxproj new file mode 100755 index 000000000..6d4d9a94b --- /dev/null +++ b/VC/Clover/Clover.vcxproj @@ -0,0 +1,375 @@ + + + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {28BACFE9-9CB5-4518-A18F-C83F4F2CEAD3} + Win32Proj + Clover + 10.0.17763.0 + CloverX64 + + + + StaticLibrary + true + v141 + Unicode + + + StaticLibrary + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + true + + + false + $(ProjectDir)..\..\rEFIt_UEFI;$(ProjectDir)..\..\rEFIt_UEFI\libeg;$(ProjectDir)..\..\rEFIt_UEFI\entry_scan;$(ProjectDir)..\..\rEFIt_UEFI\refit;$(ProjectDir)..\..\rEFIt_UEFI\fv2;$(ProjectDir)..\..\rEFIt_UEFI\fv2\rijndael;$(ProjectDir)..\..\rEFIt_UEFI\Platform;$(ProjectDir)..\..\Include;$(ProjectDir)..\..\OpensslLib\Include;$(ProjectDir)..\..\OpensslLib\openssl-1.0.1e\include;$(ProjectDir)..\..\MdePkg;$(ProjectDir)..\..\MdePkg/Include;$(ProjectDir)..\..\MdePkg/Include/X64;$(ProjectDir)..\..\MdeModulePkg;$(ProjectDir)..\..\MdeModulePkg/Include;$(ProjectDir)..\..\IntelFrameworkPkg;$(ProjectDir)..\..\IntelFrameworkPkg/Include;$(ProjectDir)..\..\IntelFrameworkModulePkg;$(ProjectDir)..\..\IntelFrameworkModulePkg/Include;$(ProjectDir)..\..\EdkCompatibilityPkg;$(ProjectDir)..\..\EdkCompatibilityPkg/Compatibility/Include;$(ProjectDir)..\..\StdLib;$(ProjectDir)..\..\StdLib/Include;$(ProjectDir)..\..\StdLib/Include/X64;$(IncludePath) + + + + + + + + Windows + true + + + + + + + NotUsing + Level4 + MinSpace + false + false + + + NDEBUG;_LIB;%(PreprocessorDefinitions);JCONST=const;STRING_ARRAY_NAME=CLOVERStrings;EFIAPI=;MDEPKG_NDEBUG;CLOVER_BUILD;AMD_SUPPORT;LODEPNG;ANDX86;DEBUG_ON_SERIAL_PORT + true + $(ProjectDir)..\..\Build/Clover/RELEASE_VS2017/X64/rEFIt_UEFI/refit/DEBUG/AutoGen.h + false + false + true + false + false + ProgramDatabase + + + false + Size + true + /NODEFAULTLIB %(AdditionalOptions) + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VC/Clover/Clover.vcxproj.filters b/VC/Clover/Clover.vcxproj.filters new file mode 100755 index 000000000..6c17675e0 --- /dev/null +++ b/VC/Clover/Clover.vcxproj.filters @@ -0,0 +1,848 @@ +ο»Ώ + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {b28287be-3608-43a6-af0b-868dd39b423f} + + + {0bde2c30-5390-4a0e-908d-03fbd067e279} + + + {31e95a1f-5415-4332-80b2-199b869c544a} + + + {70c6e14b-9aa2-43d2-9518-14074c5dd80d} + + + {f598a647-b681-4c85-8984-1088ea0f8ac2} + + + {153ba83d-3aab-4183-89b7-05d27a341169} + + + {0baad5e7-b174-49bf-9fc6-5b90a9a7ebfe} + + + {c124aab0-66f9-4e6a-9e7a-be127c650f31} + + + {c64dc9b0-ac27-45bf-82e9-923d232ad3af} + + + {7dd0ed85-7ee5-4f6a-9fe9-9847efbeaff8} + + + {1536825f-c4e7-4ab6-b33c-e07f03669f4d} + + + {99ed8aa3-2e39-41f8-bd25-0003afe59992} + + + + + Source Files\refit + + + Source Files\refit + + + Source Files\refit + + + Source Files\refit + + + Source Files\refit + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\cpp_util + + + Source Files\cpp_util + + + Source Files\cpp_util + + + Source Files\Build + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\cpp_unit_test + + + Source Files\gui + + + Source Files\gui\menu_items + + + Source Files\cpp_foundation + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\Platform\Posix + + + Source Files\Platform\Posix + + + Source Files\cpp_unit_test + + + Source Files\Platform\Posix + + + Source Files\Platform\Posix + + + Source Files\Platform + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_foundation + + + Source Files\libeg + + + Source Files\gui + + + Source Files\cpp_foundation + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\libeg + + + Source Files\cpp_foundation + + + Source Files\cpp_foundation + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\Posix + + + Source Files\libeg + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\cpp_util + + + + + Source Files\refit + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\cpp_util + + + Source Files\cpp_util + + + Source Files\cpp_util + + + Source Files\cpp_util + + + Source Files\cpp_foundation + + + Source Files\cpp_foundation + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\entry_scan + + + Source Files\entry_scan + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\cpp_unit_test + + + Source Files\gui + + + Source Files\gui\menu_items + + + Source Files\gui\menu_items + + + Source Files\cpp_foundation + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\Platform\Posix + + + Source Files\Platform\Posix + + + Source Files\Platform\Posix + + + Source Files\Platform\Posix + + + Source Files\Platform\Posix + + + Source Files\Platform\Posix + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\Platform\Posix + + + Source Files\Platform\Posix + + + Source Files\Platform\Posix + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_foundation + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\gui + + + Source Files\cpp_foundation + + + Source Files\cpp_foundation + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\libeg + + + Source Files\Platform\Posix + + + Source Files\cpp_foundation + + + Source Files\cpp_foundation + + + Source Files\cpp_foundation + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\cpp_unit_test + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\plist + + + Source Files\Platform\Posix + + + Source Files\libeg + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + Source Files\Platform + + + + + Source Files\libeg + + + \ No newline at end of file diff --git a/VC/Clover/Clover.vcxproj.user b/VC/Clover/Clover.vcxproj.user new file mode 100755 index 000000000..6e2aec7ae --- /dev/null +++ b/VC/Clover/Clover.vcxproj.user @@ -0,0 +1,4 @@ +ο»Ώ + + + \ No newline at end of file diff --git a/VC/Clover/CloverDebug.props b/VC/Clover/CloverDebug.props new file mode 100755 index 000000000..08b2b3e9f --- /dev/null +++ b/VC/Clover/CloverDebug.props @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/VC/Clover/LinkCmd.bat b/VC/Clover/LinkCmd.bat new file mode 100644 index 000000000..08deced10 --- /dev/null +++ b/VC/Clover/LinkCmd.bat @@ -0,0 +1,76 @@ +@echo off +set curdir=%cd% + +set TARGETDIR=.\x64\Debug +if NOT ["%~1"] == [""] ( + set TARGETDIR=%~1 +) +IF %TARGETDIR:~-1%==\ SET TARGETDIR=%TARGETDIR:~0,-1% + +set TARGETFILENAME=CloverX64.lib +if NOT ["%~2"] == [""] ( + set TARGETFILENAME=%~2 +) +for %%i in (%TARGETFILENAME%) do @set TARGETBASENAME=%%~ni + +set GENFWPATH=..\..\BaseTools\Bin\Win32\GenFw.exe + + +rem echo curdir=%curdir% +rem @echo TARGETDIR=%TARGETDIR% +rem @echo TARGETFILENAME=%TARGETFILENAME% +rem @echo TARGETBASENAME=%TARGETBASENAME% +rem @echo GENFWPATH=%GENFWPATH% + + +if NOT exist "Clover.vcxproj" ( + echo This script must be run from VC++ Clover project dir, which nust be 2 levels down from main Clover folder. + cd %curdir% + exit /b 1 +) + +if NOT exist "%GENFWPATH%" ( + echo The VC++ Clover project dir must 2 levels down from main Clover folder. GenFW must be found at %GENFWPATH%. + cd %curdir% + exit /b 1 +) + + +if not exist "%TARGETDIR%" ( + echo Target dir doesn't exist + cd %curdir% + exit /b 1 +) + +del %TARGETDIR%\static_library_files.lst +FOR /F "tokens=* skip=1" %%A IN ('type "..\..\Build\Clover\RELEASE_VS2017\X64\rEFIt_UEFI\refit\OUTPUT\static_library_files.lst"') DO @echo %%A >> %TARGETDIR%\static_library_files.lst +rem @echo "/JiefLand/5.Devel/Clover/Clover-projects/Clover--CloverHackyColor--masterVC/VC/Clover/x64/Debug/StaticLib1.lib" >> %TARGETDIR%\static_library_files.lst + +rem ..\..\BaseTools\get_vsvars.bat <- not needed when it's called from VS ide + +rem /IGNORE:4210 = .CRT section exists; there may be unhandled static initializers or terminators +rem /IGNORE:4254 +rem /WHOLEARCHIVE : makes __chkstk to come up + +rem edkII link cmd +rem "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x64\link.exe" /OUT:c:\users\jief\cloverbootloader_synced\Build\Clover\DEBUG_VS2017\X64\rEFIt_UEFI\refit\DEBUG\CLOVERX64.dll +rem /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4281 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:_ModuleEntryPoint /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG /WHOLEARCHIVE +rem @c:\users\jief\cloverbootloader_synced\Build\Clover\DEBUG_VS2017\X64\rEFIt_UEFI\refit\OUTPUT\static_library_files.lst + +rem .cod seems to be generated in current dir. Didn't find options t change that. /Fa is for compiler, not linker. +cd %TARGETDIR% +link.exe /OUT:%TARGETBASENAME%.dll /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4281 /IGNORE:4210 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:_ModuleEntryPoint /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG /WHOLEARCHIVE %TARGETFILENAME% @static_library_files.lst + +if %ERRORLEVEL% neq 0 ( + cd %curdir% + exit /b %ERRORLEVEL% +) +cd %curdir% + + +%GENFWPATH% -e UEFI_APPLICATION -o %TARGETDIR%\%TARGETBASENAME%.efi %TARGETDIR%\%TARGETBASENAME%.dll +if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + +echo EFI generated in %TARGETDIR%\%TARGETBASENAME%.efi + +cd %curdir% diff --git a/VC/cpp_tests/.gitignore b/VC/cpp_tests/.gitignore new file mode 100644 index 000000000..51b113743 --- /dev/null +++ b/VC/cpp_tests/.gitignore @@ -0,0 +1,2 @@ +.vs +x64 \ No newline at end of file diff --git a/VC/cpp_tests/cpp_tests.cpp b/VC/cpp_tests/cpp_tests.cpp new file mode 100755 index 000000000..d928db7df --- /dev/null +++ b/VC/cpp_tests/cpp_tests.cpp @@ -0,0 +1,21 @@ +// cpp_tests.cpp : This file contains the 'main' function. Program execution begins and ends there. +// + +#include "pch.h" +#include + +int main() +{ + std::cout << "Hello World!\n"; +} + +// Run program: Ctrl + F5 or Debug > Start Without Debugging menu +// Debug program: F5 or Debug > Start Debugging menu + +// Tips for Getting Started: +// 1. Use the Solution Explorer window to add/manage files +// 2. Use the Team Explorer window to connect to source control +// 3. Use the Output window to see build output and other messages +// 4. Use the Error List window to view errors +// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project +// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file diff --git a/VC/cpp_tests/cpp_tests.sln b/VC/cpp_tests/cpp_tests.sln new file mode 100755 index 000000000..dd3190bb5 --- /dev/null +++ b/VC/cpp_tests/cpp_tests.sln @@ -0,0 +1,31 @@ +ο»Ώ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.572 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp_tests", "cpp_tests.vcxproj", "{A9404CF4-84F9-4E75-AF2D-08BEA4563984}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A9404CF4-84F9-4E75-AF2D-08BEA4563984}.Debug|x64.ActiveCfg = Debug|x64 + {A9404CF4-84F9-4E75-AF2D-08BEA4563984}.Debug|x64.Build.0 = Debug|x64 + {A9404CF4-84F9-4E75-AF2D-08BEA4563984}.Debug|x86.ActiveCfg = Debug|Win32 + {A9404CF4-84F9-4E75-AF2D-08BEA4563984}.Debug|x86.Build.0 = Debug|Win32 + {A9404CF4-84F9-4E75-AF2D-08BEA4563984}.Release|x64.ActiveCfg = Release|x64 + {A9404CF4-84F9-4E75-AF2D-08BEA4563984}.Release|x64.Build.0 = Release|x64 + {A9404CF4-84F9-4E75-AF2D-08BEA4563984}.Release|x86.ActiveCfg = Release|Win32 + {A9404CF4-84F9-4E75-AF2D-08BEA4563984}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6655DE74-29C8-416B-A174-CDAC2E65FF2E} + EndGlobalSection +EndGlobal diff --git a/VC/cpp_tests/cpp_tests.vcxproj b/VC/cpp_tests/cpp_tests.vcxproj new file mode 100755 index 000000000..7f0504419 --- /dev/null +++ b/VC/cpp_tests/cpp_tests.vcxproj @@ -0,0 +1,251 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {A9404CF4-84F9-4E75-AF2D-08BEA4563984} + Win32Proj + cpptests + 10.0.17763.0 + + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + Application + true + v141 + MultiByte + + + Application + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + false + $(VC_IncludePath);$(WindowsSDK_IncludePath);$(ProjectDir)..\..\Xcode\cpp_tests\src + + + true + $(ProjectDir)..\..\Xcode\cpp_tests\Include;$(IncludePath) + + + true + $(ProjectDir)..\..\Xcode\cpp_tests\Include;$(IncludePath) + + + false + + + + NotUsing + Level3 + MaxSpeed + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + Platform.h + + + Console + true + true + true + + + + + NotUsing + Level4 + Disabled + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS + true + pch.h + + + $(ProjectDir)..\..\Xcode\cpp_tests\src;%(AdditionalIncludeDirectories) + + + Console + true + + + + + NotUsing + Level3 + Disabled + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions);JIEF_DEBUG;_CRT_SECURE_NO_WARNINGS + true + pch.h + + + true + + + Console + true + + + + + Use + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VC/cpp_tests/cpp_tests.vcxproj.filters b/VC/cpp_tests/cpp_tests.vcxproj.filters new file mode 100755 index 000000000..ab53359a0 --- /dev/null +++ b/VC/cpp_tests/cpp_tests.vcxproj.filters @@ -0,0 +1,294 @@ +ο»Ώ + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {0eb9ee83-e942-4504-bfde-d42542898c74} + + + {68f7932a-49b8-45c5-a599-da63d018e1fe} + + + {21b60de7-bb94-4ac5-bac8-b79a9c88775d} + + + {91d21a18-1701-47ea-a922-90a90916a62f} + + + {c776985f-215b-4860-b2b0-4f504f3fa26f} + + + {a313aceb-1b40-4fe8-b768-5432f63f0889} + + + {818eaf6f-6a37-48ed-bc8a-3aa1628831e1} + + + {d8380316-a9d9-4613-8d7e-a7cafecc6e6e} + + + {390fde59-3d76-4cf1-a6a4-bca5e76a996e} + + + {a4caa291-23a2-4e96-bdc6-c75e7cad4eb5} + + + + + Header Files + + + rEFIT_UEFI Source Files\cpp_foundation + + + rEFIT_UEFI Source Files\cpp_foundation + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_foundation + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_foundation + + + rEFIT_UEFI Source Files\cpp_foundation + + + rEFIT_UEFI Source Files\cpp_foundation + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\Platform\Posix + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + cpp_tests Source\Include + + + cpp_tests Source\Include + + + cpp_tests Source\Include + + + cpp_tests Source\Include + + + cpp_tests Source\Include + + + cpp_tests Source\Include + + + cpp_tests Source\Include + + + cpp_tests Source + + + cpp_tests Source + + + cpp_tests Source + + + rEFIT_UEFI Source Files\cpp_foundation + + + rEFIT_UEFI Source Files\cpp_foundation + + + rEFIT_UEFI Source Files\cpp_foundation + + + rEFIT_UEFI Source Files\Platform + + + cpp_tests Source\Include\Library + + + cpp_tests Source\Include\Library + + + cpp_tests Source\Include\Library + + + cpp_tests Source\Include\Library + + + cpp_tests Source\Include\Library + + + cpp_tests Source\Include\Library + + + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_foundation + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_foundation + + + rEFIT_UEFI Source Files\cpp_foundation + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\MemLog + + + rEFIT_UEFI Source Files\Platform\Posix + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + rEFIT_UEFI Source Files\cpp_unit_test + + + cpp_tests Source + + + cpp_tests Source + + + cpp_tests Source + + + rEFIT_UEFI Source Files\cpp_foundation + + + rEFIT_UEFI Source Files\cpp_foundation + + + rEFIT_UEFI Source Files\Platform + + + cpp_tests Source\Include\Library + + + cpp_tests Source\Include\Library + + + cpp_tests Source\Include\Library + + + OpenCorePkg + + + \ No newline at end of file diff --git a/VC/cpp_tests/cpp_tests.vcxproj.user b/VC/cpp_tests/cpp_tests.vcxproj.user new file mode 100755 index 000000000..6e2aec7ae --- /dev/null +++ b/VC/cpp_tests/cpp_tests.vcxproj.user @@ -0,0 +1,4 @@ +ο»Ώ + + + \ No newline at end of file diff --git a/VC/cpp_tests/pch.cpp b/VC/cpp_tests/pch.cpp new file mode 100755 index 000000000..a30585a1d --- /dev/null +++ b/VC/cpp_tests/pch.cpp @@ -0,0 +1,5 @@ +// pch.cpp: source file corresponding to pre-compiled header; necessary for compilation to succeed + +#include "pch.h" + +// In general, ignore this file, but keep it around if you are using pre-compiled headers. diff --git a/VC/cpp_tests/pch.h b/VC/cpp_tests/pch.h new file mode 100755 index 000000000..c94c19db5 --- /dev/null +++ b/VC/cpp_tests/pch.h @@ -0,0 +1,14 @@ +// Tips for Getting Started: +// 1. Use the Solution Explorer window to add/manage files +// 2. Use the Team Explorer window to connect to source control +// 3. Use the Output window to see build output and other messages +// 4. Use the Error List window to view errors +// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project +// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file + +#ifndef PCH_H +#define PCH_H + +// TODO: add headers that you want to pre-compile here + +#endif //PCH_H diff --git a/Xcode/cpp_tests/Include/Library/Base.h b/Xcode/cpp_tests/Include/Library/Base.h index dd4af467f..88edbe84a 100644 --- a/Xcode/cpp_tests/Include/Library/Base.h +++ b/Xcode/cpp_tests/Include/Library/Base.h @@ -11,6 +11,16 @@ #include +#if defined(_MSC_VER) + +#define VA_LIST va_list +#define VA_START(Marker, Parameter) va_start (Marker, Parameter) +#define VA_ARG(Marker, TYPE) va_arg(Marker, TYPE) +#define VA_END(Marker) va_end (Marker) +#define VA_COPY(Dest, Start) va_copy(Dest, Start) + +#else + typedef __builtin_va_list VA_LIST; #define VA_START(Marker, Parameter) __builtin_va_start (Marker, Parameter) @@ -21,5 +31,7 @@ typedef __builtin_va_list VA_LIST; #define VA_COPY(Dest, Start) __builtin_va_copy (Dest, Start) +#endif + #endif /* Base_h */ diff --git a/Xcode/cpp_tests/src/Platform.h b/Xcode/cpp_tests/Include/Platform.h old mode 100755 new mode 100644 similarity index 96% rename from Xcode/cpp_tests/src/Platform.h rename to Xcode/cpp_tests/Include/Platform.h index c994d22cc..be9675946 --- a/Xcode/cpp_tests/src/Platform.h +++ b/Xcode/cpp_tests/Include/Platform.h @@ -14,9 +14,11 @@ #endif #include "Uefi.h" +#include "../Include/Library/Base.h" #include "../Include/Library/BaseLib.h" #include "../Include/Library/BaseMemoryLib.h" #include "../../../rEFIt_UEFI/Platform/Utils.h" +#include #include #include #include @@ -66,5 +68,4 @@ void FreePool(const void* Buffer); CHAR16* EfiStrDuplicate (IN CONST CHAR16 *Src); - #endif /* Platform_h_h */ diff --git a/Xcode/cpp_tests/src/Uefi.h b/Xcode/cpp_tests/Include/Uefi.h similarity index 100% rename from Xcode/cpp_tests/src/Uefi.h rename to Xcode/cpp_tests/Include/Uefi.h diff --git a/Xcode/cpp_tests/src/XToolsConf.h b/Xcode/cpp_tests/Include/XToolsConf.h similarity index 100% rename from Xcode/cpp_tests/src/XToolsConf.h rename to Xcode/cpp_tests/Include/XToolsConf.h diff --git a/Xcode/cpp_tests/src/poolprint-test-cpp_conf.h b/Xcode/cpp_tests/Include/poolprint-test-cpp_conf.h similarity index 100% rename from Xcode/cpp_tests/src/poolprint-test-cpp_conf.h rename to Xcode/cpp_tests/Include/poolprint-test-cpp_conf.h diff --git a/Xcode/cpp_tests/src/poolprintfloat-test-cpp_conf.h b/Xcode/cpp_tests/Include/poolprintfloat-test-cpp_conf.h similarity index 100% rename from Xcode/cpp_tests/src/poolprintfloat-test-cpp_conf.h rename to Xcode/cpp_tests/Include/poolprintfloat-test-cpp_conf.h diff --git a/Xcode/cpp_tests/src/posix.h b/Xcode/cpp_tests/Include/posix.h similarity index 100% rename from Xcode/cpp_tests/src/posix.h rename to Xcode/cpp_tests/Include/posix.h diff --git a/Xcode/cpp_tests/src/printf_lite-conf.h b/Xcode/cpp_tests/Include/printf_lite-conf.h similarity index 100% rename from Xcode/cpp_tests/src/printf_lite-conf.h rename to Xcode/cpp_tests/Include/printf_lite-conf.h diff --git a/Xcode/cpp_tests/src/printf_lite-test-cpp_conf.h b/Xcode/cpp_tests/Include/printf_lite-test-cpp_conf.h similarity index 100% rename from Xcode/cpp_tests/src/printf_lite-test-cpp_conf.h rename to Xcode/cpp_tests/Include/printf_lite-test-cpp_conf.h diff --git a/Xcode/cpp_tests/src/printlib-test-cpp_conf.h b/Xcode/cpp_tests/Include/printlib-test-cpp_conf.h similarity index 100% rename from Xcode/cpp_tests/src/printlib-test-cpp_conf.h rename to Xcode/cpp_tests/Include/printlib-test-cpp_conf.h diff --git a/Xcode/cpp_tests/src/xcode_utf_fixed.h b/Xcode/cpp_tests/Include/xcode_utf_fixed.h similarity index 100% rename from Xcode/cpp_tests/src/xcode_utf_fixed.h rename to Xcode/cpp_tests/Include/xcode_utf_fixed.h diff --git a/rEFIt_UEFI/Platform/FixBiosDsdt.cpp b/rEFIt_UEFI/Platform/FixBiosDsdt.cpp index e44aab3cb..de23f03e2 100755 --- a/rEFIt_UEFI/Platform/FixBiosDsdt.cpp +++ b/rEFIt_UEFI/Platform/FixBiosDsdt.cpp @@ -1805,11 +1805,11 @@ UINT32 FixAny (UINT8* dsdt, UINT32 len, const XBuffer ToFind, const XBuff // MsgLog(" (%X)", adr); found = TRUE; - len = move_data(adr + i, dsdt, len, (INT32)sizeoffset); // safe cast, sizeoffset > MAX_INT32 + len = move_data(adr + i, dsdt, len, (INT32)sizeoffset); // safe cast, sizeoffset < MAX_INT32 CopyMem(dsdt + adr + i, ToReplace.data(), ToReplace.size()); - len = CorrectOuterMethod(dsdt, len, adr + i - 2, (INT32)sizeoffset); // safe cast, sizeoffset > MAX_INT32 - len = CorrectOuters(dsdt, len, adr + i - 3, (INT32)sizeoffset); // safe cast, sizeoffset > MAX_INT32 - i += adr + ToReplace.size(); + len = CorrectOuterMethod(dsdt, len, adr + i - 2, (INT32)sizeoffset); // safe cast, sizeoffset < MAX_INT32 + len = CorrectOuters(dsdt, len, adr + i - 3, (INT32)sizeoffset); // safe cast, sizeoffset < MAX_INT32 + i += (UINT32)(adr + ToReplace.size()); // if there is no bug before, it should be safe cast. } MsgLog(" ]\n"); //should not be here return len; diff --git a/rEFIt_UEFI/Platform/Posix/abort.cpp b/rEFIt_UEFI/Platform/Posix/abort.cpp old mode 100755 new mode 100644 index 22219f2ab..a4cd56b24 --- a/rEFIt_UEFI/Platform/Posix/abort.cpp +++ b/rEFIt_UEFI/Platform/Posix/abort.cpp @@ -35,8 +35,8 @@ static void panic_(const char* format, VA_LIST va) { #ifdef CLOVER_BUILD egSetGraphicsModeEnabled(false); -#endif printf("Clover build id: %s\n", gBuildId.c_str()); +#endif if ( format ) { vprintf(format, va); #ifdef DEBUG_ON_SERIAL_PORT diff --git a/rEFIt_UEFI/Platform/Posix/string.h b/rEFIt_UEFI/Platform/Posix/string.h index 29c55dac1..a7190f304 100644 --- a/rEFIt_UEFI/Platform/Posix/string.h +++ b/rEFIt_UEFI/Platform/Posix/string.h @@ -22,10 +22,12 @@ inline void* memmove(void *dst, const void *src, size_t len) return CopyMem(dst, (void*)(src), len); } -inline void* memcpy(void *dst, const void *src, size_t len) -{ - return CopyMem(dst,src,len); -} +void* memcpy(void *dst, const void *src, size_t len); + +//inline void* memcpy(void *dst, const void *src, size_t len) +//{ +// return CopyMem(dst,src,len); +//} inline char* strcat(char* s1, const char* s2) { diff --git a/rEFIt_UEFI/Platform/Posix/wchar.h b/rEFIt_UEFI/Platform/Posix/wchar.h old mode 100644 new mode 100755 index cddb792f0..0a7a244ee --- a/rEFIt_UEFI/Platform/Posix/wchar.h +++ b/rEFIt_UEFI/Platform/Posix/wchar.h @@ -3,6 +3,11 @@ #include "stddef.h" // for size_t +#ifdef _MSC_VER +// Looks like VS cannot compile with long wchar. +#define __WCHAR_MAX__ 0xFFFF +#endif + size_t wcslen(const wchar_t *s); int wcsncmp(const wchar_t *s1, const wchar_t * s2, size_t n); diff --git a/rEFIt_UEFI/Platform/Settings.cpp b/rEFIt_UEFI/Platform/Settings.cpp old mode 100644 new mode 100755 index b6a6ddc28..b61499e53 --- a/rEFIt_UEFI/Platform/Settings.cpp +++ b/rEFIt_UEFI/Platform/Settings.cpp @@ -218,7 +218,7 @@ ParseACPIName(const XString8& String) while ((pos1 < Len) && String[pos1] != '.') pos1++; // 3,8,13,18 // if ((pos1 == Len) || (String[pos1] == ',')) { //always for (i = pos0 + 1, j = 0; i < pos1; i++) { - List->Name[j++] = String[i]; + List->Name[j++] = String.data()[i]; // String[i] return a char32_t. what if there is an utf8 char ? } // extend by '_' up to 4 symbols if (j < 4) { @@ -1191,7 +1191,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, if (TmpData == NULL || MaskLen == 0) { } else { - newPatch.MaskFind.memset(FindLen, 0xFF); + newPatch.MaskFind.memset(0xFF, FindLen); newPatch.MaskFind.ncpy(TmpData, MaskLen); } FreePool(TmpData); @@ -1745,7 +1745,9 @@ FillinCustomEntry ( Prop = DictPointer->propertyForKey("Hotkey"); if (Prop != NULL && (Prop->isString()) && Prop->getString()->stringValue().notEmpty()) { - Entry->Hotkey = Prop->getString()->stringValue()[0]; + if ( Prop->getString()->stringValue()[0] < __WCHAR_MAX__ ) { + Entry->Hotkey = (wchar_t)(Prop->getString()->stringValue()[0]); + } } // Whether or not to draw boot screen @@ -2040,7 +2042,9 @@ FillingCustomLegacy ( Prop = DictPointer->propertyForKey("Hotkey"); if (Prop != NULL && (Prop->isString()) && Prop->getString()->stringValue().notEmpty()) { - Entry->Hotkey = Prop->getString()->stringValue()[0]; + if ( Prop->getString()->stringValue()[0] < __WCHAR_MAX__ ) { + Entry->Hotkey = (wchar_t)(Prop->getString()->stringValue()[0]); + } } // Hidden Property, Values: @@ -2136,7 +2140,9 @@ FillingCustomTool (IN OUT CUSTOM_TOOL_ENTRY *Entry, const TagDict* DictPointer) } Prop = DictPointer->propertyForKey("Hotkey"); if (Prop != NULL && (Prop->isString()) && Prop->getString()->stringValue().notEmpty()) { - Entry->Hotkey = Prop->getString()->stringValue()[0]; + if ( Prop->getString()->stringValue()[0] < __WCHAR_MAX__ ) { + Entry->Hotkey = (wchar_t)(Prop->getString()->stringValue()[0]); + } } // Hidden Property, Values: @@ -2444,7 +2450,7 @@ GetEarlyUserSettings ( gSettings.XMPDetection = (INT8)AsciiStrDecimalToUintn(Prop->getString()->stringValue().c_str()); } } else if (Prop->isInt64()) { - gSettings.XMPDetection = Prop->getInt64()->intValue(); + gSettings.XMPDetection = (INT8)Prop->getInt64()->intValue(); } // Check that the setting value is sane if ((gSettings.XMPDetection < -1) || (gSettings.XMPDetection > 2)) { @@ -3005,7 +3011,7 @@ GetEarlyUserSettings ( gSettings.ocBooterQuirks.ProvideCustomSlide = IsPropertyNotNullAndTrue(Prop); gSettings.QuirksMask |= gSettings.ocBooterQuirks.ProvideCustomSlide? QUIRK_CUSTOM:0; Prop = OcQuirksDict->propertyForKey( "ProvideMaxSlide"); - gSettings.ocBooterQuirks.ProvideMaxSlide = GetPropertyAsInteger(Prop, 0); + gSettings.ocBooterQuirks.ProvideMaxSlide = (UINT8)GetPropertyAsInteger(Prop, 0); // cast will be safe when the new parser will ensure that the value is UINT8 Prop = OcQuirksDict->propertyForKey( "RebuildAppleMemoryMap"); gSettings.ocBooterQuirks.RebuildAppleMemoryMap = IsPropertyNotNullAndTrue(Prop); gSettings.QuirksMask |= gSettings.ocBooterQuirks.RebuildAppleMemoryMap? QUIRK_MAP:0; @@ -5747,7 +5753,7 @@ GetUserSettings(const TagDict* CfgDict) if (Prop2->isString() && Prop2->getString()->stringValue().notEmpty() ) { Slot = (UINT8)AsciiStrDecimalToUintn(Prop2->getString()->stringValue()); } else if (Prop2->isInt64()) { - Slot = Prop2->getInt64()->intValue(); + Slot = (UINT8)Prop2->getInt64()->intValue(); } else { continue; } diff --git a/rEFIt_UEFI/Platform/VersionString.cpp b/rEFIt_UEFI/Platform/VersionString.cpp old mode 100644 new mode 100755 index f0b689b44..daa65c793 --- a/rEFIt_UEFI/Platform/VersionString.cpp +++ b/rEFIt_UEFI/Platform/VersionString.cpp @@ -43,7 +43,7 @@ UINT64 AsciiStrVersionToUint64(const XString8& Version_, UINT8 MaxDigitByPart, U size_t idx = 0; while (idx < Version.length() && MaxParts > 0) { //Slice - NULL pointer dereferencing if (Version[idx] >= '0' && Version[idx] <= '9') { - part_value = part_value * 10 + (Version[idx] - '0'); + part_value = part_value * 10 + (UINT16)(Version[idx] - '0'); if (part_value > max_part_value) part_value = max_part_value; } diff --git a/rEFIt_UEFI/Platform/b64cdecode.cpp b/rEFIt_UEFI/Platform/b64cdecode.cpp old mode 100644 new mode 100755 index bca4dc64d..f2c6d7ad9 --- a/rEFIt_UEFI/Platform/b64cdecode.cpp +++ b/rEFIt_UEFI/Platform/b64cdecode.cpp @@ -41,7 +41,7 @@ long base64_decode_block(const char* code_in, const int length_in, char* plainte { state_in->step = step_a; state_in->plainchar = *plainchar; - return plainchar - plaintext_out; + return (long)(plainchar - plaintext_out); // we assume that plainchar - plaintext_out cannot be > MAX_LONG } fragment = base64_decode_value(*codechar++); } while (fragment < 0); @@ -52,7 +52,7 @@ long base64_decode_block(const char* code_in, const int length_in, char* plainte { state_in->step = step_b; state_in->plainchar = *plainchar; - return plainchar - plaintext_out; + return (long)(plainchar - plaintext_out); // we assume that plainchar - plaintext_out cannot be > MAX_LONG } fragment = base64_decode_value(*codechar++); } while (fragment < 0); @@ -64,7 +64,7 @@ long base64_decode_block(const char* code_in, const int length_in, char* plainte { state_in->step = step_c; state_in->plainchar = *plainchar; - return plainchar - plaintext_out; + return (long)(plainchar - plaintext_out); // we assume that plainchar - plaintext_out cannot be > MAX_LONG } fragment = base64_decode_value(*codechar++); } while (fragment < 0); @@ -76,7 +76,7 @@ long base64_decode_block(const char* code_in, const int length_in, char* plainte { state_in->step = step_d; state_in->plainchar = *plainchar; - return plainchar - plaintext_out; + return (long)(plainchar - plaintext_out); // we assume that plainchar - plaintext_out cannot be > MAX_LONG } fragment = base64_decode_value(*codechar++); } while (fragment < 0); @@ -84,7 +84,7 @@ long base64_decode_block(const char* code_in, const int length_in, char* plainte } } /* control should not reach here */ - return plainchar - plaintext_out; + return (long)(plainchar - plaintext_out); // we assume that plainchar - plaintext_out cannot be > MAX_LONG } diff --git a/rEFIt_UEFI/Platform/platformdata.cpp b/rEFIt_UEFI/Platform/platformdata.cpp index 34ba06b51..4b50440db 100644 --- a/rEFIt_UEFI/Platform/platformdata.cpp +++ b/rEFIt_UEFI/Platform/platformdata.cpp @@ -24,24 +24,24 @@ UINT64 gPlatformFeature; class PLATFORMDATA { public: - const XString8 productName; - const XString8 firmwareVersion; - const XString8 efiversion; - const XString8 boardID; - const XString8 productFamily; - const XString8 systemVersion; - const XString8 serialNumber; - const XString8 chassisAsset; + const LString8 productName; + const LString8 firmwareVersion; + const LString8 efiversion; + const LString8 boardID; + const LString8 productFamily; + const LString8 systemVersion; + const LString8 serialNumber; + const LString8 chassisAsset; UINT8 smcRevision[6]; - const XString8 smcBranch; - const XString8 smcPlatform; + const LString8 smcBranch; + const LString8 smcPlatform; UINT32 smcConfig; -// PLATFORMDATA() : productName(), firmwareVersion(), efiversion(), boardID(), productFamily(), systemVersion(), serialNumber(), chassisAsset(), smcRevision{0,0,0,0,0,0}, smcBranch(), smcPlatform(), smcConfig() { } - PLATFORMDATA(const XString8& _productName, const XString8 _firmwareVersion, const XString8 _efiversion, const XString8 _boardID, const XString8 _productFamily, - const XString8 _systemVersion, const XString8 _serialNumber, const XString8 _chassisAsset, + //PLATFORMDATA() : productName(), firmwareVersion(), efiversion(), boardID(), productFamily(), systemVersion(), serialNumber(), chassisAsset(), smcRevision{0,0,0,0,0,0}, smcBranch(), smcPlatform(), smcConfig() { } + PLATFORMDATA(const LString8& _productName, const LString8& _firmwareVersion, const LString8& _efiversion, const LString8& _boardID, const LString8& _productFamily, + const LString8& _systemVersion, const LString8& _serialNumber, const LString8& _chassisAsset, UINT8 _smcRevision0, UINT8 _smcRevision1, UINT8 _smcRevision2, UINT8 _smcRevision3, UINT8 _smcRevision4, UINT8 _smcRevision5, - const XString8 _smcBranch, const XString8 _smcPlatform, UINT32 _smcConfig) + const LString8& _smcBranch, const LString8& _smcPlatform, UINT32 _smcConfig) : productName(_productName), firmwareVersion(_firmwareVersion), efiversion(_efiversion), boardID(_boardID), productFamily(_productFamily), systemVersion(_systemVersion), serialNumber(_serialNumber), chassisAsset(_chassisAsset), smcRevision{0}, smcBranch(_smcBranch), smcPlatform(_smcPlatform), smcConfig(_smcConfig) @@ -97,27 +97,27 @@ public: PLATFORMDATA ApplePlatformData[] = { //MacBook1,1 / MacBook (13-inch) - { "MacBook1,1"_XS8, "MB11.88Z.0061.B03.0610121324"_XS8, NullXString8, "Mac-F4208CC8"_XS8, // Intel Core Duo T2500 @ 2.00 GHz + { "MacBook1,1"_XS8, "MB11.88Z.0061.B03.0610121324"_XS8, ""_XS8, "Mac-F4208CC8"_XS8, // Intel Core Duo T2500 @ 2.00 GHz "MacBook"_XS8, "1.1"_XS8, "4H625HACVTH"_XS8, "MacBook-White"_XS8, 0x01, 0x04, 0x0f, 0, 0, 0x12, "branch"_XS8, "m70"_XS8, 0x71001 }, //MacBook2,1 / MacBook (13-inch Late 2006) - { "MacBook2,1"_XS8, "MB21.88Z.00A5.B07.0706270922"_XS8, NullXString8, "Mac-F4208CA9"_XS8, // Intel Core 2 Duo T7200 @ 2.00 GHz + { "MacBook2,1"_XS8, "MB21.88Z.00A5.B07.0706270922"_XS8, ""_XS8, "Mac-F4208CA9"_XS8, // Intel Core 2 Duo T7200 @ 2.00 GHz "MacBook"_XS8, "1.2"_XS8, "W8713HACWGL"_XS8, "MacBook-White"_XS8, 0x01, 0x13, 0x0f, 0, 0, 0x03, "branch"_XS8, "m75"_XS8, 0x72001 }, //MacBook3,1 / MacBook (13-inch Late 2007) - { "MacBook3,1"_XS8, "MB31.88Z.008E.B02.0803051832"_XS8, NullXString8, "Mac-F22788C8"_XS8, // Intel Core 2 Duo T7500 @ 2.20 GHz + { "MacBook3,1"_XS8, "MB31.88Z.008E.B02.0803051832"_XS8, ""_XS8, "Mac-F22788C8"_XS8, // Intel Core 2 Duo T7500 @ 2.20 GHz "MacBook"_XS8, "1.3"_XS8, "W8747HACZ63"_XS8, "MacBook-White"_XS8, 0x01, 0x24, 0x0f, 0, 0, 0x03, "branch"_XS8, "k36"_XS8, 0x72001 }, // need EPCI //MacBook4,1 / MacBook (13-inch, Early 2008) - { "MacBook4,1"_XS8, "MB41.88Z.00C1.B00.0802091535"_XS8, NullXString8, "Mac-F22788A9"_XS8, // Intel Core 2 Duo T8300 @ 2.40 GHz + { "MacBook4,1"_XS8, "MB41.88Z.00C1.B00.0802091535"_XS8, ""_XS8, "Mac-F22788A9"_XS8, // Intel Core 2 Duo T8300 @ 2.40 GHz "MacBook"_XS8, "1.3"_XS8, "W88A041A0P0"_XS8, "MacBook-Black"_XS8, 0x01, 0x31, 0x0f, 0, 0, 0x01, "branch"_XS8, "m82"_XS8, 0x74001 }, //MacBook5,1 / MacBook (13-inch, Aluminum, Late 2008) - { "MacBook5,1"_XS8, "MB51.88Z.007D.B03.0904271443"_XS8, NullXString8, "Mac-F42D89C8"_XS8, // Intel Core 2 Duo P7350 @ 2.00 GHz + { "MacBook5,1"_XS8, "MB51.88Z.007D.B03.0904271443"_XS8, ""_XS8, "Mac-F42D89C8"_XS8, // Intel Core 2 Duo P7350 @ 2.00 GHz "MacBook"_XS8, "1.3"_XS8, "W8944T1S1AQ"_XS8, "MacBook-Aluminum"_XS8, 0x01, 0x32, 0x0f, 0, 0, 0x08, "branch"_XS8, "m97"_XS8, 0x7a002 }, // need EPCI //MacBook5,2 / MacBook (13-inch, Early 2009) - { "MacBook5,2"_XS8, "MB52.88Z.0088.B05.0904162222"_XS8, NullXString8, "Mac-F22788AA"_XS8, // Intel Core 2 Duo P7450 @ 2.13 GHz + { "MacBook5,2"_XS8, "MB52.88Z.0088.B05.0904162222"_XS8, ""_XS8, "Mac-F22788AA"_XS8, // Intel Core 2 Duo P7450 @ 2.13 GHz "MacBook"_XS8, "1.3"_XS8, "W8913HAC4R1"_XS8, "MacBook-Black"_XS8, 0x01, 0x38, 0x0f, 0, 0, 0x05, "branch"_XS8, "k36b"_XS8, 0x7a002 }, //MacBook6,1 / MacBook (13-inch, Late 2009) @@ -141,47 +141,47 @@ PLATFORMDATA ApplePlatformData[] = "MacBook"_XS8, "1.0"_XS8, "C02TQHACHH27"_XS8, "MacBook-Aluminum"_XS8, 0x02, 0x42, 0x0f, 0, 0, 0x12, "j122"_XS8, "j122"_XS8, 0xf08009 }, // need EPCI //MacBookPro1,1 / MacBook Pro (15-inch Glossy) - { "MacBookPro1,1"_XS8, "MBP11.88Z.0055.B08.0610121325"_XS8, NullXString8, "Mac-F425BEC8"_XS8, // Intel Core Duo T2500 @ 2.00 GHz + { "MacBookPro1,1"_XS8, "MBP11.88Z.0055.B08.0610121325"_XS8, ""_XS8, "Mac-F425BEC8"_XS8, // Intel Core Duo T2500 @ 2.00 GHz "MacBook Pro"_XS8, "1.0"_XS8, "W8634HACVWZ"_XS8, "MacBook-Aluminum"_XS8, 0x01, 0x02, 0x0f, 0, 0, 0x10, "m1"_XS8, "m1"_XS8, 0x7b002 }, // need EPCI //MacBookPro1,2 / MacBook Pro (17-inch) - { "MacBookPro1,2"_XS8, "MBP12.88Z.0061.B03.0610121334"_XS8, NullXString8, "Mac-F42DBEC8"_XS8, // Intel Core Duo T2600 @ 2.17 GHz + { "MacBookPro1,2"_XS8, "MBP12.88Z.0061.B03.0610121334"_XS8, ""_XS8, "Mac-F42DBEC8"_XS8, // Intel Core Duo T2600 @ 2.17 GHz "MacBook Pro"_XS8, "1.0"_XS8, "W8629HACTHY"_XS8, "MacBook-Aluminum"_XS8, 0x01, 0x05, 0x0f, 0, 0, 0x10, "NA"_XS8, "NA"_XS8, 0x7b002 }, // need rBR RPlt EPCI //MacBookPro2,1 / MacBook Pro (17-inch Core 2 Duo) - { "MacBookPro2,1"_XS8, "MBP21.88Z.00A5.B08.0708131242"_XS8, NullXString8, "Mac-F42189C8"_XS8, // Intel Core 2 Duo T7600 @ 2.33 GHz + { "MacBookPro2,1"_XS8, "MBP21.88Z.00A5.B08.0708131242"_XS8, ""_XS8, "Mac-F42189C8"_XS8, // Intel Core 2 Duo T7600 @ 2.33 GHz "MacBook Pro"_XS8, "1.0"_XS8, "W8715HACW0J"_XS8, "MacBook-Aluminum"_XS8, 0x01, 0x14, 0x0f, 0, 0, 0x05, "NA"_XS8, "NA"_XS8, 0x7b002 }, // need rBR RPlt EPCI //MacBookPro2,2 / MacBook Pro (15-inch Core 2 Duo) - { "MacBookPro2,2"_XS8, "MBP22.88Z.00A5.B07.0708131242"_XS8, NullXString8, "Mac-F42187C8"_XS8, // Intel Core 2 Duo T7400 @ 2.16 GHz + { "MacBookPro2,2"_XS8, "MBP22.88Z.00A5.B07.0708131242"_XS8, ""_XS8, "Mac-F42187C8"_XS8, // Intel Core 2 Duo T7400 @ 2.16 GHz "MacBook Pro"_XS8, "1.0"_XS8, "W8827B4CW0L"_XS8, "MacBook-Aluminum"_XS8, 0x01, 0x13, 0x0f, 0, 0, 0x03, "NA"_XS8, "NA"_XS8, 0x7b002 }, // need rBR RPlt EPCI //MacBookPro3,1 / MacBook Pro (17-inch 2.4GHZ) - not exists in server - { "MacBookPro3,1"_XS8, "MBP31.88Z.0070.B07.0803051658"_XS8, NullXString8, "Mac-F4238BC8"_XS8, // Intel Core 2 Duo T7700 @ 2.40 GHz + { "MacBookPro3,1"_XS8, "MBP31.88Z.0070.B07.0803051658"_XS8, ""_XS8, "Mac-F4238BC8"_XS8, // Intel Core 2 Duo T7700 @ 2.40 GHz "MacBook Pro"_XS8, "1.0"_XS8, "W8841OHZX91"_XS8, "MacBook-Aluminum"_XS8, 0x01, 0x16, 0x0f, 0, 0, 0x11, "NA"_XS8, "NA"_XS8, 0x7b002 }, // need rBR RPlt EPCI //MacBookPro4,1 / MacBook Pro (17-inch, Early 2008) - { "MacBookPro4,1"_XS8, "MBP41.88Z.00C1.B03.0802271651"_XS8, NullXString8, "Mac-F42C89C8"_XS8, // Intel Core 2 Duo T9500 @ 2.60 GHz + { "MacBookPro4,1"_XS8, "MBP41.88Z.00C1.B03.0802271651"_XS8, ""_XS8, "Mac-F42C89C8"_XS8, // Intel Core 2 Duo T9500 @ 2.60 GHz "MacBook Pro"_XS8, "1.0"_XS8, "W88484F2YP4"_XS8, "MacBook-Aluminum"_XS8, 0x01, 0x27, 0x0f, 0, 0, 0x03, "m87"_XS8, "m87"_XS8, 0x7b002 }, // need EPCI //MacBookPro5,1 / MacBook Pro (15-inch, Late 2008) - { "MacBookPro5,1"_XS8, "MBP51.88Z.007E.B06.1202061253"_XS8, NullXString8, "Mac-F42D86C8"_XS8, // Intel Core 2 Duo P8600 @ 2.40 GHz + { "MacBookPro5,1"_XS8, "MBP51.88Z.007E.B06.1202061253"_XS8, ""_XS8, "Mac-F42D86C8"_XS8, // Intel Core 2 Duo P8600 @ 2.40 GHz "MacBook Pro"_XS8, "1.0"_XS8, "W88439FE1G0"_XS8, "MacBook-Aluminum"_XS8, 0x01, 0x33, 0x0f, 0, 0, 0x08, "m98"_XS8, "m98"_XS8, 0x7b002 }, //MacBookPro5,2 / MacBook Pro (17-inch, Early 2009) - { "MacBookPro5,2"_XS8, "MBP52.88Z.008E.B05.0905042202"_XS8, NullXString8, "Mac-F2268EC8"_XS8, // Intel Core 2 Duo T9600 @ 2.80 GHz + { "MacBookPro5,2"_XS8, "MBP52.88Z.008E.B05.0905042202"_XS8, ""_XS8, "Mac-F2268EC8"_XS8, // Intel Core 2 Duo T9600 @ 2.80 GHz "MacBook Pro"_XS8, "1.0"_XS8, "W8908HAC2QP"_XS8, "MacBook-Aluminum"_XS8, 0x01, 0x42, 0x0f, 0, 0, 0x04, "NA"_XS8, "NA"_XS8, 0x7b002 }, // need rBR RPlt EPCI //MacBookPro5,3 / MacBook Pro (15-inch, Mid 2009) - { "MacBookPro5,3"_XS8, "MBP53.88Z.00AC.B03.0906151647"_XS8, NullXString8, "Mac-F22587C8"_XS8, // Intel Core 2 Duo P8800 @ 2.66 GHz + { "MacBookPro5,3"_XS8, "MBP53.88Z.00AC.B03.0906151647"_XS8, ""_XS8, "Mac-F22587C8"_XS8, // Intel Core 2 Duo P8800 @ 2.66 GHz "MacBook Pro"_XS8, "1.0"_XS8, "W89E6HAC64C"_XS8, "MacBook-Aluminum"_XS8, 0x01, 0x48, 0x0f, 0, 0, 0x02, "NA"_XS8, "NA"_XS8, 0x7b002 }, // need rBR RPlt EPCI //MacBookPro5,4 / MacBook Pro (15-inch, 2.53GHz, Mid 2009) - { "MacBookPro5,4"_XS8, "MBP53.88Z.00AC.B03.0906151647"_XS8, NullXString8, "Mac-F22587A1"_XS8, // Intel Core 2 Duo P8700 @ 2.53 GHz + { "MacBookPro5,4"_XS8, "MBP53.88Z.00AC.B03.0906151647"_XS8, ""_XS8, "Mac-F22587A1"_XS8, // Intel Core 2 Duo P8700 @ 2.53 GHz "MacBook Pro"_XS8, "1.0"_XS8, "W8948HAC7XJ"_XS8, "MacBook-Aluminum"_XS8, 0x01, 0x49, 0x0f, 0, 0, 0x02, "NA"_XS8, "NA"_XS8, 0x7b002 }, // need rBR RPlt EPCI //MacBookPro5,5 / MacBook Pro (13-inch, Mid 2009) - { "MacBookPro5,5"_XS8, "MBP55.88Z.00AC.B03.0906151708"_XS8, NullXString8, "Mac-F2268AC8"_XS8, // Intel Core 2 Duo P7550 @ 2.26 GHz + { "MacBookPro5,5"_XS8, "MBP55.88Z.00AC.B03.0906151708"_XS8, ""_XS8, "Mac-F2268AC8"_XS8, // Intel Core 2 Duo P7550 @ 2.26 GHz "MacBook Pro"_XS8, "1.0"_XS8, "W8951HAC66E"_XS8, "MacBook-Aluminum"_XS8, 0x01, 0x47, 0x0f, 0, 0, 0x02, "branch"_XS8, "k24"_XS8, 0x7a003 }, //MacBookPro6,1 / MacBook Pro (17-inch, Mid 2010) @@ -275,37 +275,37 @@ PLATFORMDATA ApplePlatformData[] = //MacBookPro15,1 / MacBook Pro (15-inch, 2018) { "MacBookPro15,1"_XS8, "MBP151.88Z.F000.B00.2005132227"_XS8, "1037.120.87.0.0"_XS8, "Mac-937A206F2EE63C01"_XS8, // Intel Core i9-8950HK @ 2.90 GHz "MacBook Pro"_XS8, "1.0"_XS8, "C02X1HACKGYG"_XS8, "MacBook-Aluminum"_XS8, - 0, 0, 0, 0, 0, 0, NullXString8, "j680"_XS8, 0 }, + 0, 0, 0, 0, 0, 0, ""_XS8, "j680"_XS8, 0 }, //MacBookPro15,2 / MacBook Pro (13-inch, 2018, Four Thunderbolt 3 Ports) { "MacBookPro15,2"_XS8, "MBP152.88Z.F000.B00.2005132218"_XS8, "1037.120.87.0.0"_XS8, "Mac-827FB448E656EC26"_XS8, // Intel Core i5-8259U @ 2.30 GHz "MacBook Pro"_XS8, "1.0"_XS8, "C02X1HACJHCD"_XS8, "MacBook-Aluminum"_XS8, - 0, 0, 0, 0, 0, 0, NullXString8, "j132"_XS8, 0 }, + 0, 0, 0, 0, 0, 0, ""_XS8, "j132"_XS8, 0 }, //MacBookPro15,3 / MacBook Pro (15-inch, 2019) { "MacBookPro15,3"_XS8, "MBP153.88Z.F000.B00.2005132208"_XS8, "1037.120.87.0.0"_XS8, "Mac-1E7E29AD0135F9BC"_XS8, // Intel Core i9-9980HK @ 2.40 GHz "MacBook Pro"_XS8, "1.0"_XS8, "C02X1HACLVCG"_XS8, "MacBook-Aluminum"_XS8, - 0, 0, 0, 0, 0, 0, NullXString8, "j780"_XS8, 0 }, + 0, 0, 0, 0, 0, 0, ""_XS8, "j780"_XS8, 0 }, //MacBookPro15,4 / MacBook Pro (13-inch, 2019, Two Thunderbolt 3 ports) { "MacBookPro15,4"_XS8, "MBP154.88Z.F000.B00.2005132135"_XS8, "1037.120.87.0.0"_XS8, "Mac-53FDB3D8DB8CA971"_XS8, // Intel Core i7-8557U @ 1.70 GHz "MacBook Pro"_XS8, "1.0"_XS8, "FVFYXHACL411"_XS8, "MacBook-Aluminum"_XS8, - 0, 0, 0, 0, 0, 0, NullXString8, "j213"_XS8, 0 }, + 0, 0, 0, 0, 0, 0, ""_XS8, "j213"_XS8, 0 }, //MacBookPro16,1 / MacBook Pro (16-inch, 2019) { "MacBookPro16,1"_XS8, "MBP161.88Z.F000.B00.2005132259"_XS8, "1037.120.87.0.0"_XS8, "Mac-E1008331FDC96864"_XS8, // Intel Core i9-9980HK @ 2.40 GHz "MacBook Pro"_XS8, "1.0"_XS8, "C02ZPHACPG8W"_XS8, "MacBook-Aluminum"_XS8, - 0, 0, 0, 0, 0, 0, NullXString8, "j152f"_XS8, 0 }, + 0, 0, 0, 0, 0, 0, ""_XS8, "j152f"_XS8, 0 }, //MacBookPro16,2 / MacBook Pro (13-inch, 2020, Four Thunderbolt 3 ports) { "MacBookPro16,2"_XS8, "MBP162.88Z.F000.B00.2005132210"_XS8, "1037.120.87.0.0"_XS8, "Mac-5F9802EFE386AA28"_XS8, // Intel Core i7-1068NG7 @ 2.30 GHz "MacBook Pro"_XS8, "1.0"_XS8, "C02CLHACML7H"_XS8, "MacBook-Aluminum"_XS8, - 0, 0, 0, 0, 0, 0, NullXString8, "j214k"_XS8, 0 }, + 0, 0, 0, 0, 0, 0, ""_XS8, "j214k"_XS8, 0 }, //MacBookPro16,3 / MacBook Pro (13-inch, 2020, Two Thunderbolt 3 ports) { "MacBookPro16,3"_XS8, "MBP163.88Z.F000.B00.2005132118"_XS8, "1037.120.87.0.0"_XS8, "Mac-E7203C0F68AA0004"_XS8, // Intel Core i7-8557U @ 1.70 GHz "MacBook Pro"_XS8, "1.0"_XS8, "C02CJHACP3XY"_XS8, "MacBook-Aluminum"_XS8, - 0, 0, 0, 0, 0, 0, NullXString8, "J223"_XS8, 0 }, + 0, 0, 0, 0, 0, 0, ""_XS8, "J223"_XS8, 0 }, //MacBookAir1,1 / MacBook Air (Original) - { "MacBookAir1,1"_XS8, "MBA11.88Z.00BB.B03.0803171226"_XS8, NullXString8, "Mac-F42C8CC8"_XS8, // Intel Core 2 Duo P7500 @ 1.60 GHz + { "MacBookAir1,1"_XS8, "MBA11.88Z.00BB.B03.0803171226"_XS8, ""_XS8, "Mac-F42C8CC8"_XS8, // Intel Core 2 Duo P7500 @ 1.60 GHz "MacBook Air"_XS8, "1.0"_XS8, "W864947A18X"_XS8, "Air-Enclosure"_XS8, 0x01, 0x23, 0x0f, 0, 0, 0x20, "NA"_XS8, "NA"_XS8, 0x76005 }, // need rBR RPlt EPCI //MacBookAir2,1 / MacBook Air (Mid 2009) - { "MacBookAir2,1"_XS8, "MBA21.88Z.0075.B05.1003051506"_XS8, NullXString8, "Mac-F42D88C8"_XS8, // Intel Core 2 Duo L9600 @ 2.13 GHz + { "MacBookAir2,1"_XS8, "MBA21.88Z.0075.B05.1003051506"_XS8, ""_XS8, "Mac-F42D88C8"_XS8, // Intel Core 2 Duo L9600 @ 2.13 GHz "MacBook Air"_XS8, "1.0"_XS8, "W86494769A7"_XS8, "Air-Enclosure"_XS8, 0x01, 0x34, 0x0f, 0, 0, 0x08, "NA"_XS8, "NA"_XS8, 0x76005 }, // need rBR RPlt EPCI //MacBookAir3,1 / MacBook Air (11-inch, Late 2010) @@ -351,25 +351,25 @@ PLATFORMDATA ApplePlatformData[] = //MacBookAir8,1 / MacBook Air (Retina, 13-inch, 2018) { "MacBookAir8,1"_XS8, "MBA81.88Z.F000.B00.2005132104"_XS8, "1037.120.87.0.0"_XS8, "Mac-827FAC58A8FDFA22"_XS8, // Intel Core i5-8210Y @ 1.60 GHz "MacBook Air"_XS8, "1.0"_XS8, "FVFXJHACJK77"_XS8, "Air-Enclosure"_XS8, - 0, 0, 0, 0, 0, 0, NullXString8, "j140k"_XS8, 0 }, + 0, 0, 0, 0, 0, 0, ""_XS8, "j140k"_XS8, 0 }, //MacBookAir8,2 / MacBook Air (Retina, 13-inch, 2019) { "MacBookAir8,2"_XS8, "MBA82.88Z.F000.B00.2005132224"_XS8, "1037.120.87.0.0"_XS8, "Mac-226CB3C6A851A671"_XS8, // Intel Core i5-8210Y @ 1.60 GHz "MacBook Air"_XS8, "1.0"_XS8, "FVFXJHACLYWM"_XS8, "Air-Enclosure"_XS8, - 0, 0, 0, 0, 0, 0, NullXString8, "j140a"_XS8, 0 }, + 0, 0, 0, 0, 0, 0, ""_XS8, "j140a"_XS8, 0 }, //MacBookAir9,1 / MacBook Air (Retina, 13-inch, 2020) { "MacBookAir9,1"_XS8, "MBA91.88Z.F000.B00.2005132117"_XS8, "1037.120.87.0.0"_XS8, "Mac-0CFF9C7C2B63DF8D"_XS8, // Intel Core i5-1030NG7 @ 1.10 GHz "MacBook Air"_XS8, "1.0"_XS8, "FVFCCHACMNHP"_XS8, "Air-Enclosure"_XS8, - 0, 0, 0, 0, 0, 0, NullXString8, "J230K"_XS8, 0 }, + 0, 0, 0, 0, 0, 0, ""_XS8, "J230K"_XS8, 0 }, //Macmini1,1 / Mac mini (Early 2006) - { "Macmini1,1"_XS8, "MM11.88Z.0055.B08.0610121326"_XS8, NullXString8, "Mac-F4208EC8"_XS8, // Intel Core 2 Duo T2300 @ 1.67 GHz + { "Macmini1,1"_XS8, "MM11.88Z.0055.B08.0610121326"_XS8, ""_XS8, "Mac-F4208EC8"_XS8, // Intel Core 2 Duo T2300 @ 1.67 GHz "Mac mini"_XS8, "1.0"_XS8, "W8702N1JU35"_XS8, "Mini-Aluminum"_XS8, 0x01, 0x03, 0x0f, 0, 0, 0x04, "m40"_XS8, "m40"_XS8, 0x78002 }, // need EPCI //Macmini2,1 / Mac mini (Mid 2007) - { "Macmini2,1"_XS8, "MM21.88Z.009A.B00.0706281359"_XS8, NullXString8, "Mac-F4208EAA"_XS8, // Intel Core 2 Duo T7200 @ 2.00 GHz + { "Macmini2,1"_XS8, "MM21.88Z.009A.B00.0706281359"_XS8, ""_XS8, "Mac-F4208EAA"_XS8, // Intel Core 2 Duo T7200 @ 2.00 GHz "Mac mini"_XS8, "1.1"_XS8, "W8705W9LYL2"_XS8, "Mini-Aluminum"_XS8, 0x01, 0x19, 0x0f, 0, 0, 0x02, "NA"_XS8, "NA"_XS8, 0x78002 }, // need rBR EPCI //Macmini3,1 / Mac mini (Late 2009) - { "Macmini3,1"_XS8, "MM31.88Z.0081.B06.0904271717"_XS8, NullXString8, "Mac-F22C86C8"_XS8, // Intel Core 2 Duo P8700 @ 2.53 GHz + { "Macmini3,1"_XS8, "MM31.88Z.0081.B06.0904271717"_XS8, ""_XS8, "Mac-F22C86C8"_XS8, // Intel Core 2 Duo P8700 @ 2.53 GHz "Mac mini"_XS8, "1.0"_XS8, "YM003HAC9G6"_XS8, "Mini-Aluminum"_XS8, 0x01, 0x35, 0x0f, 0, 0, 0x01, "NA"_XS8, "NA"_XS8, 0x78002 }, // need rBR RPlt EPCI //Macmini4,1 / Mac mini (Mid 2010) @@ -403,37 +403,37 @@ PLATFORMDATA ApplePlatformData[] = //Macmini8,1 / Mac mini (2018) { "Macmini8,1"_XS8, "MM81.88Z.F000.B00.2005132145"_XS8, "1037.120.87.0.0"_XS8, "Mac-7BA5B2DFE22DDD8C"_XS8, // Intel Core i7-8700B @ 3.20 GHz "Mac mini"_XS8, "1.0"_XS8, "C07XL9WEJYVX"_XS8, "Mini-Aluminum"_XS8, - 0, 0, 0, 0, 0, 0, NullXString8, "j174"_XS8, 0 }, + 0, 0, 0, 0, 0, 0, ""_XS8, "j174"_XS8, 0 }, //iMac4,1 / iMac (20-inch, Early 2006) - { "iMac4,1"_XS8, "IM41.88Z.0055.B08.0609061538"_XS8, NullXString8, "Mac-F42786C8"_XS8, // Intel Core 2 Duo T2500 @ 2.00 GHz + { "iMac4,1"_XS8, "IM41.88Z.0055.B08.0609061538"_XS8, ""_XS8, "Mac-F42786C8"_XS8, // Intel Core 2 Duo T2500 @ 2.00 GHz "iMac"_XS8, "1.0"_XS8, "W8610HACVGM"_XS8, "iMac"_XS8, 0x01, 0x01, 0x0f, 0, 0, 0x05, "m38m39"_XS8, "m38"_XS8, 0x73002 }, // need EPCI //iMac4,2 / iMac (17-inch, Late 2006 CD) - { "iMac4,2"_XS8, "IM42.88Z.0071.B03.0610121320"_XS8, NullXString8, "Mac-F4218EC8"_XS8, // Intel Core 2 Duo T2400 @ 1.83 GHz + { "iMac4,2"_XS8, "IM42.88Z.0071.B03.0610121320"_XS8, ""_XS8, "Mac-F4218EC8"_XS8, // Intel Core 2 Duo T2400 @ 1.83 GHz "iMac"_XS8, "1.0"_XS8, "W8727HACWH5"_XS8, "iMac"_XS8, 0x01, 0x06, 0x0f, 0, 0, 0x00, "NA"_XS8, "NA"_XS8, 0x73002 }, // need rBR RPlt EPCI //iMac5,1 / iMac (20-inch, Late 2006) - { "iMac5,1"_XS8, "IM51.88Z.0090.B09.0706270921"_XS8, NullXString8, "Mac-F4228EC8"_XS8, // Intel Core 2 Duo T7400 @ 2.16 GHz + { "iMac5,1"_XS8, "IM51.88Z.0090.B09.0706270921"_XS8, ""_XS8, "Mac-F4228EC8"_XS8, // Intel Core 2 Duo T7400 @ 2.16 GHz "iMac"_XS8, "1.0"_XS8, "CK708HACVUW"_XS8, "iMac"_XS8, 0x01, 0x08, 0x0f, 0, 0, 0x02, "NA"_XS8, "NA"_XS8, 0x73002 }, // need rBR RPlt EPCI //iMac5,2 / iMac (17-inch, Late 2006 CD) - { "iMac5,2"_XS8, "IM52.88Z.0090.B09.0706270913"_XS8, NullXString8, "Mac-F4218EC8"_XS8, // Intel Core 2 Duo T5600 @ 1.83 GHz + { "iMac5,2"_XS8, "IM52.88Z.0090.B09.0706270913"_XS8, ""_XS8, "Mac-F4218EC8"_XS8, // Intel Core 2 Duo T5600 @ 1.83 GHz "iMac"_XS8, "1.0"_XS8, "QP702HACWH4"_XS8, "iMac"_XS8, 0x01, 0x06, 0x0f, 0, 0, 0x00, "NA"_XS8, "NA"_XS8, 0x73002 }, // need rBR RPlt EPCI //iMac6,1 / iMac (24-inch, Late 2006) - { "iMac6,1"_XS8, "IM61.88Z.0093.B07.0804281538"_XS8, NullXString8, "Mac-F4218FC8"_XS8, // Intel Core 2 Duo T7600 @ 2.33 GHz + { "iMac6,1"_XS8, "IM61.88Z.0093.B07.0804281538"_XS8, ""_XS8, "Mac-F4218FC8"_XS8, // Intel Core 2 Duo T7600 @ 2.33 GHz "iMac"_XS8, "1.0"_XS8, "QP708HACXA6"_XS8, "iMac"_XS8, 0x01, 0x08, 0x0f, 0, 0, 0x02, "NA"_XS8, "NA"_XS8, 0x73002 }, // need rBR RPlt EPCI //iMac7,1 / iMac (20-inch, Mid 2007) - { "iMac7,1"_XS8, "IM71.88Z.007A.B03.0803051705"_XS8, NullXString8, "Mac-F42386C8"_XS8, // Intel Core 2 Extreme X7900 @ 2.80 GHz + { "iMac7,1"_XS8, "IM71.88Z.007A.B03.0803051705"_XS8, ""_XS8, "Mac-F42386C8"_XS8, // Intel Core 2 Extreme X7900 @ 2.80 GHz "iMac"_XS8, "1.0"_XS8, "W8739HACX85"_XS8, "iMac-Aluminum"_XS8, 0x01, 0x20, 0x0f, 0, 0, 0x04, "NA"_XS8, "NA"_XS8, 0x73002 }, // need rBR RPlt EPCI //iMac8,1 / iMac (24-inch, Early 2008) - { "iMac8,1"_XS8, "IM81.88Z.00C1.B00.0802091538"_XS8, NullXString8, "Mac-F227BEC8"_XS8, // Intel Core 2 Duo E8235 @ 2.80 GHz + { "iMac8,1"_XS8, "IM81.88Z.00C1.B00.0802091538"_XS8, ""_XS8, "Mac-F227BEC8"_XS8, // Intel Core 2 Duo E8235 @ 2.80 GHz "iMac"_XS8, "1.3"_XS8, "QP849HACZE7"_XS8, "iMac-Aluminum"_XS8, 0x01, 0x29, 0x0f, 0, 0, 0x01, "k3"_XS8, "k3"_XS8, 0x73002 }, //iMac9,1 / iMac (24-inch, Early 2009) - { "iMac9,1"_XS8, "IM91.88Z.008D.B08.0904271717"_XS8, NullXString8, "Mac-F2218FA9"_XS8, // Intel Core 2 Duo E8435 @ 3.06 GHz + { "iMac9,1"_XS8, "IM91.88Z.008D.B08.0904271717"_XS8, ""_XS8, "Mac-F2218FA9"_XS8, // Intel Core 2 Duo E8435 @ 3.06 GHz "iMac"_XS8, "1.0"_XS8, "W8919HAC0TG"_XS8, "iMac-Aluminum"_XS8, 0x01, 0x36, 0x0f, 0, 0, 0x03, "NA"_XS8, "NA"_XS8, 0x73002 }, // need rBR RPlt EPCI //iMac10,1 / iMac (27-inch, Late 2009) @@ -527,21 +527,21 @@ PLATFORMDATA ApplePlatformData[] = //iMacPro1,1 /iMac Pro (2017) { "iMacPro1,1"_XS8, "IMP11.88Z.F000.B00.2005132136"_XS8, "1037.120.87.0.0"_XS8, "Mac-7BA5B2D9E42DDD94"_XS8, // Intel Xeon W-2140B CPU @ 3.20 GHz "iMac Pro"_XS8, "1.0"_XS8, "C02VVHACHX87"_XS8, "iMacPro-Aluminum"_XS8, - 0, 0, 0, 0, 0, 0, NullXString8, "j137"_XS8, 0 }, + 0, 0, 0, 0, 0, 0, ""_XS8, "j137"_XS8, 0 }, //MacPro1,1 / Mac Pro - { "MacPro1,1"_XS8, "MP11.88Z.005C.B08.0707021221"_XS8, NullXString8, "Mac-F4208DC8"_XS8, // Intel Xeon X5355 @ 2.66 GHz x2 + { "MacPro1,1"_XS8, "MP11.88Z.005C.B08.0707021221"_XS8, ""_XS8, "Mac-F4208DC8"_XS8, // Intel Xeon X5355 @ 2.66 GHz x2 "MacPro"_XS8, "1.0"_XS8, "W88A7HACUQ2"_XS8, "Pro-Enclosure"_XS8, 0x01, 0x07, 0x0f, 0, 0, 0x10, "m43"_XS8, "m43"_XS8, 0x79001 }, // need EPCI //MacPro2,1 / Mac Pro - { "MacPro2,1"_XS8, "MP21.88Z.007F.B06.0707021348"_XS8, NullXString8, "Mac-F4208DA9"_XS8, // Intel Xeon X5365 @ 2.99 GHz x2 + { "MacPro2,1"_XS8, "MP21.88Z.007F.B06.0707021348"_XS8, ""_XS8, "Mac-F4208DA9"_XS8, // Intel Xeon X5365 @ 2.99 GHz x2 "MacPro"_XS8, "1.0"_XS8, "W8930518UPZ"_XS8, "Pro-Enclosure"_XS8, 0x01, 0x15, 0x0f, 0, 0, 0x03, "m43a"_XS8, "m43a"_XS8, 0x79001 }, // need EPCI //MacPro3,1 / Mac Pro (Early 2008) - { "MacPro3,1"_XS8, "MP31.88Z.006C.B05.0802291410"_XS8, NullXString8, "Mac-F42C88C8"_XS8, // Intel Xeon E5462 @ 2.80 GHz x2 + { "MacPro3,1"_XS8, "MP31.88Z.006C.B05.0802291410"_XS8, ""_XS8, "Mac-F42C88C8"_XS8, // Intel Xeon E5462 @ 2.80 GHz x2 "MacPro"_XS8, "1.3"_XS8, "W88A77AA5J4"_XS8, "Pro-Enclosure"_XS8, 0x01, 0x30, 0x0f, 0, 0, 0x03, "m86"_XS8, "m86"_XS8, 0x79001 }, //MacPro4,1 / Mac Pro (Early 2009) - { "MacPro4,1"_XS8, "MP41.88Z.0081.B08.1001221313"_XS8, NullXString8, "Mac-F221BEC8"_XS8, // Intel Xeon X5670 @ 2.93 GHz x2 + { "MacPro4,1"_XS8, "MP41.88Z.0081.B08.1001221313"_XS8, ""_XS8, "Mac-F221BEC8"_XS8, // Intel Xeon X5670 @ 2.93 GHz x2 "MacPro"_XS8, "1.4"_XS8, "CT930HAC4PD"_XS8, "Pro-Enclosure"_XS8, 0x01, 0x39, 0x0f, 0, 0, 0x05, "NA"_XS8, "NA"_XS8, 0x7c002 }, // need rBR RPlt //MacPro5,1 / Mac Pro (Mid 2012) @@ -555,17 +555,17 @@ PLATFORMDATA ApplePlatformData[] = //MacPro7,1 / Mac Pro (2019) { "MacPro7,1"_XS8, "MP71.88Z.F000.B00.2005132104"_XS8, "1037.120.87.0.0"_XS8, "Mac-27AD2F918AE68F61"_XS8, // Intel Xeon W-3245M CPU @ 3.20 GHz "MacPro"_XS8, "1.0"_XS8, "F5KZNHACP7QM"_XS8, "Pro-Enclosure"_XS8, - 0, 0, 0, 0, 0, 0, NullXString8, "j16O"_XS8, 0 }, + 0, 0, 0, 0, 0, 0, ""_XS8, "j16O"_XS8, 0 }, //Xserve1,1 / Xserve (Late 2006) - { "Xserve1,1"_XS8, "XS11.88Z.0080.B01.0706271533"_XS8, NullXString8, "Mac-F4208AC8"_XS8, // Intel Xeon E5345 @ 2.33 GHz x2 + { "Xserve1,1"_XS8, "XS11.88Z.0080.B01.0706271533"_XS8, ""_XS8, "Mac-F4208AC8"_XS8, // Intel Xeon E5345 @ 2.33 GHz x2 "Xserve"_XS8, "1.0"_XS8, "CK703E1EV2Q"_XS8, "Xserve"_XS8, 0x01, 0x11, 0x0f, 0, 0, 0x05, "NA"_XS8, "NA"_XS8, 0x79001 }, // need rBR RPlt EPCI //Xserve2,1 / Xserve (Early 2008) - { "Xserve2,1"_XS8, "XS21.88Z.006C.B06.0804011317"_XS8, NullXString8, "Mac-F42289C8"_XS8, // Intel Xeon E5472 @ 3.00 GHz x2 + { "Xserve2,1"_XS8, "XS21.88Z.006C.B06.0804011317"_XS8, ""_XS8, "Mac-F42289C8"_XS8, // Intel Xeon E5472 @ 3.00 GHz x2 "Xserve"_XS8, "1.0"_XS8, "CK830DLQX8S"_XS8, "Xserve"_XS8, 0x01, 0x26, 0x0f, 0, 0, 0x03, "NA"_XS8, "NA"_XS8, 0x79001 }, // need rBR RPlt EPCI //Xserve3,1 / Xserve (Early 2009) - { "Xserve3,1"_XS8, "XS31.88Z.0081.B06.0908061300"_XS8, NullXString8, "Mac-F223BEC8"_XS8, // Intel Xeon E5520 @ 2.26 GHz + { "Xserve3,1"_XS8, "XS31.88Z.0081.B06.0908061300"_XS8, ""_XS8, "Mac-F223BEC8"_XS8, // Intel Xeon E5520 @ 2.26 GHz "Xserve"_XS8, "1.0"_XS8, "CK933YJ16HS"_XS8, "Xserve"_XS8, 0x01, 0x43, 0x0f, 0, 0, 0x04, "NA"_XS8, "NA"_XS8, 0x79001 }, // need rBR RPlt EPCI }; diff --git a/rEFIt_UEFI/cpp_foundation/XStringAbstract.h b/rEFIt_UEFI/cpp_foundation/XStringAbstract.h index b38018ced..133a15f8e 100755 --- a/rEFIt_UEFI/cpp_foundation/XStringAbstract.h +++ b/rEFIt_UEFI/cpp_foundation/XStringAbstract.h @@ -743,11 +743,15 @@ public: /* Copy Assign */ // Only other XString, no litteral at the moment. XStringAbstract& operator=(const XStringAbstract &S) { takeValueFrom(S); return *this; } /* Assign */ + #ifndef _MSC_VER #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Weffc++" + #endif template ThisXStringClass& operator =(const __String& S) { strcpy(S.s()); return *((ThisXStringClass*)this); } + #ifndef _MSC_VER #pragma GCC diagnostic pop + #endif // TEMPORARILY DISABLED // template // ThisXStringClass& operator =(const O* S) { strcpy(S); return *this; } diff --git a/rEFIt_UEFI/cpp_foundation/XStringArray.h b/rEFIt_UEFI/cpp_foundation/XStringArray.h index 8a4e12374..3a033670f 100755 --- a/rEFIt_UEFI/cpp_foundation/XStringArray.h +++ b/rEFIt_UEFI/cpp_foundation/XStringArray.h @@ -22,8 +22,7 @@ struct _xstringarray__char_type; template struct _xstringarray__char_type { -// typedef const char* type; - static const typename T::char_t* getCharPtr(const T& t) { return t.s(); } + static const typename T::char_t* getCharPtr(const T& t) { return t.s(); } }; template @@ -52,6 +51,29 @@ struct _xstringarray__char_type +#ifdef _MSC_VER +// I don't know why it's needed with VS. + +template +struct _xstringarray__char_type +{ + static const typename T::char_t* getCharPtr(const T& t) { return t.s(); } +}; + +template<> +struct _xstringarray__char_type +{ + static const typename XString8::char_t* getCharPtr(const XString8& t) { return t.s(); } +}; + +template<> +struct _xstringarray__char_type +{ + static const typename XStringW::char_t* getCharPtr(const XStringW& t) { return t.s(); } +}; + +#endif + //#define XStringArraySuper XObjArray template diff --git a/rEFIt_UEFI/cpp_foundation/unicode_conversions.h b/rEFIt_UEFI/cpp_foundation/unicode_conversions.h index cae328579..5b134019c 100644 --- a/rEFIt_UEFI/cpp_foundation/unicode_conversions.h +++ b/rEFIt_UEFI/cpp_foundation/unicode_conversions.h @@ -22,9 +22,9 @@ typedef uint32_t char32_t; typedef uint16_t char16_t; #endif -#ifndef __WCHAR_MAX__ -#define __WCHAR_MAX__ WCHAR_MAX -#endif +//#ifndef __WCHAR_MAX__ +//#define __WCHAR_MAX__ WCHAR_MAX +//#endif #if __WCHAR_MAX__ <= 0xFFFFu #define wchar_cast char16_t diff --git a/rEFIt_UEFI/cpp_unit_test/XString_test.cpp b/rEFIt_UEFI/cpp_unit_test/XString_test.cpp index b868f8b1f..77c0b5987 100755 --- a/rEFIt_UEFI/cpp_unit_test/XString_test.cpp +++ b/rEFIt_UEFI/cpp_unit_test/XString_test.cpp @@ -1583,7 +1583,7 @@ int XString_tests() nbTestFailed += 1; } } - +#ifndef _MSC_VER { XString8 xsReplace = "babcbdeb"_XS8; xsReplace.replaceAll(U'b', U'𐅃'); @@ -1592,6 +1592,7 @@ int XString_tests() XString8 xsReplace2 = "𐄔a𐄔c𐄔de𐄔"_XS8; xsReplace2.replaceAll(U'𐄔', U'x'); } +#endif // { // XString8 xsReplace = "𐅃𐅃ab"_XS8; // xsReplace.replaceAll("𐅃𐅃"_XS8, "12"_XS8); diff --git a/rEFIt_UEFI/cpp_unit_test/plist_tests.cpp b/rEFIt_UEFI/cpp_unit_test/plist_tests.cpp index 9680f5c1c..657cd6cba 100755 --- a/rEFIt_UEFI/cpp_unit_test/plist_tests.cpp +++ b/rEFIt_UEFI/cpp_unit_test/plist_tests.cpp @@ -3,6 +3,7 @@ #include "../cpp_foundation/unicode_conversions.h" #include "../Platform/plist/plist.h" +#ifndef _MSC_VER const char* config_all = " \ \ @@ -926,3 +927,12 @@ int plist_tests() return 0; } + +#else +int plist_tests() +{ + // TODO with VS, I get a string too big. + return 0; +} + +#endif \ No newline at end of file diff --git a/rEFIt_UEFI/cpp_unit_test/printf_lite-test.cpp b/rEFIt_UEFI/cpp_unit_test/printf_lite-test.cpp index cff1a416f..351533313 100755 --- a/rEFIt_UEFI/cpp_unit_test/printf_lite-test.cpp +++ b/rEFIt_UEFI/cpp_unit_test/printf_lite-test.cpp @@ -548,19 +548,19 @@ int test_printf_with_callback_timestamp() size_t i; for ( i=0 ; i '9' ) return 1; + if ( test_printf_with_callback_timestamp_buf[i] < '0' || test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; } if ( i < 1 ) return 1; if ( test_printf_with_callback_timestamp_buf[i] != ':' ) return 1; else i++; - if ( test_printf_with_callback_timestamp_buf[i] < '0' or test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; - if ( test_printf_with_callback_timestamp_buf[i] < '0' or test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; + if ( test_printf_with_callback_timestamp_buf[i] < '0' || test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; + if ( test_printf_with_callback_timestamp_buf[i] < '0' || test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; if ( test_printf_with_callback_timestamp_buf[i] != ':' ) return 1; else i++; - if ( test_printf_with_callback_timestamp_buf[i] < '0' or test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; - if ( test_printf_with_callback_timestamp_buf[i] < '0' or test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; + if ( test_printf_with_callback_timestamp_buf[i] < '0' || test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; + if ( test_printf_with_callback_timestamp_buf[i] < '0' || test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; if ( test_printf_with_callback_timestamp_buf[i] != '.' ) return 1; else i++; - if ( test_printf_with_callback_timestamp_buf[i] < '0' or test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; - if ( test_printf_with_callback_timestamp_buf[i] < '0' or test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; - if ( test_printf_with_callback_timestamp_buf[i] < '0' or test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; + if ( test_printf_with_callback_timestamp_buf[i] < '0' || test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; + if ( test_printf_with_callback_timestamp_buf[i] < '0' || test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; + if ( test_printf_with_callback_timestamp_buf[i] < '0' || test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; if ( test_printf_with_callback_timestamp_buf[i] != ' ' ) return 1; else i++; if ( test_printf_with_callback_timestamp_buf[i] != '-' ) return 1; else i++; if ( test_printf_with_callback_timestamp_buf[i] != ' ' ) return 1; else i++; @@ -572,19 +572,19 @@ int test_printf_with_callback_timestamp() printf_with_callback_timestamp_emitcr("Hello %s\n", test_printf_transmitS8Printf, nullptr, &printfNewline, 1, 1, "world"); for ( i=0 ; i '9' ) return 1; + if ( test_printf_with_callback_timestamp_buf[i] < '0' || test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; } if ( i < 1 ) return 1; if ( test_printf_with_callback_timestamp_buf[i] != ':' ) return 1; else i++; - if ( test_printf_with_callback_timestamp_buf[i] < '0' or test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; - if ( test_printf_with_callback_timestamp_buf[i] < '0' or test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; + if ( test_printf_with_callback_timestamp_buf[i] < '0' || test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; + if ( test_printf_with_callback_timestamp_buf[i] < '0' || test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; if ( test_printf_with_callback_timestamp_buf[i] != ':' ) return 1; else i++; - if ( test_printf_with_callback_timestamp_buf[i] < '0' or test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; - if ( test_printf_with_callback_timestamp_buf[i] < '0' or test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; + if ( test_printf_with_callback_timestamp_buf[i] < '0' || test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; + if ( test_printf_with_callback_timestamp_buf[i] < '0' || test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; if ( test_printf_with_callback_timestamp_buf[i] != '.' ) return 1; else i++; - if ( test_printf_with_callback_timestamp_buf[i] < '0' or test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; - if ( test_printf_with_callback_timestamp_buf[i] < '0' or test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; - if ( test_printf_with_callback_timestamp_buf[i] < '0' or test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; + if ( test_printf_with_callback_timestamp_buf[i] < '0' || test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; + if ( test_printf_with_callback_timestamp_buf[i] < '0' || test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; + if ( test_printf_with_callback_timestamp_buf[i] < '0' || test_printf_with_callback_timestamp_buf[i] > '9' ) return 1; else i++; if ( test_printf_with_callback_timestamp_buf[i] != ' ' ) return 1; else i++; if ( test_printf_with_callback_timestamp_buf[i] != '-' ) return 1; else i++; if ( test_printf_with_callback_timestamp_buf[i] != ' ' ) return 1; else i++; diff --git a/rEFIt_UEFI/cpp_unit_test/printlib-test.cpp b/rEFIt_UEFI/cpp_unit_test/printlib-test.cpp index c3ddd59f4..a7af8317d 100644 --- a/rEFIt_UEFI/cpp_unit_test/printlib-test.cpp +++ b/rEFIt_UEFI/cpp_unit_test/printlib-test.cpp @@ -6,6 +6,9 @@ // Copyright Β© 2017 Jief. All rights reserved. // +#ifdef CLOVER_BUILD + + #include // Only use angled for Platform, else, xcode project won't compile #include #include "../cpp_foundation/unicode_conversions.h" @@ -313,3 +316,6 @@ int printlib_tests(void) return nbTestFailed; } + +#endif + diff --git a/rEFIt_UEFI/cpp_util/globals_ctor.cpp b/rEFIt_UEFI/cpp_util/globals_ctor.cpp old mode 100644 new mode 100755 index 13a583365..c48a1e4d5 --- a/rEFIt_UEFI/cpp_util/globals_ctor.cpp +++ b/rEFIt_UEFI/cpp_util/globals_ctor.cpp @@ -105,8 +105,15 @@ void construct_globals_objects(EFI_HANDLE ImageHandle) void construct_globals_objects(EFI_HANDLE ImageHandle) { DBG("Work in progress\n"); + + EFI_LOADED_IMAGE* LoadedImage; + EFI_STATUS Status = gBS->HandleProtocol(gImageHandle, &gEfiLoadedImageProtocolGuid, (void **)&LoadedImage); + if (EFI_ERROR(Status)) { + panic("construct_globals_objects: Cannot get LoadedImage protocol"); + } + UINT32 PeCoffHeaderOffset = 0; - EFI_IMAGE_DOS_HEADER* DosHdr = (EFI_IMAGE_DOS_HEADER*)self.getSelfLoadedImage().ImageBase; + EFI_IMAGE_DOS_HEADER* DosHdr = (EFI_IMAGE_DOS_HEADER*)LoadedImage->ImageBase; if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) { // DOS image header is present, so read the PE header after the DOS image header PeCoffHeaderOffset = DosHdr->e_lfanew; @@ -114,7 +121,7 @@ void construct_globals_objects(EFI_HANDLE ImageHandle) DBG("ImageContext.PeCoffHeaderOffset: %08X %d\n", PeCoffHeaderOffset, PeCoffHeaderOffset); - EFI_IMAGE_OPTIONAL_HEADER_UNION* ImgHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *) ((UINTN) (self.getSelfLoadedImage().ImageBase) + PeCoffHeaderOffset); + EFI_IMAGE_OPTIONAL_HEADER_UNION* ImgHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *) ((UINTN) (LoadedImage->ImageBase) + PeCoffHeaderOffset); EFI_IMAGE_SECTION_HEADER* SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINTN) ImgHdr + sizeof(UINT32) + sizeof(EFI_IMAGE_FILE_HEADER) + ImgHdr->Pe32.FileHeader.SizeOfOptionalHeader); for (int Index = 0; Index < ImgHdr->Pe32.FileHeader.NumberOfSections; Index++, SectionHeader++) @@ -126,8 +133,8 @@ void construct_globals_objects(EFI_HANDLE ImageHandle) if (strcmp((CONST CHAR8*) SectionHeader->Name, ".CRT") == 0) { - ctor_ptr* currentCtor = (ctor_ptr*) (((UINTN) (self.getSelfLoadedImage().ImageBase)) + SectionHeader->PointerToRawData); - ctor_ptr* ctorend = (ctor_ptr*) (((UINTN) (self.getSelfLoadedImage().ImageBase)) + SectionHeader->PointerToRawData + SectionHeader->Misc.VirtualSize); + ctor_ptr* currentCtor = (ctor_ptr*) (((UINTN) (LoadedImage->ImageBase)) + SectionHeader->PointerToRawData); + ctor_ptr* ctorend = (ctor_ptr*) (((UINTN) (LoadedImage->ImageBase)) + SectionHeader->PointerToRawData + SectionHeader->Misc.VirtualSize); while (currentCtor < ctorend) { DBG("¤tCtor %X %d\n", (UINTN) (currentCtor), (UINTN) (currentCtor)); diff --git a/rEFIt_UEFI/cpp_util/memory.cpp b/rEFIt_UEFI/cpp_util/memory.cpp deleted file mode 100755 index c955f1dd9..000000000 --- a/rEFIt_UEFI/cpp_util/memory.cpp +++ /dev/null @@ -1,35 +0,0 @@ - - -#include // Only use angled for Platform, else, xcode project won't compile -#undef memset -#undef memcpy - -extern "C" { -/* - * memset and memcpy has to be provided for clang - */ - -#if 1 //!defined(_MSC_VER) - -#ifdef __GNUC__ - void* memset(void* dst, int ch, size_t count) __attribute__ ((used)); - //void* memcpy(void* dst, const void* src, UINT64 count) __attribute__ ((used)); -#else - void* memset(void* dst, int ch, UINT64 count); - //void* memcpy(void* dst, const void* src, UINT64 count); -#endif - -void* memset(void* dst, int ch, size_t count) -{ - SetMem(dst, count, (UINT8)(ch)); - return dst; -} -// -//void* memcpy(void* dst, const void* src, UINT64 count) -//{ -// CopyMem(dst, src, count); -// return dst; -//} -#endif - -} // extern "C" diff --git a/rEFIt_UEFI/cpp_util/memory.h b/rEFIt_UEFI/cpp_util/memory.h deleted file mode 100644 index 650a09e8d..000000000 --- a/rEFIt_UEFI/cpp_util/memory.h +++ /dev/null @@ -1,9 +0,0 @@ - -#include // Only use angled for Platform, else, xcode project won't compile - -CONST CHAR16 * -EFIAPI -ConstStrStr ( - IN CONST CHAR16 *String, - IN CONST CHAR16 *SearchString - ); diff --git a/rEFIt_UEFI/cpp_util/operatorNewDelete.cpp b/rEFIt_UEFI/cpp_util/operatorNewDelete.cpp index b36666afe..8bd61c034 100755 --- a/rEFIt_UEFI/cpp_util/operatorNewDelete.cpp +++ b/rEFIt_UEFI/cpp_util/operatorNewDelete.cpp @@ -41,6 +41,7 @@ void operator delete ( void* ptr ) noexcept { return FreePool(ptr); } + #ifdef _MSC_VER void _cdecl operator delete (void * ptr, unsigned __int64 count) #else @@ -51,3 +52,14 @@ void operator delete (void * ptr, UINTN count) } +#ifdef _MSC_VER +void _cdecl operator delete[](void * ptr, unsigned __int64 count) +#else +void operator delete[](void * ptr, UINTN count) +#endif +{ + return FreePool(ptr); +} + + + diff --git a/rEFIt_UEFI/cpp_util/operatorNewDelete.h b/rEFIt_UEFI/cpp_util/operatorNewDelete.h index a33f356fa..5d63c0651 100644 --- a/rEFIt_UEFI/cpp_util/operatorNewDelete.h +++ b/rEFIt_UEFI/cpp_util/operatorNewDelete.h @@ -2,15 +2,15 @@ extern "C" { #endif -/* - * Generated by c++ compiler, but needs to be called manually from main. - */ -void __cxx_global_var_init(); - -/* - * Needs to be called manually before exiting Clover.efi module. - */ -void __cxa_finalize(void *f); +///* +// * Generated by c++ compiler, but needs to be called manually from main. +// */ +//void __cxx_global_var_init(); +// +///* +// * Needs to be called manually before exiting Clover.efi module. +// */ +//void __cxa_finalize(void *f); #ifdef __cplusplus } diff --git a/rEFIt_UEFI/cpp_util/pure_virtual.cpp b/rEFIt_UEFI/cpp_util/pure_virtual.cpp index addcf4939..116fa0d5f 100644 --- a/rEFIt_UEFI/cpp_util/pure_virtual.cpp +++ b/rEFIt_UEFI/cpp_util/pure_virtual.cpp @@ -7,7 +7,18 @@ #include "../Platform/Platform.h" +#ifdef _MSC_VER + +extern "C" int _purecall() +{ + panic("Pure virtual function called"); +} + +#else + extern "C" void __cxa_pure_virtual() { panic("Pure virtual function called"); } + +#endif diff --git a/rEFIt_UEFI/entry_scan/legacy.cpp b/rEFIt_UEFI/entry_scan/legacy.cpp old mode 100644 new mode 100755 index 8d33dc092..ac6f8ed3f --- a/rEFIt_UEFI/entry_scan/legacy.cpp +++ b/rEFIt_UEFI/entry_scan/legacy.cpp @@ -79,7 +79,7 @@ BOOLEAN AddLegacyEntry(IN const XStringW& FullTitle, IN const XStringW& LoaderTi if (Volume->LegacyOS->Name.notEmpty()) { LTitle.takeValueFrom(Volume->LegacyOS->Name); if (Volume->LegacyOS->Name[0] == 'W' || Volume->LegacyOS->Name[0] == 'L') - ShortcutLetter = Volume->LegacyOS->Name[0]; + ShortcutLetter = (wchar_t)Volume->LegacyOS->Name[0]; // cast safe because value is 'W' or 'L' } else LTitle = L"Legacy OS"_XSW; } else diff --git a/rEFIt_UEFI/include/rename_helper.h b/rEFIt_UEFI/include/rename_helper.h new file mode 100644 index 000000000..2b7264f06 --- /dev/null +++ b/rEFIt_UEFI/include/rename_helper.h @@ -0,0 +1,2 @@ +//#define memcpy cl_memcpy +//#define memset cl_memset diff --git a/rEFIt_UEFI/refit.inf b/rEFIt_UEFI/refit.inf index 5c348ae0d..9e2c62950 100644 --- a/rEFIt_UEFI/refit.inf +++ b/rEFIt_UEFI/refit.inf @@ -259,13 +259,10 @@ Platform/VersionString.cpp Platform/VersionString.h ../Version.h - cpp_util/memory.cpp cpp_util/globals_ctor.cpp cpp_util/globals_ctor.h cpp_util/globals_dtor.cpp cpp_util/globals_dtor.h - cpp_util/memory.cpp - cpp_util/memory.h cpp_util/operatorNewDelete.cpp cpp_util/operatorNewDelete.h cpp_util/remove_ref.h @@ -319,6 +316,7 @@ cpp_unit_test/XStringArray_test.h cpp_unit_test/plist_tests.cpp cpp_unit_test/plist_tests.h + cpp_unit_test/XToolsCommon_test.cpp cpp_unit_test/XToolsCommon_test.h # cpp_unit_test/XUINTN_test.cpp # cpp_unit_test/XUINTN_test.h @@ -367,6 +365,7 @@ #OcDebugLogLib OcDebugLogLibOc2Clover OcAppleBootPolicyLib + CppMemLib [Guids] gEfiAcpiTableGuid diff --git a/rEFIt_UEFI/refit/menu.cpp b/rEFIt_UEFI/refit/menu.cpp index d256a79ee..02fa487bb 100644 --- a/rEFIt_UEFI/refit/menu.cpp +++ b/rEFIt_UEFI/refit/menu.cpp @@ -1804,14 +1804,14 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuKextBlockInjection(const XString8& UniSysVer) LOADER_ENTRY* LOADER_ENTRY::SubMenuKextInjectMgmt() { LOADER_ENTRY *SubEntry; - REFIT_MENU_SCREEN *SubScreen; + REFIT_MENU_SCREEN *SubSubScreen; XStringW kextDir; // UINTN i; XString8 ShortOSVersion; // CHAR16 *UniSysVer = NULL; SubEntry = new LOADER_ENTRY(); - NewEntry_(SubEntry, &SubScreen, ActionEnter, SCREEN_SYSTEM, "Block injected kexts->"_XS8); + NewEntry_(SubEntry, &SubSubScreen, ActionEnter, SCREEN_SYSTEM, "Block injected kexts->"_XS8); SubEntry->Flags = Flags; if (OSVersion.notEmpty()) { // DBG("chosen os %s\n", ChosenOS); @@ -1826,14 +1826,14 @@ LOADER_ENTRY* LOADER_ENTRY::SubMenuKextInjectMgmt() ShortOSVersion += OSVersion[i]; } - SubScreen->AddMenuInfoLine_f("Block injected kexts for target version of macOS: %s", ShortOSVersion.c_str()); + SubSubScreen->AddMenuInfoLine_f("Block injected kexts for target version of macOS: %s", ShortOSVersion.c_str()); // Add kext from 10 or 11 if ( OSVersion.contains(".") ) { XString8 osMajorVersion = OSVersion.subString(0, OSVersion.indexOf('.')); - SubScreen->AddMenuEntry(SubMenuKextBlockInjection(osMajorVersion), true); + SubSubScreen->AddMenuEntry(SubMenuKextBlockInjection(osMajorVersion), true); XString8 DirName; if (OSTYPE_IS_OSX_INSTALLER(LoaderType)) { @@ -1847,14 +1847,14 @@ LOADER_ENTRY* LOADER_ENTRY::SubMenuKextInjectMgmt() DirName = S8Printf("%s_normal", osMajorVersion.c_str()); } } - SubScreen->AddMenuEntry(SubMenuKextBlockInjection(DirName), true); + SubSubScreen->AddMenuEntry(SubMenuKextBlockInjection(DirName), true); } // Add kext from 10.{version} { XString8 DirName; DirName.takeValueFrom(ShortOSVersion); - SubScreen->AddMenuEntry(SubMenuKextBlockInjection(DirName), true); + SubSubScreen->AddMenuEntry(SubMenuKextBlockInjection(DirName), true); if (OSTYPE_IS_OSX_INSTALLER(LoaderType)) { DirName.S8Printf("%s_install", ShortOSVersion.c_str()); @@ -1867,7 +1867,7 @@ LOADER_ENTRY* LOADER_ENTRY::SubMenuKextInjectMgmt() DirName.S8Printf("%s_normal", ShortOSVersion.c_str()); } } - SubScreen->AddMenuEntry(SubMenuKextBlockInjection(DirName), true); + SubSubScreen->AddMenuEntry(SubMenuKextBlockInjection(DirName), true); } // Add kext from : @@ -1881,7 +1881,7 @@ LOADER_ENTRY* LOADER_ENTRY::SubMenuKextInjectMgmt() }else{ OSVersionKextsDirName = OSVersion; } - SubScreen->AddMenuEntry(SubMenuKextBlockInjection(OSVersionKextsDirName), true); + SubSubScreen->AddMenuEntry(SubMenuKextBlockInjection(OSVersionKextsDirName), true); } XString8 DirName; @@ -1896,22 +1896,22 @@ LOADER_ENTRY* LOADER_ENTRY::SubMenuKextInjectMgmt() DirName.S8Printf("%s_normal", OSVersion.c_str()); } } - SubScreen->AddMenuEntry(SubMenuKextBlockInjection(DirName), true); + SubSubScreen->AddMenuEntry(SubMenuKextBlockInjection(DirName), true); } } else { - SubScreen->AddMenuInfoLine_f("Block injected kexts for target version of macOS: %s", OSVersion.c_str()); + SubSubScreen->AddMenuInfoLine_f("Block injected kexts for target version of macOS: %s", OSVersion.c_str()); } kextDir = GetOtherKextsDir(TRUE); if ( kextDir.notEmpty() ) { - SubScreen->AddMenuEntry(SubMenuKextBlockInjection("Other"_XS8), true); + SubSubScreen->AddMenuEntry(SubMenuKextBlockInjection("Other"_XS8), true); } kextDir = GetOtherKextsDir(FALSE); if ( kextDir.notEmpty() ) { - SubScreen->AddMenuEntry(SubMenuKextBlockInjection("Off"_XS8), true); + SubSubScreen->AddMenuEntry(SubMenuKextBlockInjection("Off"_XS8), true); } - SubScreen->AddMenuEntry(&MenuEntryReturn, false); + SubSubScreen->AddMenuEntry(&MenuEntryReturn, false); return SubEntry; }