/* 2) The second call must be after EndOfDxe and after ConnectAll, so that all device capsule FMP protocols are exposed. The system capsules are skipped. If the device capsules are NOT processed in first call, they are processed here. Each individual capsule result is recorded in capsule record variable. System may reset in this function, if reset is required by capsule processed in first call and second call. */
EFI_STATUS EFIAPI ProcessCapsules(VOID)
/* 2) The second call must be after EndOfDxe and after ConnectAll, so that all device capsule FMP protocols are exposed. The system capsules are skipped. If the device capsules are NOT processed in first call, they are processed here. Each individual capsule result is recorded in capsule record variable. System may reset in this function, if reset is required by capsule processed in first call and second call. */
EFI_STATUS EFIAPI ProcessCapsules(VOID)
{
  EFI_STATUS  Status;
  if (!mDxeCapsuleLibEndOfDxe) {
    Status = ProcessTheseCapsules (TRUE);
    if (mNeedReset && AreAllImagesProcessed ()) {
      DoResetSystem ();
    }
  } else {
    Status = ProcessTheseCapsules (FALSE);
    if (mNeedReset) {
      DoResetSystem ();
    }
  }
  return Status;
}