/* This function gets the protocol interface from the given handle, and obtains its address space descriptors. */
EFI_STATUS PciGetProtocolAndResource(IN EFI_HANDLE Handle, OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev, OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors)
/* This function gets the protocol interface from the given handle, and obtains its address space descriptors. */
EFI_STATUS PciGetProtocolAndResource(IN EFI_HANDLE Handle, OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev, OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors)
{
  EFI_STATUS  Status;
  Status = gBS->HandleProtocol (
                  Handle,
                  &gEfiPciRootBridgeIoProtocolGuid,
                  (VOID **)IoDev
                  );
  if (EFI_ERROR (Status)) {
    return Status;
  }
  Status = (*IoDev)->Configuration (*IoDev, (VOID **)Descriptors);
  if (Status == EFI_UNSUPPORTED) {
    *Descriptors = NULL;
    return EFI_SUCCESS;
  } else {
    return Status;
  }
}