MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / GetRootFromPath

Function GetRootFromPath

rEFIt_UEFI/refit/lib.cpp:145–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143
144
145EFI_STATUS GetRootFromPath(IN EFI_DEVICE_PATH_PROTOCOL* DevicePath, OUT EFI_FILE **Root)
146{
147 EFI_STATUS Status;
148 EFI_HANDLE NewHandle;
149 EFI_DEVICE_PATH_PROTOCOL* TmpDevicePath;
150 // DBG("Try to duplicate DevicePath\n");
151 TmpDevicePath = DuplicateDevicePath(DevicePath);
152 // DBG("TmpDevicePath found\n");
153 NewHandle = NULL;
154 Status = gBS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid,
155 &TmpDevicePath,
156 &NewHandle);
157 // DBG("volume handle found =%X\n", NewHandle);
158 CheckError(Status, L"while reopening volume handle");
159 *Root = EfiLibOpenRoot(NewHandle);
160 if (*Root == NULL) {
161 // DBG("volume Root Dir can't be reopened\n");
162 return EFI_NOT_FOUND;
163 }
164 if (FileExists(*Root, L"mach_kernel")) {
165 DBG("mach_kernel exists\n");
166 } else {
167 DBG("mach_kernel not exists\n");
168 }
169
170 return Status;
171}
172//
173// self recognition stuff
174//

Callers

nothing calls this directly

Calls 4

DuplicateDevicePathFunction · 0.85
CheckErrorFunction · 0.85
FileExistsFunction · 0.85
EfiLibOpenRootFunction · 0.50

Tested by

no test coverage detected