| 143 | |
| 144 | |
| 145 | EFI_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 | // |
nothing calls this directly
no test coverage detected