From 96909661a0c16f25bb804d47acca93dd217a44b6 Mon Sep 17 00:00:00 2001 From: jief666 Date: Fri, 2 Apr 2021 10:46:23 +0300 Subject: [PATCH] Fix "ROM" parameter not read soon enough. --- rEFIt_UEFI/Platform/Settings.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/rEFIt_UEFI/Platform/Settings.cpp b/rEFIt_UEFI/Platform/Settings.cpp index acf5d8c25..51b53d488 100755 --- a/rEFIt_UEFI/Platform/Settings.cpp +++ b/rEFIt_UEFI/Platform/Settings.cpp @@ -3199,13 +3199,16 @@ EFI_STATUS GetEarlyUserSettings ( if (RtVariablesDict != NULL) { const TagStruct* Prop = RtVariablesDict->propertyForKey("ROM"); if (Prop != NULL) { - if ( !Prop->isString() ) { - // that's ok. Property can be data, but not when the value is 'UseMacAddr0' or 'UseMacAddr1'; - }else{ - if ((Prop->getString()->stringValue().equalIC("UseMacAddr0")) || - (Prop->getString()->stringValue().equalIC("UseMacAddr1"))) { -// gSettings.RtVariables.GetLegacyLanAddress = TRUE; - } + if ( Prop->isString() && Prop->getString()->stringValue().equalIC("UseMacAddr0") ) { + gSettings.RtVariables.RtROMAsString = Prop->getString()->stringValue(); + } else if ( Prop->isString() && Prop->getString()->stringValue().equalIC("UseMacAddr1") ) { + gSettings.RtVariables.RtROMAsString = Prop->getString()->stringValue(); + } else if ( Prop->isString() || Prop->isData() ) { // GetDataSetting accept both + UINTN ROMLength = 0; + uint8_t* ROM = GetDataSetting(RtVariablesDict, "ROM", &ROMLength); + gSettings.RtVariables.RtROMAsData.stealValueFrom(ROM, ROMLength); + } else { + MsgLog("MALFORMED PLIST : property not string or data in RtVariables/ROM\n"); } } }