diff --git a/rEFIt_UEFI/entry_scan/common.cpp b/rEFIt_UEFI/entry_scan/common.cpp index 07cd054a6..6d6ac49a8 100644 --- a/rEFIt_UEFI/entry_scan/common.cpp +++ b/rEFIt_UEFI/entry_scan/common.cpp @@ -163,17 +163,19 @@ const XImage& ScanVolumeDefaultIcon(REFIT_VOLUME *Volume, IN UINT8 OSType, IN EF XString AddLoadOption(IN CONST XString& LoadOptions, IN CONST XString& LoadOption) { + // LoadOptions assumed out // If either option strings are null nothing to do - if (LoadOptions.isEmpty()) + if (LoadOption.isEmpty()) //nothing to add { // return LoadOption as nothing to add - return LoadOption; + return LoadOptions; } // If there is no option or it is already present duplicate original else { - if ( LoadOptions.ExistIn(LoadOption) ) return LoadOptions; + if ( LoadOptions.ExistIn(LoadOption) ) return LoadOptions; //good // Otherwise add option - return SPrintf("%s %s", LoadOptions.c_str(), LoadOption.c_str()); //LoadOptions + LoadOption +// return SPrintf("%s %s", LoadOptions.c_str(), LoadOption.c_str()); //LoadOptions + LoadOption + return LoadOptions + LoadOption; //why not? } } diff --git a/rEFIt_UEFI/entry_scan/loader.cpp b/rEFIt_UEFI/entry_scan/loader.cpp index 292ade7d5..a04d6cfde 100644 --- a/rEFIt_UEFI/entry_scan/loader.cpp +++ b/rEFIt_UEFI/entry_scan/loader.cpp @@ -1593,7 +1593,6 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex, continue; } - if (Volume->Hidden) { DBG("skipped because volume is hidden\n"); continue; diff --git a/rEFIt_UEFI/refit/main.cpp b/rEFIt_UEFI/refit/main.cpp index d601ebefc..0fb9e6f62 100644 --- a/rEFIt_UEFI/refit/main.cpp +++ b/rEFIt_UEFI/refit/main.cpp @@ -191,9 +191,9 @@ static EFI_STATUS StartEFILoadedImage(IN EFI_HANDLE ChildImageHandle, IN CONST CHAR16 *ImageTitle, OUT UINTN *ErrorInStep) { - EFI_STATUS Status, ReturnStatus; - EFI_LOADED_IMAGE *ChildLoadedImage; - CHAR16 ErrorInfo[256]; + EFI_STATUS Status, ReturnStatus; + EFI_LOADED_IMAGE_PROTOCOL *ChildLoadedImage; + CHAR16 ErrorInfo[256]; // CHAR16 *FullLoadOptions = NULL; // DBG("Starting %ls\n", ImageTitle); @@ -221,13 +221,15 @@ static EFI_STATUS StartEFILoadedImage(IN EFI_HANDLE ChildImageHandle, // when passing options to Apple's boot.efi... loadOptionsW = SWPrintf("%ls %s ", LoadOptionsPrefix, LoadOptions.c_str()); }else{ - loadOptionsW = SWPrintf("%s", LoadOptions.c_str()); // Jief : should we add a space ? Wasn't the case before big refactoring + loadOptionsW = SWPrintf("%s ", LoadOptions.c_str()); // Jief : should we add a space ? Wasn't the case before big refactoring. Yes, a space required. } // NOTE: We also include the terminating null in the length for safety. - ChildLoadedImage->LoadOptions = (void*)loadOptionsW.wc_str(); + ChildLoadedImage->LoadOptions = (void*)EfiStrDuplicate(loadOptionsW.wc_str()); //will it be deleted after the procedure exit? ChildLoadedImage->LoadOptionsSize = (UINT32)loadOptionsW.sizeInBytes() + sizeof(wchar_t); //((UINT32)StrLen(LoadOptions) + 1) * sizeof(CHAR16); -// DBG("Using load options '%ls'\n", LoadOptions); + DBG("start image '%ls'\n", ImageTitle); + DBG("Using load options '%ls'\n", (CHAR16*)ChildLoadedImage->LoadOptions); + } //DBG("Image loaded at: %p\n", ChildLoadedImage->ImageBase); //PauseForKey(L"continue");