Slice - this is gEfiPartTypeSystemPartGuid static EFI_GUID ESPGuid = { 0xc12a7328, 0xf81f, 0x11d2, { 0xba, 0x4b, 0x00, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b } }; there is assumed only one ESP partition. What if there are two HDD gpt formatted?
| 118 | //static EFI_GUID ESPGuid = { 0xc12a7328, 0xf81f, 0x11d2, { 0xba, 0x4b, 0x00, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b } }; |
| 119 | //there is assumed only one ESP partition. What if there are two HDD gpt formatted? |
| 120 | EFI_STATUS egFindESP(OUT EFI_FILE_HANDLE *RootDir) |
| 121 | { |
| 122 | EFI_STATUS Status; |
| 123 | UINTN HandleCount = 0; |
| 124 | EFI_HANDLE *Handles; |
| 125 | |
| 126 | Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiPartTypeSystemPartGuid, NULL, &HandleCount, &Handles); |
| 127 | if (!EFI_ERROR(Status) && HandleCount > 0) { |
| 128 | *RootDir = EfiLibOpenRoot(Handles[0]); |
| 129 | if (*RootDir == NULL) |
| 130 | Status = EFI_NOT_FOUND; |
| 131 | FreePool(Handles); |
| 132 | } |
| 133 | return Status; |
| 134 | } |
| 135 | //if (NULL, ...) then save to EFI partition |
| 136 | EFI_STATUS egSaveFile(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CONST CHAR16 *FileName, |
| 137 | IN CONST VOID *FileData, IN UINTN FileDataLength) |
no test coverage detected