/* This function gets the size and type of the capsule specified by CapsuleInstance. */
EFI_STATUS EFIAPI GetRecoveryCapsuleInfo(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This, IN UINTN CapsuleInstance, OUT UINTN *Size, OUT EFI_GUID *CapsuleType)
/* This function gets the size and type of the capsule specified by CapsuleInstance. */
EFI_STATUS EFIAPI GetRecoveryCapsuleInfo(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This, IN UINTN CapsuleInstance, OUT UINTN *Size, OUT EFI_GUID *CapsuleType)
{
  PEI_CD_EXPRESS_PRIVATE_DATA  *PrivateData;
  UINTN                        NumberRecoveryCapsules;
  EFI_STATUS                   Status;
  Status = GetNumberRecoveryCapsules (PeiServices, This, &NumberRecoveryCapsules);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  if ((CapsuleInstance == 0) || (CapsuleInstance > NumberRecoveryCapsules)) {
    return EFI_NOT_FOUND;
  }
  PrivateData = PEI_CD_EXPRESS_PRIVATE_DATA_FROM_THIS (This);
  *Size = PrivateData->CapsuleData[CapsuleInstance - 1].CapsuleSize;
  CopyMem (
    CapsuleType,
    &gRecoveryOnDataCdGuid,
    sizeof (EFI_GUID)
    );
  return EFI_SUCCESS;
}