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

Function LoadUserSettings

rEFIt_UEFI/Platform/Settings.cpp:502–554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500}
501
502EFI_STATUS
503LoadUserSettings (
504 IN EFI_FILE *RootDir,
505 IN const XStringW& ConfName,
506 TagDict** Dict)
507{
508 EFI_STATUS Status = EFI_NOT_FOUND;
509 UINTN Size = 0;
510 CHAR8* ConfigPtr = NULL;
511 XStringW ConfigPlistPath;
512 XStringW ConfigOemPath;
513
514 // DbgHeader("LoadUserSettings");
515
516 // load config
517 if ( ConfName.isEmpty() || Dict == NULL ) {
518 return EFI_NOT_FOUND;
519 }
520
521 ConfigPlistPath = SWPrintf("EFI\\CLOVER\\%ls.plist", ConfName.wc_str());
522 ConfigOemPath = SWPrintf("%ls\\%ls.plist", OEMPath.wc_str(), ConfName.wc_str());
523 if (FileExists (SelfRootDir, ConfigOemPath)) {
524 Status = egLoadFile(SelfRootDir, ConfigOemPath.wc_str(), (UINT8**)&ConfigPtr, &Size);
525 }
526 if (EFI_ERROR(Status)) {
527 if ((RootDir != NULL) && FileExists (RootDir, ConfigPlistPath)) {
528 Status = egLoadFile(RootDir, ConfigPlistPath.wc_str(), (UINT8**)&ConfigPtr, &Size);
529 }
530 if (!EFI_ERROR(Status)) {
531 DBG("Using %ls.plist at RootDir at path: %ls\n", ConfName.wc_str(), ConfigPlistPath.wc_str());
532 } else {
533 Status = egLoadFile(SelfRootDir, ConfigPlistPath.wc_str(), (UINT8**)&ConfigPtr, &Size);
534 if (!EFI_ERROR(Status)) {
535 DBG("Using %ls.plist at SelfRootDir at path: %ls\n", ConfName.wc_str(), ConfigPlistPath.wc_str());
536 }else{
537 DBG("Cannot find %ls.plist at path: '%ls' or '%ls'\n", ConfName.wc_str(), ConfigPlistPath.wc_str(), ConfigOemPath.wc_str());
538 }
539 }
540 }else{
541 DBG("Using %ls.plist at SelfRootDir at path: %ls\n", ConfName.wc_str(), ConfigOemPath.wc_str());
542 }
543
544 if (!EFI_ERROR(Status) && ConfigPtr != NULL) {
545 Status = ParseXML((const CHAR8*)ConfigPtr, Dict, Size);
546 if (EFI_ERROR(Status)) {
547 // Dict = NULL;
548 DBG("config.plist parse error Status=%s\n", efiStrError(Status));
549 return Status;
550 }
551 }
552 // free configPtr ?
553 return Status;
554}
555
556STATIC BOOLEAN AddCustomLoaderEntry(IN CUSTOM_LOADER_ENTRY *Entry)
557{

Callers 3

ApplyInputsFunction · 0.85
StartLoaderMethod · 0.85
RefitMainFunction · 0.85

Calls 7

SWPrintfFunction · 0.85
FileExistsFunction · 0.85
egLoadFileFunction · 0.85
ParseXMLFunction · 0.85
efiStrErrorFunction · 0.50
isEmptyMethod · 0.45
wc_strMethod · 0.45

Tested by

no test coverage detected