correct use of virtual pointer

Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
SergeySlice 2021-02-28 22:42:57 +03:00
parent 0dc0a93045
commit 45801ef2da
2 changed files with 11 additions and 5 deletions

View File

@ -1243,7 +1243,7 @@ FindStartupDiskVolume (
// case insensitive cmp
if ( LoaderPath.equalIC(gEfiBootLoaderPath) ) {
// that's the one
DBG(" - found entry %lld. '%ls', Volume '%ls', '%ls'\n", Index, LoaderEntry.Title.s(), Volume->VolName.wc_str(), LoaderPath.wc_str());
DBG(" - found entry %lld. '%ls', Volume '%ls', '%ls'\n", Index, LoaderEntry.Title.s(), Volume->VolName.wc_str(), LoaderPath.wc_str());
return Index;
}
}

View File

@ -852,9 +852,15 @@ void LOADER_ENTRY::StartLoader()
EFI_LOADED_IMAGE* OcLoadedImage;
Status = gBS->HandleProtocol(gImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &OcLoadedImage);
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL* FileSystem = LocateFileSystem(OcLoadedImage->DeviceHandle, OcLoadedImage->FilePath);
Status = OcStorageInitFromFs(&mOpenCoreStorage, FileSystem, self.getCloverDirFullPath().wc_str(), NULL);
const XStringW& XFP = self.getCloverDirFullPath();
CONST CHAR16 *FPath = NULL;
if (XFP.isEmpty()) {
DBG("full path is empty\n");
} else {
FPath = XFP.wc_str();
}
Status = OcStorageInitFromFs(&mOpenCoreStorage, FileSystem, FPath, NULL);
/*
* Define READ_FROM_OC to have mOpenCoreConfiguration initialized from config-oc.plist
@ -874,7 +880,7 @@ void LOADER_ENTRY::StartLoader()
#if !defined(USE_OC_SECTION_Acpi) && !defined(USE_OC_SECTION_Booter) && !defined(USE_OC_SECTION_DeviceProperties) && !defined(USE_OC_SECTION_Kernel) && !defined(USE_OC_SECTION_Misc) && \
!defined(USE_OC_SECTION_Nvram) && !defined(USE_OC_SECTION_PlatformInfo) && !defined(USE_OC_SECTION_Uefi)
memset(&mOpenCoreConfiguration, 0, sizeof(mOpenCoreConfiguration));
ZeroMem(&mOpenCoreConfiguration, sizeof(mOpenCoreConfiguration));
DBG("config-oc.plist isn't use at all\n");
#else