/* Function opens and returns a file handle to the root directory of a volume. */
EFI_FILE_HANDLE LibOpenRoot(IN EFI_HANDLE DeviceHandle)
/* Function opens and returns a file handle to the root directory of a volume. */
EFI_FILE_HANDLE LibOpenRoot(IN EFI_HANDLE DeviceHandle)
{
  EFI_STATUS                       Status;
  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL  *Volume;
  EFI_FILE_HANDLE                  File;
  File = NULL;
  Status = gBS->HandleProtocol (
                  DeviceHandle,
                  &gEfiSimpleFileSystemProtocolGuid,
                  (VOID *)&Volume
                  );
  if (!EFI_ERROR (Status)) {
    Status = Volume->OpenVolume (
                       Volume,
                       &File
                       );
  }
  return EFI_ERROR (Status) ? NULL : File;
}