/* This function searches for DXE capsules from the associated device and returns the number and maximum size in bytes of the capsules discovered. Entry 1 is assumed to be the highest load priority and entry N is assumed to be the lowest priority. */
EFI_STATUS EFIAPI GetNumberRecoveryCapsules(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This, OUT UINTN *NumberRecoveryCapsules)
/* This function searches for DXE capsules from the associated device and returns the number and maximum size in bytes of the capsules discovered. Entry 1 is assumed to be the highest load priority and entry N is assumed to be the lowest priority. */
EFI_STATUS EFIAPI GetNumberRecoveryCapsules(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This, OUT UINTN *NumberRecoveryCapsules)
{
  PEI_CD_EXPRESS_PRIVATE_DATA  *PrivateData;
  PrivateData = PEI_CD_EXPRESS_PRIVATE_DATA_FROM_THIS (This);
  UpdateBlocksAndVolumes (PrivateData, TRUE);
  UpdateBlocksAndVolumes (PrivateData, FALSE);
  *NumberRecoveryCapsules = PrivateData->CapsuleCount;
  if (*NumberRecoveryCapsules == 0) {
    return EFI_NOT_FOUND;
  }
  return EFI_SUCCESS;
}