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

Function ReinitSelfLib

rEFIt_UEFI/refit/lib.cpp:256–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256EFI_STATUS ReinitSelfLib(VOID)
257{
258 // called after reconnect drivers to re-open file handles
259
260 EFI_STATUS Status;
261 EFI_HANDLE NewSelfHandle;
262 EFI_DEVICE_PATH_PROTOCOL* TmpDevicePath;
263
264// DbgHeader("ReinitSelfLib");
265
266 if (!SelfDevicePath) {
267 return EFI_NOT_FOUND;
268 }
269
270 TmpDevicePath = DuplicateDevicePath(SelfDevicePath);
271 DBG("reinit: self device path=%ls\n", FileDevicePathToXStringW(TmpDevicePath).wc_str());
272 if(TmpDevicePath == NULL)
273 return EFI_NOT_FOUND;
274
275 NewSelfHandle = NULL;
276 Status = gBS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid,
277 &TmpDevicePath,
278 &NewSelfHandle);
279 CheckError(Status, L"while reopening our self handle");
280 DBG("new SelfHandle=%llX\n", (uintptr_t)NewSelfHandle);
281
282 SelfRootDir = EfiLibOpenRoot(NewSelfHandle);
283 if (SelfRootDir == NULL) {
284 DBG("SelfRootDir can't be reopened\n");
285 return EFI_NOT_FOUND;
286 }
287 SelfDeviceHandle = NewSelfHandle;
288 /*Status = */SelfRootDir->Open(SelfRootDir, &ThemeX.ThemeDir, ThemePath.wc_str(), EFI_FILE_MODE_READ, 0);
289
290
291 /*Status = */SelfRootDir->Open(SelfRootDir, &OEMDir, OEMPath.wc_str(), EFI_FILE_MODE_READ, 0);
292 Status = SelfRootDir->Open(SelfRootDir, &SelfDir, SelfDirPath.wc_str(), EFI_FILE_MODE_READ, 0);
293 CheckFatalError(Status, L"while reopening our installation directory");
294 return Status;
295}
296
297
298static

Callers 1

RefitMainFunction · 0.85

Calls 7

DuplicateDevicePathFunction · 0.85
FileDevicePathToXStringWFunction · 0.85
CheckErrorFunction · 0.85
CheckFatalErrorFunction · 0.85
EfiLibOpenRootFunction · 0.50
wc_strMethod · 0.45
OpenMethod · 0.45

Tested by

no test coverage detected